Ansicht
Dokumentation

ABENEXCEPTIONS_NON_CLASS - EXCEPTIONS NON CLASS

ABENEXCEPTIONS_NON_CLASS - EXCEPTIONS NON CLASS

General Material Data   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

Non-Class-Based Exceptions

Non-class-based exceptions are the predecessors of class-based exceptions and should not be defined any more in new developments.

Using Class-Based Exceptions

Definition

Non-class-based exceptions can be defined in the interfaces of function modules and methods. These definitions take place as follows:

  • In methods of global classes or function modules, by assigning a name for the exception in Class Builder or Function Builder, whereby the checkbox for exception classes is not selected.

The statement RAISE EXCEPTION or the addition THROW in a conditional expression cannot be used to raise class-based exceptions in a method or a function module in whose interface non-class-based exceptions are defined.

Note

Before class-based exceptions were introduced, all exceptions defined in the interface of methods of classes or interfaces or of function modules were non-class-based.

Raising

Non-class-based exceptions are raised by the following statements:

Handling

The handling of non-class-based exceptions is made possible by the addition EXCEPTIONS in method calls and function module calls by assigning numeric values to the exceptions, which are used to fill the system field sy-subrc when the exception is raised. The actual error handling takes place after the call, when sy-subrc is evaluated.

Notes

  • The exceptions that can be defined in the interfaces of methods and function modules are not real exceptions, since they do not change the control flow, but simply end the processing of the procedure prematurely and set the return code sy-subrc instead.
  • RFC currently allows only classic exception handling. Class-based exception handling is only possible in a different release track.
  • A predefined exception error_message can be used when calling function modules to handle messages of types E and A sent during the processing of the function module as non-class-based exceptions.





BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 3889 Date: 20240425 Time: 100049     sap01-206 ( 53 ms )