Skip to Content
0
Former Member
Mar 12, 2013 at 03:10 PM

Hiding grand total in ALV and make related columns appear in subtotal

401 Views

Hi Experts,

I have an ALV output as follows:

1) I want to hide the grand total column (last row as shown in the image)

2) I want to display the Time Unit Text at the subtotal level (as shown in the first subtotal).

Any suggestions as how this can be achieved programatically?

Here is the code that has been written so far:

*Get Totals

lr_field_settings ?= lo_alv_model.

lr_field_settings->set_group_aggr_displayed( abap_true ).

lr_field = lr_field_settings->get_field( 'NAMEOFABSENCETYPE' ).

lr_field->if_salv_wd_sort~set_group_aggregation_allowed( abap_true ).

lr_field->if_salv_wd_sort~create_sort_rule( ).

lr_sort_rule = lr_field->if_salv_wd_sort~get_sort_rule( ).

lr_sort_rule->set_sort_order( if_salv_wd_c_sort=>sort_order_ascending ).

lr_sort_rule->set_group_aggregation( abap_true ).

lr_field = lr_field_settings->get_field( 'DEDUCT' ).

lr_field->if_salv_wd_aggr~create_aggr_rule( ).

lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule( ).

lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).

Thanks

Akash

Attachments

WDA_ALV.JPG (32.7 kB)