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 Class Builder or locally in a program. The names of global exception classes are prefixed with CX_ or, in the case of exception classes created in customer systems, YCX_ or ZCX_. There is a set of predefined global exception classes, such as those prefixed with CX_SY_, whose exceptions are raised in exception situations in the runtime environment.

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, Class Builder generates a non-modifiable instance constructor that has optional input parameters for all non-private attributes and that sets these attributes to the value of the input parameters. The ID of the required exception text can be passed to TEXTID. In the case of local exception classes, there are no special rules for the instance constructor.

Notes