‎2007 Jun 19 6:03 AM
hi experts,
i want to sum the total of opening stock for a particular raw material alone.but that raw material is used for manufaturing many finished goods.
what i ahev to do .
eg)
material1
mat1 100
mat2 200
material2
mat1 50
mat3 300
material3
mat1 100
mat2 400
so i want to get the total of each material.
what shall i do.
‎2007 Jun 19 6:06 AM
Use the collect statement for each Material...See F1 for help
Regards
Gopi
‎2007 Jun 19 6:08 AM
hi,
Loop at itab.
at end of MATNR.
sum.
write:total.
endat.
endloop.
Reward points if helpful
Regards,
Imran
‎2007 Jun 19 6:12 AM
here is the sample code ....
sort itab by material mat .
Loop at itab .
at end of material1.
sum .
write : itab-material , itab-mat , itab-amount. " for sub-total .
endat .
endat.
atlast material .
sum.
write : itab-material , itab-mat , itab-amount. "for total
endat .
endloop.rewardpoints if it is usefull
Girish
‎2007 Jun 19 7:02 AM
thanx for replies.
i am not getting the total for each material.it is displaying the total for all materials while using at last.
if i give
at last matnr.
it is throwing an error like this
. or with expected after last.
‎2007 Jun 19 7:15 AM
DATA : WTAB LIKE ITAB.
SORT ITAB BY MATNR.
LOOP AT ITAB.
MOVE-CORRESPONDING ITAB TO WTAB.
AT LAST.
SUM.
WRITE : / WTAB-MATNR, ITAB-QUANTITY.
ENDAT.
REGARDS
SHIBA DUTTA