ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Internal Tables →  Processing Statements for Internal Tables →  LOOP AT itab → 

LOOP AT itab - result

Short Reference

Syntax

... { INTO wa }
  | { ASSIGNING <fs> [CASTING] }
  | { REFERENCE INTO dref }
  | { TRANSPORTING NO FIELDS } ... .

Effect

There are four alternatives for the output behavior:

If the internal table itab is specified as an existing data object, the syntax and meaning of the specified output behavior is the same as in the statement READ TABLE (with the exception that no further transport_options can be specified after INTO wa) and the same restrictions apply to modifications to key fields of the primary and secondary table keys.

In particular, inline declarations for the work area, the field symbol, or the reference variable using the declaration operators DATA and FIELD-SYMBOL are possible.

If the internal table is specified as the return value of a functional method, a constructor expression, or a table expression, the additions ASSIGNING and REFERENCE INTO can also be specified for LOOP (this is not the case with READ TABLE). The internal table is only available while the loop is being processed, which means that all field symbols and reference variables that point to rows in the internal table become invalid when the loop is exited.

Notes