LOOP and READ TABLE targets used wrongly

 home  single file   example  edit

loop_target_misuse

Description

Reports a nested LOOP that reuses the target of the enclosing LOOP, and INTO where ASSIGNING was meant

Extended Information

Option nestedLoop: a LOOP inside a LOOP with the same INTO, REFERENCE INTO or ASSIGNING target.
After the inner ENDLOOP, the target holds the last row of the inner table, not the row of the
outer loop. Reported when the outer loop body uses the target after the inner ENDLOOP, before
it is assigned again.
Not reported: a target of a loop that has already ended, a target that is not a plain variable
or field symbol, an enclosing LOOP with GROUP BY, and a target the outer loop body does not use
after the inner loop.

Option intoFieldSymbol: LOOP AT ... INTO or READ TABLE ... INTO . INTO copies the row
into the data object the field symbol points to. When was bound by ASSIGNING, that data
object is a row of a table, and the statement overwrites it. ASSIGNING was meant.
Reported only for a field symbol declared in the method, form or function module, and only when
no ASSIGN and no STRUCTURE ... DEFAULT binds it there, so it can only point to a table row.

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples