Code: Alles auswählen.
* Defining the Groups
LOOP AT gt_flights INTO DATA(gs_flight)
GROUP BY ( airline = gs_flight-carrid
flight_no = gs_flight-connid
currency = gs_flight-currency
size = GROUP SIZE )
ASCENDING ASSIGNING FIELD-SYMBOL(<fs_group>).
*-> Code to be processed for each group
gt_result = VALUE gty_resulttab( BASE gt_result
( airline = <fs_group>-airline
flight = <fs_group>-flight_no
currency = <fs_group>-currency
paymentsum = REDUCE s_sum( INIT s = 0
FOR line IN GROUP <fs_group>
NEXT s = s + line-paymentsum )
) ).
ENDLOOP.
Code: Alles auswählen.
INIT s = 0