cancel
Showing results for 
Search instead for 
Did you mean: 

How to read ALV Total

former_member205842
Participant
0 Kudos

Hi Experts,

                 Am using ALV to calculate total for my field, now my req is i have to read that grand total value into a variable and store it in my ztable..please let me know how to read grand total which am displaying to user .

Regards

Syed

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Syed,

Before saving to the Ztable, you can sum up the records of your internal table.

clear lv_total .

loop at lt_data into ls_data.

     lv_total = lv_total + ls_data-amt.

endloop.

Now, lv_total, you can save.

Regards,

Rama

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

The ALV Total will internally be calculated and stored in internal table 't_measure' attribute of method DO_AGGREGATION in class CL_SALV_WD_SERVICE_MANAGER.

There is no provision to retrieve this value( unless you enhance the mentioned class and store the value in some shared object). Even the Total value will be calculating by looping the internal table in the mentioned method.

So , remove the aggregation and calculate the total manually by looping the Internal table in your View controller and store it.

Hope this helps u,

Regards,

Kiran