You use this procedure to create global exception classes in the Class Builder. For more information about exception classes, see the ABAP Keyword Documentation under Exception Classes .
You can create a new exception class when you need it for the first time, for example when assigning exceptions in the method definition. See also Creating Exceptions for Methods .
The Create Class dialog box appears.
Option | Description |
---|---|
Superclass |
Enter the name of the direct superclass. Note
Exception classes are derived from one of the predefined basic classes CX_STATIC_CHECK, CX_DYNAMIC_CHECK or CX_NO_CHECK. Depending on the position of the exception class within the class hierarchy, enter the appropriate class within this hierarchy or one of the predefined basic classes as a superclass. In the latter case, expand a new hierarchy tree. |
Instantiation |
|
Class Type |
If you assign the prefix CX_ to the name of the exception class, the class type Exception class is automatically selected. At this point, you can decide whether the texts for your newly created exception class should be recreated and stored in the OTR, or whether you want use existing message classes for this exception class. These options differ in terms of the flexibility of the parameterization and the cases where they are used:
|
Final |
Specifies the development status of the object. Only objects and components with status final can have executable code. This class completes the inheritance hierarchy since a final class may not create any further subclasses. |
You have created a new exception class. A class pool is generated for the new class if the Only modeled option was not activated. In contrast to normal classes, you cannot create a method for an exception class. The Class Builder simply creates the constructor but you can create attributes and maintain exception texts.
See also: