Ansicht
Dokumentation

ABENLOOP_GROUP_BY_EXPLICIT_ABEXA - LOOP GROUP BY EXPLICIT ABEXA

ABENLOOP_GROUP_BY_EXPLICIT_ABEXA - LOOP GROUP BY EXPLICIT ABEXA

TXBHW - Original Tax Base Amount in Local Currency   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

- Grouping with LOOP, Explicit and Implicit

This example demonstrates a self-programmed group loop and how it is replaced by GROUP BY.

Source Code

Execute

Description

The task of splitting the lines in a single one-column table into three groups by comparison criteria is solved in two different ways:

  • The method group_explicit works without GROUP BY. Instead, the grouping takes place explicitly in the ABAP program, which requires an explicit helper table helper_tab. After the grouping, the lines of the nested table refs in helper_tab point to the associated lines of the original table numbers for each group defined using the column key. This grouping loop is followed by the group loop across the helper table, where every loop pass accesses the group members by evaluating the nested tables refs.
  • The method group_by works with GROUP BY. The result matches the result of group_explicit. A comparison of the methods shows that the grouping loop of the first method in the second method is done implicitly by GROUP BY and no explicit helper table is required. Only the group loop can be seen.

Both methods perform three types of loops, the grouping loop, the group loop, and the optional member loops. Using GROUP BY is easier since the grouping loop does not need to be programmed explicitly and the second method becomes significantly shorter.






Fill RESBD Structure from EBP Component Structure   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 1833 Date: 20240425 Time: 133305     sap01-206 ( 45 ms )