Posts

Showing posts from March, 2024

OOPS ABAP: Exception class with 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. Example: Steps: Create message class Goto se24 and enter class name.(Eg: ZCX_STU). Select radio button ' Exception class' and check the check box 'with messages of message classes as exception texts'. Press enter.    Enter LV_ID in attributes tab. Click on 'message text' button.  Enter Message class name,message number and attribute 'LV_ID' and click on 'change'.   Check and activate.     Using the above class in program.   *&---------------------------------------------------------------------* *& Report ZVB_STU_EXC_CLS *&----------------------...