cancel
Showing results for 
Search instead for 
Did you mean: 

Sub Totals in ALV

Former Member
0 Kudos

Hello,

i have a WDA-Applictaion containing a ALV-Grid. The Grid has a sort for column ORDER and a Total for column VALUE. Is there any possibility to get a sub-total after every ORDER as it is possible at ABAP-ALV?

If yes please post the coding.

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marco,

I am giving the piece of information which may help you to do the sub totals. In the following code i am setting property GROUP_AGGREGATION = ABAP_TRUE for the field CARRID'. So that whenever CARRID changes then the correponsind field which you set for summation will display the Subtotals also.

<b>Code::</b>

*... init FieldSettings

data:

lr_field_settings type ref to if_salv_wd_field_settings.

lr_field_settings ?= wd_this->r_table.

data: lr_field type ref to cl_salv_wd_field.

*... set ddic reference

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

lr_field->CREATE_SORT_RULE(

SORT_ORDER

SORT_POSITION

GROUP_AGGREGATION = ABAP_TRUE

VALUE

).

I think this may help you .

Warm Regards,

Vijay

Former Member
0 Kudos

Thanks to both of you.

Problem solved again.

Former Member
0 Kudos

Hi experts,

have you also any solution for that ALV Problem?

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Marco.

Maybe this link can help out:

http://help.sap.com/saphelp_nw2004s/helpdata/de/43/2582509fb24e85e10000000a422035/content.htm

But I have never worked with subtotals, so I can't give you a detailed solutions.

Cheers,

Sascha