Skip to Content
0
Former Member
May 14, 2009 at 05:12 PM

How to raise custom exceptions?

294 Views

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