LOOP AT t_customres INTO DATA(ls_cust1)

     GROUP BY  ( route = ls_cust1-route

                 SIZE  = GROUP SIZE

                 INDEX = GROUP INDEX )

      ASCENDING

      REFERENCE INTO DATA(route_group).

 

  WRITE: / 'Group', route_group->INDEX.

  WRITE: / route_group->route.

 

  DATA(members) = VALUE tt_customers( ).

  LOOP AT GROUP route_group ASSIGNING FIELD-SYMBOL(<route>).

    members = VALUE #( BASE members ( <route> ) ).

  ENDLOOP.

 

  LOOP AT members INTO DATA(ls_member).

    WRITE: /(5)", ls_member-customer, ls_member-name, ls_member-city.

  ENDLOOP.

  WRITE: /(5)", 'Group size ', route_group->size.

  SKIP 2.

ENDLOOP.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com