Modifying all lines completely
* Entries: 100 (outer table), 20 (inner table)
* The entries to be modified: 50
* Actually, only the component FLAG is updated.
* However, the complete lines are moved.
LOOP AT ITAB INTO WA.
I = SY-TABIX MOD 2.
IF I = 0.
WA-FLAG = 'X'.
MODIFY ITAB FROM WA.
ENDIF.
ENDLOOP.
Modifying selected components only
* Entries: 100 (outer table), 20 (inner table)
* Entries to be modified: 50
* The component FLAG is updated directly.
LOOP AT ITAB ASSIGNING <WA>.
I = SY-TABIX MOD 2.
IF I = 0.
<WA>-FLAG = 'X'.
ENDIF.
ENDLOOP.
Documentation
Accessing the table entries directly in a "LOOP ... ASSIGNING ..."
accelerates the task of updating a set of lines of an internal table
considerably. Especially if inner tables must not be moved the
speed-up is high.