‎2006 Aug 03 5:51 AM
Hi,
I was inserting record in custom table, values of primary key in
work area where already present in table.
so i got short dump for entring duplicate values.
Is their any way to avoid short dump in this case so that program
should not be terminated.
Rgds,
Fattesingh
‎2006 Aug 03 5:53 AM
Hi fattesingh,
1. MODIFY
2. Use MODIFY statement (instead of INSERT,UPDATE etc)
3. MODIFY
will AUTOMATICALLY
take care of insert/update
based upon the
primary key combination
FOUND / NOT FOUND
in the database table,
based upon the work area fields.
regards,
amit m.
‎2006 Aug 03 5:53 AM
Hi fattesingh,
1. MODIFY
2. Use MODIFY statement (instead of INSERT,UPDATE etc)
3. MODIFY
will AUTOMATICALLY
take care of insert/update
based upon the
primary key combination
FOUND / NOT FOUND
in the database table,
based upon the work area fields.
regards,
amit m.
‎2006 Aug 03 5:54 AM
Hi Fattesigh,
Please use <b>MODIFY</b> statement instead of INSERT.
It will modify the record with new values if the record already exits otherwise it will insert new record.
Hope this will help.
Regards,
Ferry Lianto
‎2006 Aug 03 5:55 AM
‎2006 Aug 03 5:59 AM
Hi,
Use MODIFY Statement which acts like 2 Open Sql queries (Insert and Update), if the records already exists it updates else it inserts the new record) and Regarding your case to avoid short dumps, use user-defined messages.
For Ex:
Insert zemployee.
if sy-subrc <> 0.
MESSAGE 'RECORD ALREADY EXISTS' TYPE 'S'.
ELSE.
MESSAGE 'RECORD SUCCESSFULLY CREATED' TYPE 'S'.
ENDIF.
‎2006 Aug 03 6:17 AM
Hi,
Use MODIFY statment instead of INSERT.
MODIFY stmt will insert the record in table only if it is not present in table else it will just update the record with new values in that workarea.
Rgds,
Prakash
‎2006 Aug 03 6:24 AM
hi,
I want to know how to do exception handling to avoid short dump.
coz i had checked sy-subrc after the insert
but still short dump was gifted to me.
I know modify command.
Rgds,
Fattesingh
‎2006 Aug 03 6:45 AM
Hi,
use 'ACCEPTING DUPLICATE KEYS' with insert statement.
whenever any duplicate primary key record comes , system will modify existing records.
Ex: INSERT ztable FROM TABLE i_tab ACCEPTING DUPLICATE KEYS.
Regards
Appana