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: 

Get the totals in abap with cl_salv_table

Former Member
0 Kudos

Hi people,

i need yor help..


I need to obtain the TOTALS in abap and compare them with another ALV.

The totals is showing in the alv, but i need to see it in my debug or my program in save it in a variable.( lv_total)

DATA: lv_total TYPE REF TO CL_SALV_AGGREGATION.

TRY.

         CALL METHOD lr_aggregations->add_aggregation

           EXPORTING

             columnname  = 'DMBTR'

             aggregation = if_salv_c_aggregation=>total

             RECEIVING

              value      = lv_total.

              .

       CATCH cx_salv_data_error .                        "#EC NO_HANDLER

       CATCH cx_salv_not_found .                         "#EC NO_HANDLER

       CATCH cx_salv_existing .                          "#EC NO_HANDLER

     ENDTRY.

Hope your helps

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ivan,

this is not yet a response but at least will keep your post in the loop.

Why don't you calculate lv_total since the calculation itself over the internal table is so easy?

regards,

Edgar

2 REPLIES 2

Former Member
0 Kudos

Hi Ivan,

this is not yet a response but at least will keep your post in the loop.

Why don't you calculate lv_total since the calculation itself over the internal table is so easy?

regards,

Edgar

0 Kudos

Finally i did it, as you said..

i did the calculation itself over the internal table,.


I just wanted to know if the method gives the totals, with no necessary calculation over the internal table..


Regards