05-14-2009 6:12 PM
Folks,
In my ABAP code, I need to raise an exception:
IF sy-subrc = 1.
RAISE table_not_available.
ENDIF.
Here, instead of raising a generic exception such as table_not_available, I would like to raise a more meaningful exception where the table name is also displayed as part of the exception. Something like:
RAISE 'Table ' + tableName + ' not available.'
How can I create such custom exceptions?
Thank you in advance for your help.
Regards,
Peter
05-14-2009 6:19 PM
Try doing this via Message statement under the exception.........I am not sure whether u can raise exception like this.
05-14-2009 6:25 PM
Try:
REPORT ztest LINE-SIZE 132 MESSAGE-ID 00 LINE-COUNT 65.
DATA: tab_name(20) VALUE 'BKPF'.
sy-subrc = 1.
IF sy-subrc = 1.
MESSAGE e398 WITH 'Table ' tab_name 'not available' RAISING
table_not_available.
ENDIF.
Rob
06-25-2009 1:13 AM