2013 Mar 06 7:54 AM
Hi all,
I have an internal table itab of following format:
Employee No Course ID
2001 C1
2001 C2
2001 C3
2002 C1
2002 C2
2003 C2
2003 C4
Now I want to select all duplicate records from this table, (comparing emp no) into another internal table, and send mail to that employee telling him that his respective courses against his emp no are pending.
For eg: select emp no 2001 and send a single mail to him suggesting that against him Courses C1, C2 and C3 are pending.
Same follows for other employees.
I need to do this for every employee number. But these emp numbers are altogether in a single internal table.
How can this be achieved?
Please Help!
Regards,
Pranita
2013 Mar 06 1:00 PM
hi,
according to my understanding u have to use the statement DESCRIBE .
by using that we can get count of duplicates then we can loop it and differentiate
my dought how u need to display like this right any other
2001 C1
2001 C2
2001 C3
plz try once and revert me back
2013 Mar 06 1:15 PM
Hello,
Is the problem that you don't want to send each employee one mail at a time in a loop?
One of the easiest way could be to find the distinct employees first in one internal table and then read the table you have, for each distinct employee to find the courses they have to do and send them a mail. Would the table have huge number of entries? Thanks.
Regards,
Kumud
2013 Mar 06 1:16 PM
Try to use At new Empno inside loop and use Continue statement to fill the remaining duplicate entries.
loop .
at new empno.
continue. use continue to full fill your requirement.
endat.
endloop.
Regards,
Y.Prashaanth.
2013 Mar 06 1:22 PM
Hi,
You could use the AT NEW .... ENDAT control level processing - http://help.sap.com/abapdocu_702/en/abenint_table_at_abexa.htm - within an internal table loop to achieve your requirement.
Ashok.