SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Compatible Work Area When Processing Control Levels
In ABAP Objects, and as of release 7.0 also outside of classes, the following statement causes an error message:
DATA: itab LIKE TABLE OF line,
wa(255) TYPE x.
SORT itab by col1.
LOOP AT itab INTO wa.
AT NEW col1.
ENDAT.
ENDLOOP.
Correct syntax:
DATA: itab LIKE TABLE OF line,
wa LIKE LINE OF itab.
SORT itab by col1.
LOOP AT itab INTO wa.
AT NEW col1.
ENDAT.
ENDLOOP.
Cause:
Control level processing is based on the line structure of the internal table. The system
evaluates the work area when it wants to change the control level, which means that the work area must have the same structure as the line of the table.