cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ALV grid sub totals

Former Member
0 Kudos

Hi,

I have managed to get totals working with web dynpro ALV using code like this :

DATA: lr_field TYPE REF TO cl_salv_wd_field.

  • For total calculations...

lo_value->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).

lr_field = lo_value->if_salv_wd_field_settings~get_field( 'N_OF_DLRS' ).

lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total ).

Please can someone advise how i can do subtotals also. Thanks

Edited by: Samir Vora on Jul 15, 2009 12:40 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try to use the methods IF_SALV_WD_FIELD_SETTINGS~SET_GROUP_AGGR_DISPLAYED of cl_salv_wd_config_table for Subtotals

Please check out this link

Regards,

Lekha.

Former Member
0 Kudos

Thanks for the link Lekha. I have already checked this out but i can only see the information for totals - can you please be more specific about sub totals? Thanks,

Former Member
0 Kudos

Hi,

One you get the field reference - > cl_salv_wd_field use these methods -

IF_SALV_WD_SORT~SET_GROUP_AGGREGATION_ALLOWED

IF_SALV_WD_SORT~IS_GROUP_AGGREGATION_ALLOWED

Regards,

Lekha.

Former Member
0 Kudos

Thanks again Lekha, I think i am doing something wrong - i am getting the error message :

Details

Error when processing your request

Error message: Property GROUP_AGGREGATION with the value X is not allowed for key figure (TIME_AUDITING)

Error Code: UNCAUGHT_EXCEPTION

Any ideas?

Also, if i want to give a total for 2 fields is it possible to do that? For example :

col1 col2 col3 col4

3 5 2 8

8

4 6 6 5

10

Former Member
0 Kudos

HI,

If you want totoal for other column/field -

lr_field = lo_value->if_salv_wd_field_settings~get_field( 'FIELD2). "GIVE other field name

lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total ).

Regards,

Lekha.

Former Member
0 Kudos

hello, thanks again.

i actually want a total of the two fields to be displayed

i.e. field 1 + field 2

- is that possible?

Edited by: Samir Vora on Jul 15, 2009 3:55 PM

Former Member
0 Kudos

Hi,

For summation of 2 columns, you have to write your own code. rather implementing the AGGREGATION types for fields.

In the context node, have one more field for Total.

By looping the table fill this Total Value and bind the table to node.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

For creating subtotals, you can have a look at following article:

[Tutorial for Creation Subtotals using ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20abap/tutorial%20for%20creating%20totals%20and%20subtotals%20using%20alv.pdf].

Hope this helps.

Regards

Manas Dua

Answers (0)