cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I had a similar problem and found a way to show all columns in subtotal line. This will help you to show unit with subtotal.

Check this thread: http://scn.sap.com/thread/3178248

-Manish

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Akashdeep ,

Did you get the solution to achieve the same. Even I am also looking if you have achieved can you please share the same to me too?

Former Member
0 Kudos

I had left the subtotal/total options, and programmatically adjusted the internal table to have the subtotal/total columns. Also, I varied the color of the specific rows adding another column to the table and making that column as technical.