on 10-07-2008 1:02 PM
Hi,
Kindly help me in deriving a logic for the below issue.
I have 3 internal tables with data...
itab1 contains 1 field (FECODE) and values are for eg: 11, 12, 13, 14, 15....
itab2 contains 1 field (CARTYPE) and values are for eg: PA-1, PA-2, PA-3,PA-4,PA-5
itab3 contains 2 fields(CARTYPE AND FECODE) values for eg : PA-1, 11; PA-1, 11; PA-1, 12; PA-1,13
PA-2, 11; PA-2,14; PA-3,12; PA-3,15; PA-3,15 ...So on which means it contains duplicate records as well
TASK: my task is to count the no of occurance of FECODE for CARTYPES
SO THE RESULT SHOULD BE FECODE, CARTYPE, COUNT
for eg: IT WOULD BE: PA-1, 11, 2 : PA-1,12,1 : PA-1,13,1 , PA-2,11,1...........PA-3,15,2.
You can use only the 3rd itab or combination or all of the itabs
Kindly help.
Your help is highly appreciated
Thanks and regards
Sujeer
Hi
Create a itab4 with similar structure of itab3 and with one extra field count of type i and change FECODE to character type.
loop at itab3.
itab4-cartype = itab3-cartype.
itab4-fecode = itab3-fecode.
itab4-count = 1.
collect itab4.
endloop.
your itab4 will have count
Regards
Madhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.