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 ).
Tag: internal table
[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 ) ).