How to Choose the Right Enhancement Technique
Learn how to decide between user exit, customer exit, BAdI, explicit enhancement and implicit enhancement.
Explanation
Choosing the right enhancement technique is more important than simply knowing how to create one. In SAP projects, the best enhancement is the one that is standard-supported, stable, easy to debug and safe during upgrades. First check whether SAP provides a BAdI or customer/user exit for the requirement. If a released BAdI exists, it is usually better than an implicit enhancement. Explicit enhancement points are also preferable when SAP has intentionally provided them. Implicit enhancements should be used carefully because they are inserted into standard source code positions and can be riskier during upgrades. In S/4HANA and clean-core projects, released extensibility options, APIs and BAdIs should be preferred over direct source-code changes.
Code example
* Decision flow for enhancement selection* Step 1: Understand the exact business process and transaction* Example: Sales order save, delivery creation, billing output, IDoc processing * Step 2: Check for standard exits or BAdIs first* User exit or BAdI is usually safer than implicit source-code enhancement * Step 3: Use implicit enhancement only when no suitable released option exists* Keep the implicit enhancement small, well-documented and controlled by config * Step 4: Add activation control so support team can disable logic if neededIF zcl_enh_switch=>is_active( iv_key = 'SD_ORDER_SAVE_CHECK' ) = abap_true. * Execute custom validation only when switch is activeENDIF.Real project scenario
A business wants to add a validation before sales order save. Instead of immediately adding an implicit enhancement in SAPMV45A, the developer should first check MV45AFZZ user exits, relevant SD BAdIs and available enhancement spots.
Common mistakes
- Using implicit enhancement as the first option. - Not checking standard exits or BAdIs. - Not understanding upgrade risk. - Not documenting why the enhancement was chosen.
Best practices
- Debug standard process before choosing enhancement. - Prefer released enhancement options. - Keep custom logic small. - Use switch/config control. - Document decision and business reason.
Interview angle
A strong answer should explain priority: standard BAdI/user exit first, explicit enhancement next, implicit enhancement only when justified.