ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Exception Handling →  Class-Based Exceptions →  Exception Classes → 

Creating Exception Classes

Exception classes can be defined globally in the Class Builder or locally in a program. The names of global exception classes are prefixed with CX_, YCX_, ZCX_, and so on in the case of exception classes that are created in the customer system. There is a set of predefined global exception classes such as those with the prefix CX_SY_ whose exceptions must be triggered in the runtime environment in an exception situation.

All exception classes inherit the following instance methods from CX_ROOT:

All exception classes inherit the following instance attributes from CX_ROOT:

For global exception classes, the Class Builder generates a non-changeable instance constructor that has optional input parameters for all non-private attributes and that sets these attributes to the value of the input parameters. In particular, a TEXTID can pass the ID of the required exception class. In the case of local exception classes, there are no special rules for the instance constructor.

Notes