cancel
Showing results for 
Search instead for 
Did you mean: 

Aggregation rules for a table.

Former Member
0 Kudos

Is it possible to set aggregation rules and group aggregation rules for a table, the same way it is done for an alv with the following code?

If so, how is it done?

Thank you in advance.

lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_GROUP_AGGREGATION_ALLOWED( ).

lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_AGGREGATION_ALLOWED( ).

data: lr_field_settings type ref to if_salv_wd_field_settings,

lr_field type ref to cl_salv_wd_field,

lr_aggr_rule type ref to cl_salv_wd_aggr_rule.

lr_field_settings ?= lo_value.

lr_field_settings->set_group_aggr_displayed( abap_true ).

lr_field_settings->set_aggr_before_items( abap_true ).

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

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 ).

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

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 ).

Accepted Solutions (0)

Answers (1)

Answers (1)

Yashpal
Active Contributor
0 Kudos

Hi ,

U can use the summary cell....... see the below link..

http://help.sap.com/saphelp_nw70/helpdata/en/b5/ac884118aa1709e10000000a155106/frameset.htm

Regards

Yash