Ansicht
Dokumentation

ABENLOOP_GROUP_BY_FUNC_ABEXA - LOOP GROUP BY FUNC ABEXA

ABENLOOP_GROUP_BY_FUNC_ABEXA - LOOP GROUP BY FUNC ABEXA

rdisp/max_wprun_time - Maximum work process run time   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- Grouping with LOOP Using a Function

This example demonstrates the construction of the group key using a string function.

Source Code

Execute

Description

Grouping of an internal table text with group key binding. The group key of the group loop is constructed as a value of the type string, which is calculated from the content of each table line using the built-in function replace. This creates groups of lines that contain the same digits in the same order in their text. The groups are sorted in ascending order according to the group key.

The group key that is bound to a field symbol group> is produced in the group loop. The first group key is an initial text string. In a member loop, the lines of each group are placed in an internal table members using the value operator with the addition BASE. This table is also displayed.

members could also be filled by evaluating a table comprehension using FOR ... IN GROUP, instead of in a member loop LOOP AT GROUP:

members = VALUE #( FOR member> IN GROUP group> ( <member> ) ).

The executable example for grouping with FOR demonstrates how the entire group loop can be implemented using expressions.






CL_GUI_FRONTEND_SERVICES - Frontend Services   General Material Data  
This documentation is copyright by SAP AG.

Length: 2392 Date: 20240424 Time: 061409     sap01-206 ( 41 ms )