DATA(lv_string) = REDUCE #( INIT str = || FOR line IN table_of_strings NEXT str = str && line).
Tag: REDUCE
[ABAP] Sum column using reduce with where condition
SELECT * FROM sflight INTO TABLE @DATA(lt_sflight).
DATA(a319_paymant_sum) = REDUCE #( INIT sum = 0
FOR flight IN lt_sflight WHERE ( planetype = 'A319' )
NEXT sum += flight-paymentsum ).
[ABAP] Finding maximum value of specific column in itab
DATA(maximum) = REDUCE #( INIT max = VALUE myType( )
FOR line IN myTable
NEXT max = COND #( WHEN line-myColumn > max THEN line-myColumn
ELSE max ) ).