Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

COUNT

Former Member
0 Likes
604

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
584

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

4 REPLIES 4
Read only

Former Member
0 Likes
585

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

Read only

Former Member
0 Likes
584

Hi,

U can do it this way...

1. Sort the internaltable.

2. Count inside AT END OF

U will get ur desired result....

Read only

Former Member
0 Likes
584

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~

Read only

Former Member
0 Likes
584

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.