cancel
Showing results for 
Search instead for 
Did you mean: 

Show Sum in ALV

mario_abel
Explorer
0 Kudos

Hello,

in my WD application i want to show the sum of the values in one column at the end of the table.

i.e. order / hours

11 / 4

8 / 3

  • / 7

What I have to do ? Could anybody give me an example for this issue?

Thanks and regards

Mario

Edited by: Mario Abel on Nov 3, 2008 4:36 PM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In the initialization of your ALV component add the following logic to activate the Calculation Tab (SET_AGGREGATION_ALLOWED).

DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
    l_ref_cmp_usage->create_component( ).
  ENDIF.

  DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  DATA l_table TYPE REF TO cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
  l_table->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
  l_table->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
  l_table->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).

Then in your settings you will get the Calculation Tab:

http://www.flickr.com/photos/tjung/3000180228/

Answers (0)