cancel
Showing results for 
Search instead for 
Did you mean: 

Alv subtotal and total

Former Member
0 Kudos

Hi Forum,

Till now i could able to display a table using ALV..but i couldnt able to do subtotal and total.

I'm new to webdynpro..kindly explain me how to code..

Thanks

swapna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

DATA: lr_field type ref to cl_salv_wd_field.

*For total calculations...

if wd_comp_controller->gref_model_efforts is not initial.

CALL METHOD wd_comp_controller->gref_model_efforts->if_salv_wd_std_functions~set_aggregation_allowed

EXPORTING

value = abap_true.

lr_field = wd_comp_controller->gref_model_efforts->if_salv_wd_field_settings~get_field( 'BILLABLE_VALUE' ). "The column name for which total needs to be done.

lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type =

if_salv_wd_c_aggregation=>aggrtype_total ).

endif.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks for the reply. In which method i need to put this code? Please clarify.

Thanks

Swapna

Former Member
0 Kudos

Hi,

You can use the code in the WDDOINIT method initially to set the Total to be displayed, later you can put the same in any action handler.

Regards,

Lekha.

Former Member
0 Kudos

hi lekha,

it couldnt solve the issue..however thanks for your effort..awarded the points..

thanks

swapna

Former Member
0 Kudos

Hi,

Where are you going wrong.

when I applied the same, I got the total.

Please try to have a look at the if_wd_salv_field_settings for the aggregation methods usage.

Regards,

Lekha.

Answers (0)