‎2010 Sep 17 1:37 PM
Hi Experts,
I need help in sorting my output by their company code. Once this is sorted, the records in different company code will sorted by their cost center. The expected output is like below:
Company A
-
Pernr | Kostl |
-
1000 | 0001 |
-
1002 | 0001 |
-
total | 2 |
-
Pernr | Kostl |
-
1001 | 0002 |
-
total | 1 |
-
Company B
-
Pernr | Kostl |
-
1005 | 0006 |
-
total | 1 |
-
As of the moment I'm using the code below but the sorting is still a mess.
wa_sort-fieldname = 'BUKRS'.
wa_sort-group = '*'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
wa_sort-fieldname = 'KOSTL'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
Another question, how can the records be hidden and only the show the row of the subtotals and grand total?
Hope you can answer my questions. Thanks
Regards,
Rare
‎2010 Sep 17 1:48 PM
Hi,
I think as per your requirement you should use alv_tree, so that you can hide the other fields and show sorted data as requireed by you.
Thanks,
Anmol