Application Development 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: 

Need counting logic

Former Member
0 Kudos
51

Hi All,

I got this internal table from this i need to collect the occurances.

Date--


party---- delivery number---material

13 oct |0031070496 |0084211581 |SSCC

13 oct |0031070496 |0084211581 |BOX

13 oct |0031070496 |0084211582 |SSCC

13 oct |0031070496 |0084211582 |BOX

13 oct |0031070496 |0084211584 |SSCC

13 oct |0031070496 |0084211585 |SSCC

13 oct |0031070496 |0084211585 |BOX

13 oct |0031070496 |0084211586 |SSCC

13 oct |0031070496 |0084211587 |SSCC

13 oct |0031070496 |2000003927 |SSCC

15 oct |0031070496 |2000003929 |SSCC

15 oct |0031070496 |2000003930 |SSCC

15 oct |0031070496 |2000003923 |SSCC

Now I want to give the report as

1) occurance of 1 SSCC

1 BOX per date, per party ==> occurs 3 times

2) occurance of 1 SSCC per date(13 oct), per party ==> occurs 4 times

3) occurance of 1 SSCC per date(15 oct), per party ==> occurs 3 times

can you help me with the coding how to bring this logic....

Regards,

Anbu.

Moderator message - Please do not ask or answer such basic questions - post locked

Edited by: Rob Burbank on Oct 13, 2009 11:08 AM

1 REPLY 1

Former Member
0 Kudos
26

Hi,

1. Loop internal table

2. get sy-tabix and store the values in a work area ( So each loop it stores the previous value, so u can compare the incoming and the previous values)

3. compare the date or SSCC/BOX vaues and increase the count ( Keep separate variable for each count like C1,C2) and update it in a separate internal table

4. based on the count display the report

5. Endloop

Hope this helps u.

Thanks,

Arunsri

Edited by: Arunsri on Oct 13, 2009 4:57 PM