Ansicht
Dokumentation

ABENMESH_LOOP - MESH LOOP

ABENMESH_LOOP - MESH LOOP

ABAP Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

LOOP AT mesh_path

LOOP AT mesh_path result.
  ...
ENDLOOP.


Effect

Reads all lines described by the results of a mesh path mesh_path in a loop. Essentially, the loop works like the statement LOOP AT itab across a directly specified table and accesses the lines of the last path node described by the mesh path instead. The output behavior result is specified in exactly the same way as in LOOP AT itab and must match the line type of the last path node. The system fields are set in the same way as in the corresponding statement LOOP AT itab, where sy-tabix depends on the table key used.

An additional condition can be specified in the square brackets [ ... ] of each mesh association using the additions USING KEY and WHERE log_exp.

The order in which the lines of the last path node are read depends on the order in which the lines were found when the mesh path was evaluated. Here, an iteration is performed across every follow-on node in the mesh path, in accordance with the table key used.

If only the initial mesh association is specified, the same rules apply when changing the last path node in the loop as when using LOOP AT itab. If a path extension is specified, the following additional restrictions apply:

  • No line can be deleted from the last path node.
  • No line can be inserted into the last path node, unless a hash key is used.
  • No component of the table key used can be changed.

The entire internal table must never be replaced or deleted in the loop. Mesh nodes that are evaluated when path extensions are used before the last path node, however, can be modified as required.

Notes

  • A loop across a mesh path can be understood as a nesting of loops LOOP AT itab across the matching follow-on nodes, whose WHERE conditions are constructed from ON conditions and the explicitly specified additional conditions. The evaluation itself, however, does not take place in nested LOOP statements and multiple iterations across a single table line never take place.
  • If path extensions are used, any lines found more than once in mesh path evaluations are iterated only once.
  • Tables located in front of the last path node in path extensions can be modified in any way in the loop, since they are evaluated only once before the loop is executed across the last path node.

Loops Across Mesh Paths






General Material Data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 3715 Date: 20240418 Time: 105813     sap01-206 ( 63 ms )