‎2008 Oct 21 10:57 AM
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 21 11:02 AM
Hi,
move your values inside an internal table and collect it.
data: begin of itab,
itext(2) type c,
icount type i,
end of itab.
move 'aa' to itab-itext,
'1' to itab-icount.
collect itab.
Regards
Nicole
‎2008 Oct 21 11:02 AM
Hi,
move your values inside an internal table and collect it.
data: begin of itab,
itext(2) type c,
icount type i,
end of itab.
move 'aa' to itab-itext,
'1' to itab-icount.
collect itab.
Regards
Nicole
‎2008 Oct 21 11:04 AM
Hi,
U can do it this way...
1. Sort the internaltable.
2. Count inside AT END OF
U will get ur desired result....
‎2008 Oct 21 11:08 AM
Raj,
My suggestion is you to please try to write this kind of logic by your own and use some tactics in these kind of CODE.
It will make you brain sharp and you will be good programmer.
if somebody write a code for you or logic for you than simply their brain would get exercised not yours.
so to keep alive yourself as long in ABAP ocean you must use your brain and efforts rather than asking someone else.
Just my 2 cents~
‎2008 Oct 21 11:08 AM
Hi,
declare the final internal table with two fields.
loop at itab.
read table it_final with key field1 = itab-field1.
if sy-subrc ne 0.
move itab-field1 to it_final-field1.
move 1 to it_final-field2.
append it_final.
else.
add 1 to it_final-fied2.
modify it_final.
endloop.
Regards,
Suresh.