2006 Dec 06 12:09 PM
Hi
i use class cl_salv_table to show alv.
i have 2 raw price and unit i want that the alv automatic will sum the price and unit
for example
price unit
10 A
20 A
33 B
12 B
i want that the answer will be 30 A and 45 B i don't want to do calculation, i know that the alv can do it
how can i do it?
thanks
2006 Dec 06 12:17 PM
hi,
one way is there.
if we want to give suubtotal or total, its shuld be numeric type.
so try the logic,
sort ur internal table by price and unit.
then
sum up all the price where unit is same.
and append that total and unit to the internal table u r passing to ALV.
thus u can do for all the different unit.
passs this internal table to the ALV
Then in the ALV u just show it.
rgds
Anver
Hi
i use class cl_salv_table to show alv.
i have 2 raw price and unit i want that the alv automatic will sum the price and unit
for example
price unit
10 A
20 A
33 B
12 B
i want that the answer will be 30 A and 45 B i don't want to do calculation, i know that the alv can do it
how can i do it?
thanks
2006 Dec 06 12:17 PM
hi,
one way is there.
if we want to give suubtotal or total, its shuld be numeric type.
so try the logic,
sort ur internal table by price and unit.
then
sum up all the price where unit is same.
and append that total and unit to the internal table u r passing to ALV.
thus u can do for all the different unit.
passs this internal table to the ALV
Then in the ALV u just show it.
rgds
Anver
2006 Dec 06 12:22 PM
Hi Anver
I want to know if the alv can't do it? the alv can do sum of field so i want to do sum but to take care another field in the calculation
i
2006 Dec 06 12:35 PM
hi,
did u read my post.
In that what i mentioned is, u can do any manipulations inside the internal table.
do the sum inside the internal with repect to unit.
pass this internal table to the ALV.
Rgds
Anver
2006 Dec 06 12:31 PM
Use COLLECT statement before sending the table to alv display.
if found good please award some points.
regards,
Vishwas