|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Exception Classes in Object Oriented Programming
By Prasanna, Infosys
Exceptions are the errors that occurs during the execution
of the program that interrupts the normal flow of control.
Types of Exceptions:
All exception classes are inherited from global class
CX_ROOT and the classes that are directly inherited are
It is checked by both the
compiler and runtime system. If any exception of this category found and not
handled locally inside the procedure, it has been declared in the RAISING clause
of the procedure’s interface
It is checked only at runtime
system. when the excetions tries to leave a procedure that it has been declared
in RAISING class. Generally all system exceptions like CX_SY_ZERO_DIVIDE will
come under these exceptions
This type of exceptions will
be choosenif the exeception can occur almost everywhere. These exceptions are
always implicitly declared.
Neither the compiler nor the
runtime system performs any interface checks.
Step-by-Step Approach for creation of Exception Classes
Go to Transaction SE24, enter class name as
For all exception classes “CX”
will be the prefix.
Choose “Create“ button.
Popup will be displayed in the next
screen. Enter the super class name “CX_STATIC_CHECK”.
Exception classes are derived from one
of pre-defined basic classes CX_STATIC_CHECK, CX_DYNAMIC_CHECK or CX_NO_CHECK.
So enter one of the basic classes as super classes.
Instead of creating new texts, you
want can use the texts from an existing message class (which are defined in
TCODE SE91). Then select the “With Message Class” checkbox.
Choose Save Button.
The initial screen of exception class will be display with
some predefined attributes/Methods.
Exception classes inherit the following attributes from
base class “CX_ROOT“
Using Tcode SE91 a message class““ is created with
message 000 as shown below. Used this message class in Exception Class
In Exception Class “ZCX_EXCEP_CLS”,
create attributes MSGV1, MSGV2, MSGV3, and MSGV4 under attributes tab of the
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards