Skip to Content
0
Former Member
Mar 02, 2007 at 08:03 AM

Start routine to filter the duplicate records

24 Views

Dear Experts

I have two questions regarding the start routine.

1) I have a characteristic InfoObject with transactional InfoSource. Often the 'duplicate records' error happens during the data loading. I'm trying to put a start routine in the update rule to filter out the duplicate records.

After searching the SDN forum and SAPHelp, I use the code as:

DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING KEY1 KEY2 KEY3.

In my case, the InfoObject has 3 keys: SOURSYSTEM, /BIC/InfoObjectname, OBJVERS. My code is:

DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING SOURSYSTEM /BIC/InfoObjectname OBJVERS.

When checking the code I got message: 'E:No component exists with the name "OBJVERS".' So I only included the first 2 keys. But the routine does not work. The duplicate error is still happening. What is missing in this start routine?

2) Generally, for a start routine, do I really need to include the data declaration, ITAB or WA, SELECT statement etc.?

Do I have to use the statement below or just simply one line?

LOOP AT DATA_PACKAGE.

IF DATA_PACKAGE.....

.....

ENDIF.

ENDLOOP.

Thanks for your help in advance, Jessica