‎2008 Oct 20 1:59 PM
DEAR All,
i am showing the output is
aa
cd
er
aa
cd
er
aa
tr . this way.
my target is
how many aa,cd,er is available.
for eg:
aa 3
cd 2
er 2.
tr 1.
plz help me
regards
raj
‎2008 Oct 20 2:01 PM
Hi,
u can use AT-NEW event. explain ur problem clearly man.
abaper007.
‎2008 Oct 20 2:01 PM
Hi,
u can use AT-NEW event. explain ur problem clearly man.
abaper007.
‎2008 Oct 20 2:07 PM
TYPES: begin of t_out_table occurs 0,
field type ... "yours aa, cd, er ...
number type i,
end of t_out_table.
data: out_table type t_out_table with key field with header line.
"now just use use COLLECT
Loop at int_table. "your internal table where you store aa, cd, er
move-corresponding int_table to out_table. "moves just the key
out_table-number = 1. "now you put for each entry 1
collect out_table. "and collect via key field
endloop.
‎2008 Oct 20 2:07 PM
Hi raj,
If you're using a table. you need to sort it.
before you can use this.
loop at itab.
at new itab-field.
**
endat.
at end of itab-field.
**
endat.
endloop.
Explain clearly from where you got the data.
regards,
Kais
‎2008 Oct 20 2:09 PM
Hello
data: begin of counttab occurs 0,
field1(2),
count type i,
end of counntab.
data: counter type i.
sort itab.
loop at itab.
at new itab-fieldname.
counter = 0.
endat.
counter = counter + 1.
at end of itab-fieldname.
clear counttab.
counttab-field1 = itab-fieldname.
counttab-count = counter.
append counttab.
endat.
endloop.
In table counttab you will have your result.