10-30-2007 3:32 PM
Hi to all........
1.......If i use insert key word in my report for inserting a record into database table.
but unfortunatly that record is exiting in the database table.now if i proceed with my inset statement what will happen exactly. wether the record will insert or not.
regards,
k.swaminath
10-30-2007 3:35 PM
hi swaminath,
Insert statement will fail if the record already exist with the same key elements.......
Example, In MARA table we cant have two entries fro same Material(MATNR) since MA?TNR is the Key field for MARA's records.
<b><REMOVED BY MODERATOR></b>
Harimanjesh AN
Message was edited by:
Alvaro Tejada Galindo
10-30-2007 3:37 PM
Hi,
You can't use INSERT command for primary key which is already available in the table.
If you use it will throw the sy-subrc value 4.
and your new record will not be saved in the table.
no damage for the exixting record
10-30-2007 3:37 PM
Hi,
If you try to insert a record that already existed in a databse table, the statement will fail and SY-SUBRC will be set to 4.
Regards,
Nicolas
10-30-2007 3:37 PM
If you simply say INSERT, it will dump trying to insert a duplicate record; howver, if you say INSERT...ACCEPTING DUPLICATE KEYS, you will get a return code of 4 and the record will be inserted. In this case, you will only see the last record inserted.
Rob