SAP REDUCE STRUCTURED ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Table Reductions, Structured Result
This example demonstrates a reduction of the columns of a table to a structure.

ABAP_SOURCE_CODE
DEMO CL_DEMO_REDUCE_STRUCTURED

ABAP_DESCRIPTION
Reduces a two-column internal table itab using REDUCE. The content of the first column of all lines is concatenated after the FOR expression, the total of the second column is calculated, and the maximum value of the second column is determined. These values are assigned to the components of the local structure res, which is provided as the result.
The separator sep in the concatenation is declared as a helper variable after INIT. It is initial for the first line read and set to a value here for the evaluation of the following lines.