Ansicht
Dokumentation

ABENOO_OBS_OCCURS_2 - OO OBS OCCURS 2

ABENOO_OBS_OCCURS_2 - OO OBS OCCURS 2

BAL Application Log Documentation   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

Cannot Use OCCURS with Declarative Statements

In ABAP Objects, you cannot define internal tables using the OCCURS addition in the TYPES or DATA statements (or any other declarative statement).

In ABAP Objects, the following statements cause an error message:

DATA: BEGIN OF itab OCCURS n,
  ...
  fi ...,
  ...
END OF itab.

and

TYPES|DATA itab TYPE|LIKE line_type OCCURS n.

Correct syntax:

TYPES|DATA: BEGIN OF line_type,
  ...
  fi ...,
  ...
END OF line_type.

TYPES itab TYPE|LIKE STANDARD TABLE OF line_type
                     WITH NON-UNIQUE DEFAULT KEY
                     [INITIAL SIZE n].

DATA itab TYPE|LIKE [STANDARD] TABLE OF line_type
                    [INITIAL SIZE n].

Cause:

TYPE|LIKE TABLE OF, the new addition for the DATA and TYPES statements, makes the OCCURS addition superfluous in table declarations. If necessary, you can define the initial main memory requirement using the INITIAL SIZE addition.

Note:

The system automatically updates the short form

DATA itab TYPE|LIKE TABLE of line_type.

to

DATA itab TYPE|LIKE STANDARD TABLE OF line_type
                    WITH NON-UNIQUE DEFAULT KEY
                    INITIAL SIZE 0.

so that you can use the former.

The system automatically updates the short form

TYPES itab TYPE|LIKE STANDARD TABLE of line_type.

to

TYPES itab TYPE|LIKE STANDARD TABLE of line_type
                     INITIAL SIZE 0.

and defines a standard table type with a generic key that can be used to type interface parameters and field symbols.






BAL_S_LOG - Application Log: Log header data   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 2907 Date: 20240329 Time: 162030     sap01-206 ( 55 ms )