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

Help in alv

Former Member
0 Likes
586

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

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
562

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

4 REPLIES 4
Read only

anversha_s
Active Contributor
0 Likes
563

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

Read only

0 Likes
562

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

Read only

0 Likes
562

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

Read only

0 Likes
562

Use COLLECT statement before sending the table to alv display.

if found good please award some points.

regards,

Vishwas