Posts

OOPS ABAP: Exception class without Message class

Image
Exception Class: Exception is a problem that arises during the execution of the program.   The purpose of exception class is to raise and handle the exceptions.   We use TRY block to raise the exception and CATCH block to handle the exception.   The exception class name must start with CX.   CX_ROOT is the global class(Parent class) for all the exceptions. There are 3 sub classes for parent class CX_ROOT. 1.CX_STATIC_CHECK - It is checked by both the compiler and runtime systems. 2.CX_DYNAMIC_CHECK - It is checked only at run time. 3.CX_NO_CHECK - It is not checked either by compiler or run time systems. Note: While creating the exception class,system by default provide CX_STATIC_CHECK as the super class. Example: Steps: Go to se24 and enter class name.(Eg: ZCX_STU). Select radio button ' Exception class' and Uncheck the check box 'with messages of message classes as exception texts'. Press enter.     Click on 'Attributes' tab and enter variable lv_id. ...