‎2007 Jun 26 3:42 PM
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
‎2007 Jun 26 3:51 PM
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.
‎2007 Jun 26 3:51 PM
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.
‎2007 Jun 26 3:51 PM
‎2007 Jun 26 3:52 PM
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