02-15-2015 5:19 PM
Hello, experts!
Is there any way for catching exception from "insert <tabname> from table itab" during debugging, if there's no any exception handling in code? I want to know what is the error text to analyze it in more detail. I can't modify a program, because it has been generated automatically (it is a data loading program for BW extractor), so I need any case to insert error handling or get the error message while debug before program exit.
Any suggestions would be appreciated.
Thanks,
Andrew.
02-15-2015 6:54 PM
hi andrew,
There is a catchable exception which you can try
TRY.
insert <tabname> from table itab
CATCH CX_SY_ITAB_DUPLICATE_KEY.
ENDTRY.
There are also non-catchable exceptions which you can refer at
02-15-2015 8:27 PM
Hi, Abdul.
Thanks for your reply, but I cannot modify the code, it was generated "on the fly", as I can see, and provided by SAP's functionality.
02-15-2015 8:13 PM
I didn't mention that insert updates a database table, not internal table, and also it has addition: INSERT <DB table> FROM TABLE itab ACCEPTING DUPLICATE KEYS.
02-15-2015 9:10 PM
hi andrew,
in case if any rows are not inserted then sy-subrc has value 4.
also if sy-dbcnt has less number of records than total then you can come to know that some records are missed.
but I think with this command it is not possible to rollback in case of any error