SAP LOOP AT GROUP ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Grouping with LOOP, Output Behavior
This example demonstrates the different output behavior in groupings of internal tables.

ABAP_SOURCE_CODE
DEMO CL_DEMO_LOOP_AT_GROUP_SYNTAX

ABAP_DESCRIPTION
In the grouping of an internal table itab, the six ways of combining the output behavior of the LOOP statement with the output behavior of the group loop are demonstrated. The three group loops with representative binding and three group loops with group key binding are executed, each using the three ways of defining the output behavior of the LOOP statement.
In each group loop a member loop is executed. Here, the group is specified after LOOP AT GROUP that is produced by the output behavior. In the member loop, the members are placed in an internal table members using the value operator with the addition BASE. This table is then output in the group loop. The result is the same in all cases.
In addition, the value of sy-tabix in the group loop is produced , which is different in the representative binding and in the group key binding. In the group key binding, the group key can also be addressed and produced, which is not possible in the representative binding.