Let’s see more on Explicit Enhancement POINT implementation in ABAP Enhancement Framework with step-by-step guide of creating an implementation.
If you have read the basics yet, I would suggest to read the previous article in the series – Enhancement Framework – Introduction
Points are predefined hooks available in Std SAP code which you can implement. At runtime, Based on the Switch status of the Implementation, the implementations would be called.
- INCLUDE BOUND - If point is INCLUDE BOUND, the implementation would be created with respect to the include, instead of the main program. INCLUDE BOUND implementations would be called in each program where include is referenced.
- STATIC – If point is STATIC, the implementation would be called if switch is not assigned. If switch is assigned, implementation would be called based on the status. If point is not STATIC, the implementation has to be part of the switch and it has to be active.
Find an Enhancement-POINT
To find any enhancement, you need to follow almost similar process like you have used to find any other enhancement – You debug. If you know the program, you can go through it and look for a specific point which you want to implement. But, I believe Debugging would give you better options.
Let take some scenario – You want to update certain attributes for Line Item while posting the material document. So, you debug the process. And found out that there is this Enhancement point which you can implement.
Implement the Enhancement-Point
1. Get to Enhancement Mod
Press the Spiral button on the toolbar to bring up the Enhancement mode. Once you are in Enhancement, the Editor would be open for change with kind of maze on left.
2. Create an Enhancement
Put Cursor on the Enhancement Name and choose option Edit > Enhancement Operations > Create Implementation
The same option is also available in context menu (right click)
If all options in Enhancement Operations in Main Menu and in context Menu are not selectable, you must not be in the Enhancement Mode.
3. Choose or use Implementation
System would bring you a popup to choose existing Enhancement implementation. If you implementing a new functionality, I suggest you create the new Implementation by pressing the Create Icon. Many times, developers get confused as system brings the std implementation names as well. They select them to implement their functionality and system would ask for the Access key. So, they get frustrated and confused. Enter the details of the Enh Imp name and description. In subsequent popup enter the Package and TR if you don’t select Local objects.
Once Enh Imp is created, you are back to the popup to select the Enh Imp. Scroll down to find your Enh Imp which you just created. Select and continue. If you are later version of ECC 6, your selected Enh Imp would be automatically selected.
4. Implement the logic
Now Implement the logic in your Enhancement Implementation. Once completed, press Activate Enhancements to activate the implementation.
Once you have created the implementation and you wish to change – get into the Enhancement mode. Use the Edit or Context menu to select the option Enhancement Operation > Change Implementation. Activate the Implementation.
If the you wish to remove the implementation, you need to follow two step approach.
- Undo the implementation first. Choose Context Menu > Enhancement Implementation > Undo Implementation.
- Activate the Implementation. If you don’t activate, the object will not be detached from the program.
- Go to SE80. Choose Other objects > Enhancements. Choose option Enhancement Implementation and enter the name. Choose Delete to remove it completely from system.
There could be multiple Implementations of the same enhancement point. Like one shown in this example. If the implementation is attached to the Switch and if the switch is active, the system would execute those implementations. Implementations without any switch are also active at the same time.
If you are in the change mode of one of the implementation, Enhancement Framework will not allow you to create another one right there. You need to go out of the change mode. I generally, go out of the program and start the process again.
Table of Content – Enhancement Framework
- Enhancement Framework – Introduction
- Enhancement Framework – Explicit Enhancement-POINT Implementation
- Enhancement Framework – Debugging Implementation
- Enhancement Framework – Explicit Enhancement-SECTION Implementation
- Enhancement Framework – Implicit Enhancement Options
- Enhancement Framework – Class Enhancement
- Enhancement Framework – Class Enhancement – How designed
- Enhancement Framework – Function Module Enhancement
- Enhancement Framework – Table Enhancement Category
- Enhancement Framework – Table Enhancement – Append Structure
- Enhancement Framework – Append Search Help
- Enhancement Framework – Extension Index
- Enhancement Framework – Fixed Value Append