Enhancements Part 5: Implementing Explicit Enhancement Points and Sections
Lessons are open to try during our launch period. Some advanced content may move to Pro later. AI practice limits apply separately.
Implement an explicit enhancement point step by step: switch to Enhance mode, create an enhancement implementation, write the plug-in, activate and transport; plus STATIC points for declarations, enhancement sections, and handling several implementations.
In this lessonShow sectionsHide sections
Visual overview
Expert visual walkthrough
Implementing Explicit Enhancement Points and Sections
Enhancements · Chapter-specific technical teaching map
Integration path
Enhancement point
Code implementation
Activate
Test
Tutor's chapter takeaway
Implement an explicit enhancement point step by step: switch to Enhance mode, create an enhancement implementation, write the plug-in, activate and transport; plus STATIC points for declarations, enhancement sections, and handling several implementations.
In a real project
Two projects in the same system implemented the same explicit point in the pricing include: one set a condition flag, the other read it. In production, the order of execution changed after a transport and the second plug-in…
Watch out for
• Creating the implementation in $TMP (not transported). • Relying on execution order of several implementations. • Putting declarations in dynamic points and expecting them elsewhere. • Replacing a section without copying…
The situation: a real project scenario
Two projects in the same system implemented the same explicit point in the pricing include: one set a condition flag, the other read it. In production, the order of execution changed after a transport and the second plug-in read an unset flag.
The teams merged the logic into one implementation calling one class, where the sequence was explicit. They added a rule: one implementation per point per system area, reviewed by the enhancement owner.
Explanation
Part 3 compared the different enhancement option types; now it's time to implement an explicit enhancement point. To implement one, open the SAP program containing it, click Enhance (the spiral icon), place your cursor on the ENHANCEMENT-POINT statement, and choose Edit → Enhancement Operations → Create Implementation.
The code you write between ENHANCEMENT n <name>. and ENDENHANCEMENT. belongs entirely to your implementation and is stored in your own package. STATIC points, declared as ENHANCEMENT-POINT ... STATIC, are reserved for declarations like DATA and TYPES, while ordinary, dynamic points are for executable code.
One thing worth remembering: when several implementations exist for the same point, all of them run, but in an undefined order — so never write code that depends on what some other plug-in already did.
Before creating anything, make sure you know the program, the include, and the exact point name, as covered in Part 4. Check for existing implementations too — the point shows them when you open the include in Enhance mode, and SE20 also lists them. Optionally, create or choose a composite enhancement implementation to keep your project's enhancements organized together.
To actually create the implementation: in SE38 or SE80, display the include that contains the point; click Enhance, or press Shift+F4, which switches the editor into enhancement mode; put your cursor on the ENHANCEMENT-POINT statement and choose Edit → Enhancement Operations → Create Implementation; enter an implementation name starting with Z, a short text, a package, and a transport request; then write your code between ENHANCEMENT and ENDENHANCEMENT and activate it with Ctrl+F3.
On static versus dynamic points: ENHANCEMENT-POINT ... STATIC sits in a declaration part of the program, and is meant for DATA or TYPES that other plug-ins might also need to use. Ordinary dynamic points hold executable statements instead. You can declare variables inside a dynamic plug-in too, but they stay local to whatever context that code block runs in, such as the enclosing FORM.
Enhancement sections work through the same basic steps, except your implementation entirely replaces the section's original SAP code. It's worth copying SAP's existing logic into your implementation first and changing only what you actually need to, since once you do this, future SAP corrections to that section won't be applied automatically anymore.
Changing or removing an implementation later follows a similar path: in Enhance mode, choose Change Implementation to edit it, or use Enhancement Operations → Remove Implementation, or delete or deactivate it through SE20, depending on your release. The implementation itself is a transportable object (ENHO) that travels in your transport request.
A few rules for what to put inside plug-in code: keep it short, generally just calling a class method that does the actual work with the data you pass it; never issue COMMIT WORK or show a dialog inside code that might run in the background; and guard the logic with conditions — sales organization, document type — so it only actually runs where it's meant to.
To practice: find an ENHANCEMENT-POINT in an include in a sandbox copy or a training program; create an implementation named ZEI_TRAINING_<initials>, adding a condition and a call to a static method on a Z class; activate it, test it, and locate it afterward in SE20. With this you should be able to create, activate, change, and transport an explicit enhancement implementation.
Code example
* ===== SAP include (display only) =====* DATA: ls_item TYPE vbap.* ENHANCEMENT-POINT ep_decl SPOTS es_zdemo STATIC. " declarations* ...* ENHANCEMENT-POINT ep_item_check SPOTS es_zdemo. " executable * ===== Implementation part 1: STATIC point - declarations =====ENHANCEMENT 1 zei_order_rules. "active version DATA: gv_zz_blocked TYPE abap_bool, " available to later plug-ins in this program gx_zz_rule TYPE REF TO zcx_order_rule.ENDENHANCEMENT. * ===== Implementation part 2: dynamic point - keep it thin =====ENHANCEMENT 2 zei_order_rules. "active version IF ls_item-pstyv = 'ZTAN'. " run only where needed TRY. zcl_order_item_rules=>check_item( ls_item ). CATCH zcx_order_rule INTO gx_zz_rule. gv_zz_blocked = abap_true. MESSAGE gx_zz_rule TYPE 'W'. ENDTRY. ENDIF.ENDENHANCEMENT. * ===== The reusable logic lives in a class =====* CLASS zcl_order_item_rules DEFINITION PUBLIC FINAL CREATE PUBLIC.* PUBLIC SECTION.* CLASS-METHODS check_item IMPORTING is_item TYPE vbap* RAISING zcx_order_rule.* ENDCLASS. * ===== 💡 Modern syntax (7.40+) =====* CATCH zcx_order_rule INTO DATA(lx_rule). " inline declaration, no STATIC DATA neededWatch out
Common mistakes
- Creating the implementation in $TMP (not transported).
- Relying on execution order of several implementations.
- Putting declarations in dynamic points and expecting them elsewhere.
- Replacing a section without copying SAP's logic.
- Large business logic directly in the plug-in.
Do this
Best practices
- Check existing implementations before creating one.
- Group project implementations in a composite implementation.
- Keep plug-ins thin and conditional.
- Use STATIC points for declarations.
- Document the point, purpose and owner.
In the interview
Interview angle
Questions: "How do you implement an enhancement point?", "What is a STATIC enhancement point?", "What if several implementations exist?"
Strong answer: Enhance mode in the editor, Enhancement Operations → Create Implementation, name/package/transport, code between ENHANCEMENT/ENDENHANCEMENT, activate; STATIC points for declarations; all implementations run in no guaranteed order; sections replace code; keep code thin and call classes.
Practice this lesson
Quick check
0 of 3 questions attempted
Question 1 of 3
Where should DATA declarations used by several plug-ins of one program be implemented?
Question 2 of 3
What happens when you implement an ENHANCEMENT-SECTION?
Question 3 of 3
Which source code enhancement option allows a customer to insert code specifically before or after existing statements without altering the surrounding standard code, as opposed to replacing it entirely?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1A pricing program provides an explicit enhancement point after the standard calculation. How would you implement your adjustment there, and what do you watch out for?
2Explain the execution sequence when multiple customer exits and user exits are active for the same function. Can this create problems? Provide a real scenario.
Try a related Code Lab
This published exercise covers the same SAP topic. Apply the ideas in a hands-on scenario, then return to review your answers.
Open: Add a delivery block via BAdI instead of modification →See it in code
Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.
- User exit in sales orders: stop the save when an item quantity is too high (MV45AFZZ)
- BAdI from both sides: define your own BAdI (SE18), call it with GET BADI, and implement it
- ABAP BAdI: define one, call it from your code and implement it
- ABAP first steps: variables, IF, CASE and loops in a runnable class
Was this lesson helpful?
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.