If you write the statement
LOOP AT <internal table>.
loops through an internal table and a screen table in parallel. In particular, LOOP AT loops through the portion of the internal table that is currently visible in the screen. You can use this form of the LOOP statement for both table controls and step loops.
The complete syntax for this form of the LOOP statement is:
LOOP AT <internal table> CURSOR <scroll-var>
[WITH CONTROL <table-control>
]
[FROM <line1>
]
[TO <line2>
].
...<actions>...
ENDLOOP.
This form of LOOP loops through the internal table, performing <actions> for each row. For each internal table row, the system transfers the relevant program fields to or from the corresponding screen table row.
When using step loops, omit the CURSOR parameter in the PAI event. The FROM and TO parameters are only possible with step loops. (For further information, refer to
Using Step Loops.) The WITH CONTROL parameter is only for use with table controls.For further information, refer to the following sections:
How the System Transfers Data Values
Scrolling and the Scroll Variables