08-10-2017 6:09 PM
Hi Friends,
I have done lot of search and tried with different options before posting this question.
I am using OO ALV with method - set_table_for_first_display
My scenario, report will use 2 levels for sorting process(field1 and field2) and 2 fields for Sub totals(field3 and field4). ( I need all the 4 fields in the output including the sorting fields). How to pass the subtotal custom text for these 2 sorting levels ?
I tried method subtotal_text but this requires in sorting no_out = 'X'.
My text will be same for all level1 and Level2 records, so I cant use them in sorting process if I create new Text fields.
Any hints .pls let me know ..
Thank You.
Ravi.
08-11-2017 7:56 AM
You have the event SUBTOTAL_TEXT of CL_GUI_ALV_GRID (cf subtotal_text)
08-11-2017 8:35 AM
Hi Sandra,
Thanks for the reply. I tried this already. If I use this event what fields should I give in sort process?
As my data should be sorting based on first and second fields as per my logic. I can't use the 3rd field(Text field) for sort.
Please let me know on this.
Thanks.
08-12-2017 10:38 AM
It's explained in the official documentation (URL above) how it works. The basics for using this feature is to hide the subtotal column.
You may test with program BCALV_GRID_TEST_EVENTS:
In the demo, SAP replace all subtotal lines with the same text "My Subtotals Text", but it should better be "My Subtotals for plane type 146-200" for the first subtotal line whose plane type value is 146-200, etc.
If you want the column not being hidden, you may cheat the program by simply creating an additional column with the same values.