2006 Jan 18 3:35 PM
my requirement is like this:
PLANT MATNR PERIOD LGORT QUAN MEINS
A001 03201780 03122004 AA01 4 EA
A001 03201780 03122004 AA01 -2 LB
A001 03201780 03122004 AA01 8 LB
A003 03201782 03122004 AA02 4 EA
A003 03201782 03122004 AA02 -2 LB
A003 03201782 03122004 AA02 8 LB
now i want to cummulate the quantity from
UNIQUE fileds are : PLANT MATNR PERIOD LGORT QUAN MEINS
help me
Thanks & Regards
2006 Jan 18 3:40 PM
Hi Ramesh,
first sort the table based on the non numeric key fields viz,
sort itab by PLANT MATNR PERIOD LGORT MEINS.
loop at itab.
collect itab into wa.
write:/ wa.
endloop.
REgards,
Ravi
2006 Jan 18 3:38 PM
Use the COLLECT statement as discussed in the other post.
You will then get values like this.
PLANT MATNR PERIOD LGORT QUAN MEINS
A001 03201780 03122004 AA01 4 EA
A001 03201780 03122004 AA01 6 LB
A003 03201782 03122004 AA02 4 EA
A003 03201782 03122004 AA02 6 LB
Please make sure to award points for any helpful answers in your other post as well.
Regards,
Rich Heilman
2006 Jan 18 3:39 PM
Hi Ramesh,
As Ravi mentioned :
sort your internal table by PLANT MATNR MEINS.
LOOP At ITAB.
collect itab.
ENDLOOP.
Lanka
2006 Jan 18 3:40 PM
Hi Ramesh,
first sort the table based on the non numeric key fields viz,
sort itab by PLANT MATNR PERIOD LGORT MEINS.
loop at itab.
collect itab into wa.
write:/ wa.
endloop.
REgards,
Ravi
2006 Jan 18 3:44 PM
report zrich_0003 .
data: begin of itab occurs 0,
matnr type mard-matnr,
werks type mard-werks,
lgort type mard-lgort,
perid type sy-datum,
labst type mard-labst,
meins type mara-meins,
end of itab.
data: begin of itab2 occurs 0,
matnr type mard-matnr,
werks type mard-werks,
lgort type mard-lgort,
perid type sy-datum,
labst type mard-labst,
meins type mara-meins,
end of itab2.
itab-matnr = '03201780'.
itab-werks = 'A001'.
itab-lgort = 'AA01'.
itab-perid = '20041203'.
itab-labst = '4'.
itab-meins = 'EA'.
append itab.
itab-matnr = '03201780'.
itab-werks = 'A001'.
itab-lgort = 'AA01'.
itab-perid = '20041203'.
itab-labst = '-2'.
itab-meins = 'LB'.
append itab.
itab-matnr = '03201780'.
itab-werks = 'A001'.
itab-lgort = 'AA01'.
itab-perid = '20041203'.
itab-labst = '8'.
itab-meins = 'LB'.
append itab.
itab-matnr = '03201782'.
itab-werks = 'A003'.
itab-lgort = 'AA02'.
itab-perid = '20041203'.
itab-labst = '4'.
itab-meins = 'EA'.
append itab.
itab-matnr = '03201782'.
itab-werks = 'A003'.
itab-lgort = 'AA02'.
itab-perid = '20041203'.
itab-labst = '-2'.
itab-meins = 'LB'.
append itab.
itab-matnr = '03201782'.
itab-werks = 'A003'.
itab-lgort = 'AA02'.
itab-perid = '20041203'.
itab-labst = '8'.
itab-meins = 'LB'.
append itab.
loop at itab.
move-corresponding itab to itab2.
collect itab2.
endloop.
loop at itab2.
write:/ itab2-werks, itab2-lgort, itab2-labst.
endloop.
Regards,
Rich Heilman
2006 Jan 18 3:41 PM
declare another internal table interchanging quan and meins fields,
sort itab by plant matnr period lgort meins quan.
loop at itab.
at end of meins.
collect itab.
endat.
endloop.
2006 Jan 18 4:11 PM
sorry the uinique fields are PLANT MATNR PERIOD LGORT only
A001 03201780 03122004 AA01 4 EA
A001 03201780 03122004 AA01 -2 LB
A001 03201780 03122004 AA01 8 LB
A003 03201782 03122004 AA02 4 EA
A003 03201782 03122004 AA02 -2 LB
A003 03201782 03122004 AA02 8 LB
now i want to cummulate the quantity from
UNIQUE fileds are : PLANT MATNR PERIOD LGORT
now i think collect will not work. how can i do.
help me
Thanks & Regards