Get Example source ABAP code based on a different SAP table
Standard SAP Help for RAISE
Short Reference >
• RAISE ABAP Statement
ABAP_BASIC_FORM_1 RAISE exception.>
What does it do?This statement raises the non class-based exception> exception>. RAISE> can be specified in a method only if the non-class-based exception is defined in the interface of the method. Specify RAISE> in function modules only if the non-class-based exception is defined in the interface of the function module. It is possible to specify RAISE> in all other positions, but we advise against it.
After the exception exception> is raised, the system proceeds as follows: If the exception is raised in a method or function module whose caller assigns a return value to the exception, then the procedure> ends immediately, the system returns to the calling position, and the system field sy-subrc> is set according to the assignment. If the exception is raised in a method or function module whose caller does not assign a return value to the exception, a runtime error is then triggered whose short dump> contains the name of the exception. If the exception is raised in a subroutine, the system searches for the first function module in the procedures of the preceding call stack. If it finds a function module of this type and the exception is defined in it, the system acts as though the exception was raised in this function module. Otherwise, a runtime error occurs. In all other processing blocks, raising a non class-based exception produces a runtime error that immediately ends the program.
This form of the statement RAISE> cannot be used in the sameprocessing block> as the statement RAISE EXCEPTION>> or the addition THROW>> in a conditional expression> to raise class-based exceptions.
Latest notes:The statement MESSAGE> with the addition RAISING>> also raises a non class-based exception. In cases in which non-class-based exceptions are still used, this statement is preferred instead of RAISE>, because it offers the option of adding a text to the exception. If a procedure> is exited by raising an exception, the content of the formal parameter for which the pass by value> is defined is not assigned to the respective actual parameters.
Runtime Exceptions Non-catchable Exceptions
Reason for error:
The raised exception was not handled by the caller.