Decide whether the loop should copy or change the row

LOOP AT ... INTO gives a work area for processing the current row. When the goal is to update the row in the table itself, ASSIGNING binds a field symbol to the current line so assignments affect that line.

Mutate only the intended rows

LOOP AT dispatches ASSIGNING FIELD-SYMBOL(<dispatch>).
  IF <dispatch>-status = 'LATE'.
    <dispatch>-status = 'REVIEW'.
  ENDIF.
ENDLOOP.

Use ASSIGNING only when in-place mutation is intentional. A LOOP AT ... INTO copy can be clearer for read-only processing; INTO followed by MODIFY can make the update point explicit. Avoid changing fields that are part of a sorted or hashed key, because key integrity constrains how those rows can be updated.

Be cautious when deleting or inserting rows during a loop; use syntax designed for that operation and understand its iteration behavior. The browser exercise checks for code structure but cannot validate the resulting table.

Sources

Developer practice · ABAP

Practice: mark overdue dispatches for review

Loop over dispatches with ASSIGNING, change each LATE status to REVIEW, and store the row count in result.

Choose your ABAP environment

This choice changes the output pattern checked here: WRITE belongs in a classic executable report, while out->write( ) uses the supplied output reference in an ABAP Cloud class-run method. It does not switch the language version of the other code; check release and API availability in your target system.

Complete the task and include the output statement shown for your selected environment. Variable names can differ if you use them consistently. This browser checker checks structure only; it does not compile or run ABAP.

0 required structures detected · 0 checks