2009 May 14 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
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
2009 May 14 6:19 PM
Try doing this via Message statement under the exception.........I am not sure whether u can raise exception like this.
2009 May 14 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
2009 Jun 25 1:13 AM
Hello,
Thank you for your help. I will try this out.
Regards,
Peter