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

Need help

Former Member
0 Likes
537

Hi all,

from below I want calculate the sum of quantity(lfimg).

REPORT YYEXAMPLE1 .

parameters : p_matnr like lips-matnr,

p_werks like lips-werks,

p_lgort like lips-lgort.

data : begin of it_lips occurs 0,

vbeln like lips-vbeln,

lfimg like lips-lfimg,

end of it_lips.

select vbeln lfimg into table it_lips

from lips

where matnr = p_matnr

and werks = p_werks

and lgort = p_lgort.

Loop at it_lips.

write:/ it_lips-vbeln , it_lips-lfimg.

endloop.

regards,

Ajay Ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
484

Hi Ajay,

REPORT YYEXAMPLE1 .


parameters : p_matnr like lips-matnr,
p_werks like lips-werks,
p_lgort like lips-lgort.

data : begin of it_lips occurs 0,
vbeln like lips-vbeln,
lfimg like lips-lfimg,
end of it_lips.

data : total type i.

select vbeln lfimg into table it_lips
from lips
where matnr = p_matnr
and werks = p_werks
and lgort = p_lgort.


Loop at it_lips.
total  = total + it_lips-lfimg 
write:/ it_lips-vbeln , total.
endloop.

Reward if useful

Regards

Aneesh.

3 REPLIES 3
Read only

Former Member
0 Likes
485

Hi Ajay,

REPORT YYEXAMPLE1 .


parameters : p_matnr like lips-matnr,
p_werks like lips-werks,
p_lgort like lips-lgort.

data : begin of it_lips occurs 0,
vbeln like lips-vbeln,
lfimg like lips-lfimg,
end of it_lips.

data : total type i.

select vbeln lfimg into table it_lips
from lips
where matnr = p_matnr
and werks = p_werks
and lgort = p_lgort.


Loop at it_lips.
total  = total + it_lips-lfimg 
write:/ it_lips-vbeln , total.
endloop.

Reward if useful

Regards

Aneesh.

Read only

Former Member
0 Likes
484

i got the solution.

rgads,Ajay ram

Read only

Former Member
0 Likes
484

Hi,

Please try this ...


...

select vbeln sum( lfimg ) into table it_lips
from lips
where matnr = p_matnr
and werks = p_werks
and lgort = p_lgort.

loop at it_lips.
  write:/ it_lips-vbeln , it_lips-lfimg.
endloop.

Regards,

Ferry Lianto