For defining exceptions we have two options :
1. Classical exceptions
2. Class-based exceptions
Classical exceptions : These can only be declared in interfaces of methods or function modules using EXCEPTIONS and can be raised within that method/FM using the statements RAISE <exception> or MESSAGE.......RAISING <exception>.
1. Classical exceptions
2. Class-based exceptions
Classical exceptions : These can only be declared in interfaces of methods or function modules using EXCEPTIONS and can be raised within that method/FM using the statements RAISE <exception> or MESSAGE.......RAISING <exception>.
Class-based exception : These exceptions are defined using exception classes in se24 and it may generate an exception object(when CATCH...INTO... is used) when an exception is raised using the statement RAISE EXCEPTION TYPE <exception> .
As the exception class is declared globally, this can be accessed and used in any program .
As the exception class is declared globally, this can be accessed and used in any program .
NOTE :
Class-based exceptions are not supported in remote-enabled function modules (RFM). So, in the case of remote function calls (RFCs) classical exceptions needs to be implemented and handled .