Enhancements
ABAP Developmentintermediate

Enhancements Part 5: Implementing Explicit Enhancement Points and Sections

Key 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.

Explanation

📌 KEY POINTS
✅ To implement: open the SAP program, click Enhance (spiral), place the cursor on the ENHANCEMENT-POINT, Edit → Enhancement Operations → Create Implementation.

✅ Code between ENHANCEMENT n <name>. … ENDENHANCEMENT. belongs to your implementation, stored in your package.

✅ STATIC points (ENHANCEMENT-POINT … STATIC) are for declarations (DATA, TYPES); dynamic points for executable code.

⚠️ Several implementations of the same point all run — in an undefined order. Don't depend on another plug-in's result.

━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE

Part 3 compared the option types. Now we implement an explicit point.

━━━━━━━━━━━━━━━━━━━━
▶ 1. PREPARATION

  • Know the program, include and point name (Part 4).
  • Check existing implementations (the point shows them when you open it in Enhance mode; SE20 lists them).
  • Create or choose a composite enhancement implementation for your project (optional but tidy).

━━━━━━━━━━━━━━━━━━━━
▶ 2. CREATE THE IMPLEMENTATION

  1. SE38/SE80: display the include containing the point.
  2. Click Enhance (Shift+F4) — the editor switches to enhancement mode.
  3. Cursor on ENHANCEMENT-POINT → Edit → Enhancement Operations → Create Implementation.
  4. Enter an implementation name (Z…), short text, package and transport.
  5. Write your code between ENHANCEMENT and ENDENHANCEMENT, activate (Ctrl+F3).

━━━━━━━━━━━━━━━━━━━━
▶ 3. STATIC VS DYNAMIC POINTS

  • ENHANCEMENT-POINT … STATIC — in declaration parts; use for DATA/TYPES your other plug-ins need.
  • Normal (dynamic) points — executable statements.

Declaring variables inside a dynamic plug-in is allowed but they are local to that code block's context (e.g. the FORM).

━━━━━━━━━━━━━━━━━━━━
▶ 4. ENHANCEMENT SECTIONS

Same steps; your implementation replaces the section's SAP code. Copy SAP's logic into your implementation first and change only what is required — and note that future SAP corrections of the section won't apply automatically.

━━━━━━━━━━━━━━━━━━━━
▶ 5. CHANGING AND DELETING

  • Change: Enhance mode → Change Implementation.
  • Remove: Enhancement Operations → Remove Implementation, or delete/deactivate via SE20 (depending on release).
  • Transport: the implementation object (ENHO) is in your transport request.

━━━━━━━━━━━━━━━━━━━━
▶ 6. RULES FOR PLUG-IN CODE

  • Keep it short; call a class method with the needed data.
  • No COMMIT WORK, no dialog in code that may run in background.
  • Guard with conditions (sales org, document type) so it runs only where needed.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

  1. Find an ENHANCEMENT-POINT in an include of a sandbox copy or training program.
  2. Create implementation ZEI_TRAINING_<initials>, add a condition and a call to a static method of a Z class.
  3. Activate, test, and locate the implementation in SE20.

✅ CHECKPOINT: you can create, activate, change and transport an explicit enhancement implementation.

Code example

ABAP Code
* ===== 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 needed

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.

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.

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.

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

1. Where should DATA declarations used by several plug-ins of one program be implemented?

2. What happens when you implement an ENHANCEMENT-SECTION?

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?

Interview questions

1. A 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?

Answer it in your own words first, then compare.

2. Explain the execution sequence when multiple customer exits and user exits are active for the same function. Can this create problems? Provide a real scenario.

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics