10-01-2008 3:56 AM
Hi
I have a material number like 1,2,,3,4,5,6,7,8 and material group like 11,11,11,11,5,5,5,5,I have to find the count of a material number haveing material group 11 and 5.How should i do that.And also i have to print in scripts
Regards
Kumar
10-01-2008 4:08 AM
hai,
loop at itab where material group = '11'.
itab11 for counting.
endloop.
describe table itab11 lines <count>.
same for material group 5.
shan.
10-01-2008 4:24 AM
Hi
I gave example as 11 and 5 but i want to do for all material grouop..
10-01-2008 4:48 AM
Hi
Modify you in internal table with following structure, i mean create count field in the last.
data : begin of itab occurs 0,
matnr like mara-matnr,
matkl like mara-matkl,
count type i,
end of itab.
Create one more internal table
data : begin of itab1 occurs 0,
matnr like mara-matnr,
matkl like mara-matkl,
count type i,
end of itab1.
loop at itab.
itab-count = 1.
modify itab.
endloop.
loop at itab.
itab1-matr = itab-matnr.
itab1-matkl = itab-matkl.
itab1-count = itab-count.
collect itab1.
endloop.
Now itab1 will have count of Material group
Regards
MD