|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Exception Classes in Object Oriented Programming
To Insert Exception Texts from Message
Classes Choose “Texts” tab in the class builder.
Then Place the cursor on the default
Exception ID “ZCX_EXCEP_CLS” and then click on the
Popup will be displayed. Enter
Message Class “ZEXC_MSG” and Message Number “000”.
If you want parameterized Exception
Texts, assign the attributes of an Exception Class to the placeholders that
exist in attributes tab of exception class.
Placeholders (‘&’) created
here can be dynamically be populated when runtime exceptions are created using
ABAP values via exception class attributes.
Here I assigned MSGV1, MSGV2, MSGV3
and MSGV4 to the placeholders.
The values of the attributes belonging
to exception will be linked to a text from message class.
‘&’ will be replaced with
corresponding values of attributes (i.e. MSGV1, MSGV2, MSGV3 and MSGV4) defined
in parameterized exceptions in STEP 7.
Save and active the Exception class
Exception texts are generally language-specific and have to be
Exception Class inside the program to handle exceptions
DATA: ex_ref TYPE REF TO cx_root.
be replaced with the texts assigned to attributes (MSGV1, MSGV2, MSGV3 and
MSGV4) of exception class.
While creating Exception class,
uncheck the “With Message Class” check box, if you want to create new
The texts will be created and stored
in the text management OTR. It is not possible to use both text variants in an
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