‎2008 Apr 21 1:26 PM
hi gurus,
my query is :
i have to calculate rate per min , p3 = p1/p2 in subtotal column.but in the scenario given below it is just adding all the rpm and giving the total = 0.56 ,
but -3612/13940 = 0.26 is correct.
EX:
amt(P1) minutes (p2) rpm(rate per min)(p3)
9,500.00- 5233 1.82-
1,500.00 3235 0.46
4,388.00 5472 0.80
-
3,612.00- 13940 0.56- -
subtotal of above rows
so i want the subtotal value of p3 as p1/p2 and not just sum
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:47 PM
‎2008 Apr 21 1:44 PM
This you can do using the Subtotal_text event of alv.
Check the sample code below..
in the event you will have the SUB TOTAL ROW INFORMATION, now divide the P1/P2 and get the P3 value.
modify the P3 value with value calculated , this will show the Changed value.
For information:-
you can find 2 programs one using class, one using Grid Function.
‎2008 Apr 22 9:35 AM
HELLO YASH,
UR REPLY HELPED ME.
BUT A SMALL PROBLEM,
I AM GETTING THE SUBTOTAL THE WAY I WANT LIKE : P3 = ( P1 / P2)
BUT THE SUM AT THE END IS SUMMING UP ALL THE
SUBTOTALS AND DISPLAYING.
IS THERE A WAY WHERE I CAN GET THE SUM ALSO THE SAME WAY LIKE P3 = P1 / P2 FOR THE FIELD P3 ???
REPLY , POINTS WILL BE AWARDED..
‎2008 Apr 22 4:14 AM
Hi Srikar, ALV does not calculate the way u r expecting, but what u can do is that calculate manually the way u r calculating for column p3(p1/p2) and make it color for that row as subtotal color. Regards, Venkat.O
‎2008 Apr 23 8:38 AM
thnks for ur replies now problm is solved
awarded points to suitable answers