‎2007 Jul 02 6:40 AM
Hi all
I need to handle exceptions regarding database operations such as modify, insert update, datatype mismatch etc.
Does a standard exception class exist for it?
if there is no such class, how do i define one of my own?
PS: Points will be rewarded for correct solution.
Thanks & Regards
Ravish
‎2007 Jul 31 4:03 PM
Hi Ravish,
try exception class CX_SY_OPEN_SQL_DB.
If it does not fit your needs or you need additional functionality create your own class ZCX_SY_OPEN_SQL_DB in SE24 and tick Exception class (I recommend to set the 'with message class'-flag).
If you need additional functionality to CX_SY_OPEN_SQL_DB you make your class inherit from this class.
Hope this helps,
cheers,
Axel
‎2007 Jul 02 6:42 AM
Check the SY-SUBRC for each statement used for Modify or insert or update or.....
modify <datatable> from table itab.
If Sy-subrc = 0.
write ' Modify Done'.
else.
write ' Modify failed'.
endif.Regards
Gopi
‎2007 Jul 02 6:47 AM
Hi Ravish,
The best and easiest way in ABAP to handle the exception is checking the value of sy-subrc after each DB operation.
Regards,
Atish
‎2007 Jul 31 4:03 PM
Hi Ravish,
try exception class CX_SY_OPEN_SQL_DB.
If it does not fit your needs or you need additional functionality create your own class ZCX_SY_OPEN_SQL_DB in SE24 and tick Exception class (I recommend to set the 'with message class'-flag).
If you need additional functionality to CX_SY_OPEN_SQL_DB you make your class inherit from this class.
Hope this helps,
cheers,
Axel