09-08-2008 9:00 AM
Hello SDNites,
I am working on ALV List. Have done totaling on my output report using do_sum field of field catalog. Working fine.
But I have a requirement where I need to divide sum of two values.
Ex.
Actual Hours Actual Am Avg. Pric
3,646.000 3,985.60 1.09
250.000 19,525.22 78.1
384.000 26,265.00 68.4
1,611.000 28,027.20 17.4
510.000 1,500.00 2.94
6,401.000 79,303.02
Here 6,401.000 and 79,303.02 is total of respective columns. now i need to perform (79,303.02 / 6,401.000) and show it in Avg. Pric column. Please let me know how can i achieve the same using ALV List functionality.
09-08-2008 9:03 AM
Hi Abhishek,
Please go through these threads
Please check this WIKI which would help you more..
Check the Sample code in the below link
[SUBTOTAL in ALV LIST|http://www.sap-basis-abap.com/sapalv.htm]
Hope this would help you to solve the issue.
Good luck
Narin
09-08-2008 9:05 AM
Hi,
check this thread
http://www.allinterview.com/showanswers/28893.html
http://www.sapfans.com/forums/viewtopic.php?t=85191
Hope it will help you.
Regards,
Anirban
09-08-2008 10:17 AM
09-09-2008 4:46 AM
Hi Abhishek, You can not get that using ALV functionalities. That u have to calculate before u pass the internal table to REUSE* function module. Once your internal table is ready with data, 1. Loop the internal table, calculate the sums for the Actual Hours Actual Am, using under event AT LAST-ENDAT. calculate avg of those two. 2. Add those three values as another row(last row). That is ur ALV sum row. 3. Color the row using ALV functionality. I hope that you will get it . Regards, Venkat.O
09-08-2008 11:29 AM
Here 6,401.000 and 79,303.02 is total of respective columns. now i need to perform (79,303.02 / 6,401.000) and show it in Avg. Pric column. Please let me know how can i achieve the same using ALV List functionality
as u had make column for total in the same u have to create a column for avrg. to and get avarage in anather variable and display it in the respecive column.
else give me code i will check
regards
anil chaudhary