Sunday, September 4, 2011

BC427 : Enhancement Framework , Unit 3(Cont) : Enhancements in SAP Classes

What Can We implicitly enhance in SAP Classes ?



How to Enhance SAP Classes ?


Enhancing interfaces for global SAP methods and defining additional attributes/methods for global SAP classes :
1.Display the class in class builder SE24
2.choose menu options Class-->Enhance and specify an enhancement implementation to add new attributes , methods and interface parameters to existing methods.
3. in GUI status , choose 'Activate Enhancements'.
 


Defining a pre/post/overwrite method for the method of a global SAP class :
1.Display the class in the class builder SE24
2.Choose the menu class-->enhance to specify/create an enhancement implementation
3.Use the cursor to mark the required SAP method
4.Choose the menu ooptions Edit-->Enhancement Operations then choose one of the menu entries : Inset Pre-Method,Insert Post-Method or Add overwrite method.
5.Choose the new button in the coloumn "Pre/Post/Overwrite-Exit" to implement the corresponding method.
6.Save the method.
7.in GUI status , choose 'Activate Enhancements'
 

These methods are automatically called before,after or instead of the SAP method.They are instance methods of an automatically generated ,local class and are avaliable via an instance attribute named CORE_OBJECT. This attribute is a reference to the corresponding current instance in the application program that this SAP is being used.


Enhance source code in methods of global SAP classes :

1.Display the source code of the method.
2.in GUI status , choose the enhancement button
3.Choose the menu options Edit-->Enhancement Operations-->Show implicit enhancement options to show the implicit enhancement options.
4.in the editor, use the context menu of one of the implicit enhancement points displayed to create an enhancement implementation.
5.insert the source code.
6.in GUI status , choose 'Activate Enhancements'.

3 comments: