‎2008 Jul 28 4:41 PM
Hi Abappers,
I have coded as
LOOP AT lt_toa01 INTO ls_toa01.
INSERT INTO toa01 VALUES ls_toa01.
IF sy-subrc NE 0.
MESSAGE ID 'ZIXMESSAGE' TYPE 'E' NUMBER '000'.
CONTINUE.
WRITE:/ ls_toa01-mandt,
ls_toa01-sap_object,
ls_toa01-object_id,
ls_toa01-archiv_id,
ls_toa01-arc_doc_id,
ls_toa01-ar_object,
ls_toa01-ar_date,
ls_toa01-del_date,
ls_toa01-reserve.
ENDIF.
CLEAR ls_toa01.
ENDLOOP.
Now, when the duplicate record exist in the database, it gives the error message as Duplicate entry.
and comes out of the program.
I want to do that if there are 100 records, and 51 st is the duplicate entry, then it list the 51st record and continue to upload the remaining records from the internal table to the Database table.
How to do this?
Please reply.
Regards,
Rahul
‎2008 Jul 28 4:46 PM
first of all get all the entries from your table ..
read if an entry already exists .. if not then only append .
LOOP AT lt_toa01 INTO ls_toa01.
read table it_toa01 with key ....
if sy-subrc = 0.
write 😕 it_toa01-field1 ...
sy-tabix.
else.
INSERT INTO toa01 VALUES ls_toa01.
.
.
.
.endif.
‎2008 Jul 28 4:51 PM
Hi Srinivas,
This is of the case when the test data contains the duplicate record.
What if the database table contains a record previously and test data also has that one.
Please clearify.
Regards,
Rahul
‎2008 Jul 28 4:54 PM
in such cases also this will filter the record and will not
update the record ..
‎2008 Jul 28 5:00 PM
Hello,
Its not working.
Its replacing the database record with the new one.
Please suggest other solution with error msg
Regards,
Rahul