TYPES:
BEGIN OF ty_customer,
customer TYPE char10,
name TYPE char30,
city TYPE char30,
route TYPE char10,
END OF ty_customer.
TYPES: tt_customers TYPE SORTED TABLE OF ty_customer
WITH UNIQUE KEY customer.
TYPES: tt_citys TYPE STANDARD TABLE OF char30 WITH EMPTY KEY.
DATA(t_customres) =
VALUE tt_customers(
( customer = 'C0001' name = 'Test Customer 1' city = 'NY' route = 'R0001' )
( customer = 'C0002' name = 'Customer 2' city = 'LA' route = 'R0003' )
( customer = 'C0003' name = 'Good Customer 3' city = 'DFW' route = 'R0001' )
( customer = 'C0004' name = 'Best Customer 4' city = 'CH' route = 'R0003' )
( customer = 'C0005' name = 'So So Customer 5' city = 'NY' route = 'R0001' )
).
* Simply get the unique Routes, use WITHOUT MEMBERS
LOOP AT t_customres INTO DATA(ls_cust_2)
GROUP BY ( route = ls_cust_2-route )
ASCENDING
WITHOUT MEMBERS
REFERENCE INTO DATA(route_group_2).
WRITE: / route_group_2->route.
ENDLOOP.
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com
Social Plugin