SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Cannot Use OCCURS with Declarative Statements
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.