|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Enhancement to a Standard Class
By Pranshu Kukreti
we come across a requirement which cannot be solved using available standard
methods. In such cases we can either enhance the existing method or go for our
custom development. This document explains how to add a custom method to a
standard global class and how to enhance an existing method using exits.
Below are three different exits available to enhance a standard method:
Implement this exit if we want to execute our custom logic before standard
method gets executed.
Post-Method Exit: Implement
this exit if we want to execute our custom logic after the standard method gets
If we want to completely replace the standard logic then this exit should be
to transaction SE24 and open up a standard class (CL_SALV_TABLE) in our case.
select the option class->Enhance to create an enhancement implementation.
pop up screen will appear where we need to pass enhancement implementation name
the implementation gets created successfully a message will appear at the bottom
of the screen and standard interface screen opens up in change mode.
add a public method as shown below and implement the logic inside this method.
are going to display an information message inside this method.
our next task is to add/modify the logic of existing standard method. For this
put your cursor on the method name (DISPLAY in our case) and select the option
Edit->Enhancement Operations->Insert Pre-Method / Insert Post-Method/Add
Overwrite Method. Pre-Method gets called before the standard method and
Post-Method gets called after the standard method. But if we want to completely
replace the standard method logic with our won logic we can go for Over write
method which gets called (if implementation is active) in place of standard
are going to implement the pre method first. So once we select the ‘Insert
Pre-Method’ option, source code button
appearing on the Pre-Exit column. Press this button to implement the pre-method
pre-method of display add logic to display an information message.
steps 7 & 8 to implement Post-Exit method of display.
the post-exit method to display an information message.
It should be noted
that, if at this point we try to implement the over write exit, it will give a
compilation error. This happens because we cannot have over write exit along
with Pre/Post exit.
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