Application Development and Automation 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: 
Read only

alv do_sum issue

Former Member
0 Kudos
293

Dear all,

in my alv output,  3rd column = ( 2nd column / 1st column ) * 100.

this formula is not working for total row i.e  i need (20/523) * 100 = 3.82

if i give do_sum = 'X' , then 3rd column total is 100.

if i give do_sum = 'C' then 3rd column value is 6.25.

how to apply the same formula for total column also?.

Waiting for the reply,

Thanks,

Dhivya N.

1 ACCEPTED SOLUTION
Read only

VijayaKrishnaG
Active Contributor
0 Kudos
231

Hi Dhivya,

Better don't use DO_SUM, you just write a code and calculate the total sum of those required columns and then append that as last row to your output internal table. Then you can add a color (as total) to the last row.

And apply same formula as you required before appending the row.

Regards,

Vijay

3 REPLIES 3
Read only

former_member210770
Active Participant
0 Kudos
231

Hi Dhivya,

I recommended not to write explicit coding for Total . Please use SAP Sum button in alv toolbar on alv display screen . Please Save your layout with this functionality and make it global layout.

So each and every time you will run this report you will get grand total at the end. No need to write coding for Sum and sub sum functionality.

Don't forgot to take your layout in Transport request in which your report is exist . You can use standard program to take layout  of any report in Transport request.

Hope this will work.

Regards,

Sagar.

Read only

VijayaKrishnaG
Active Contributor
0 Kudos
232

Hi Dhivya,

Better don't use DO_SUM, you just write a code and calculate the total sum of those required columns and then append that as last row to your output internal table. Then you can add a color (as total) to the last row.

And apply same formula as you required before appending the row.

Regards,

Vijay

Read only

0 Kudos
231

Thanks vijaykrishna gudala.