‎2007 Aug 06 2:03 PM
Hello All,
In my Report I have values like
MATNR M Type
1 MT
2 MT
3 RT
4 RT
5 ST
Then,
How can i count How MANY Times MT's REPEATED in my report
The Final output looks like
MATNR count MTYPE
1 2 MT
2 2 MT
3 2 RT
4 3 RT
5 1 ST
Would u please help me in this problem?
‎2007 Aug 06 2:14 PM
use one more field say count.
sort itab by mtype.
l_tabix =1.
loop at itab.
at new itab-mtype.
if sy-tabix NE 1.
move sy-tabix-l_tabix to itab-count.
l_tabix = sy-tabix.
append itab.
clear itab.
endif.
endat.
endloop.
‎2007 Aug 06 2:08 PM
HI BY USEING ONE EXTRA VARIABLE
COUNT TYPE I
WHEN EVER UR PRINTING T HE OUT PUT CHECK FOR THIS mt
IF IT IS mt THEN COUNT WILL BE +1
OTHER WISE NO INCREMENT
REWRD IF USEFULL
‎2007 Aug 06 2:14 PM
use one more field say count.
sort itab by mtype.
l_tabix =1.
loop at itab.
at new itab-mtype.
if sy-tabix NE 1.
move sy-tabix-l_tabix to itab-count.
l_tabix = sy-tabix.
append itab.
clear itab.
endif.
endat.
endloop.