SAP LOOP GROUP BY RANDOM ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Random Grouping with LOOP
This example demonstrates a construction of the group key that does not depend on the table lines.

ABAP_SOURCE_CODE
DEMO CL_DEMO_LOOP_GRP_BY_RANDOM

ABAP_DESCRIPTION
Grouping of an internal table numbers with group key binding . The group key of the group loop is constructed as a value of the type i, which is determined as a random number completely independent of the internal table. This casts the table lines into groups of approximately the same size.
In the group loop, the lines of each group are placed in an internal table members using a table comprehension. This table is then output.