Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV tree -average

Former Member
0 Kudos

Hi ,

i am doing a alv tree display. in which i want to display the average amount .but i find only do_sum. is there any possiblity to do average.

thanks,

madhu

2 REPLIES 2

Former Member
0 Kudos

give

wa_fcat-DO_SUM = 'C'.    " to get average

Former Member
0 Kudos

In the 'end_of_list' event of the ALV you can calculate the avarage and display.

Ex:

call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  
            i_callback_html_end_of_list = 'END_OF_LIST_HTML'
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       exceptions
            program_error           = 1
            others                  = 2.

&----


*& Form end_of_list_html

&----


  • output at the end of the list - not in printed output *

&----


FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
   calculate the avarage and display. 
ENDFORM. "end_of_list_html.