Koray Tugay
Koray Tugay

Reputation: 23800

Difference between Internal Table declarations OCCURS and TYPE TABLE OF?

And which one should be preferred / why?

So I have a TYPE defined locally:

TYPES:
    BEGIN OF CUSTOMER_STRU_TYPE,
        KUNNR TYPE KNA1-KUNNR,
        NAME1 TYPE KNA1-NAME1,
    END OF CUSTOMER_STRU_TYPE.

and I think these 2 statements seen below will both do the same thing:

DATA:
    CUSTOMER_TAB TYPE CUSTOMER_STRU_TYPE OCCURS 5.

DATA:
    CUSTOMER_TAB TYPE STANDARD TABLE OF CUSTOMER_STRU_TYPE.

Are there any differences between the 2 statements seen above and which one should be preferred?

Upvotes: 1

Views: 1611

Answers (1)

David
David

Reputation: 86

The main difference between the two statements is that, in the first one you're reserving memory space for storing 5 lines of customer_tab table. In terms of performance, the best statement is the second one.

Upvotes: 3

Related Questions