‎2007 May 21 8:25 PM
Hi,
While inserting records in database table, i am getting dump error due to the duplicate entries. How should i avoid the dump error and throw some warning messages
thanks in advance
Useful answers will be rewarded
‎2007 May 21 8:27 PM
check the data in database table before inserting,if data is exists in database and then show message..
if you use Modify statment and then you will not get short dump.
Message was edited by:
Seshu Maramreddy
‎2007 May 21 8:34 PM
if you use a modify statement, u wont get dump. as modify will modify the existing entry, if an entry exists, else, insert new entry..
if you are particular about insert, then, select from dbtab for the current value in internal tab. if it exists, then display message.
‎2007 May 21 8:43 PM
Thanks for the reply. The problem is not with the values in the existing database. The duplicate entries might be in the records which has to be inserted. Even if there is no value for key field in 2 records might result in duplicate entries. Actually i want to know is there any option like TRY ... CATCH to avoid this situation
‎2007 May 21 11:16 PM
Hi Jai,
After insert statement.
If sy-subrc NE 0.
continue.
endif.
Regards
SAB
‎2007 May 21 8:45 PM
Hello Jai
There are two options available:
(1) Sort the itab containing the new entries by the key fields and remove duplicates prior to the INSERT into the DB table
(2) Use the INSERT statement with the option ACCEPTING DUPLICATE KEYS
While these options <i>technically </i>solve the problem by avoiding dumps it is up to you to define whether these options are <i>semantically </i>correct.
Regards
Uwe