ABAPIntermediate
BAdI
Master Business Add-Ins with classic BAdIs, new BAdIs, filters, multiple implementations, fallback classes, debugging and S/4HANA enhancement strategy.
Overview
Master Business Add-Ins with classic BAdIs, new BAdIs, filters, multiple implementations, fallback classes, debugging and S/4HANA enhancement strategy.
Lessons in this topic
- BAdI Part 1: What a BAdI Is and How SAP Calls ItUnderstand Business Add-Ins: the BAdI definition and its interface, implementations as classes, how SAP calls classic BAdIs (CL_EXITHANDLER) and new BAdIs (GET BADI / CALL BADI), and the transactions SE18 and SE19.
- BAdI Part 2: Finding and Implementing a BAdI Step by StepImplement a BAdI end to end: locate it (SPRO, SE18, debugger), create the implementation in SE19 for classic and new BAdIs, write the method using its parameters, raise messages the way the application expects, activate, test and transport.
- BAdI Part 3: Designing Your Own BAdI — Fallback Class and FiltersCreate your own new BAdI for Z programs: enhancement spot, BAdI definition, interface, filter (e.g. country or company code), fallback class for default behaviour, calling it with GET BADI / CALL BADI, and handling CX_BADI_NOT_IMPLEMENTED.
- BAdI Part 4: Classic BAdI vs New BAdICompare classic BAdIs (SE18 definition, CL_EXITHANDLER, interface IF_EX_…) with new kernel BAdIs (enhancement spots, GET BADI / CALL BADI, IF_BADI_INTERFACE): performance, filters, fallback classes, instance handling, migration and how to recognise each in SE18/SE19.
- BAdI Part 5: Single-Use vs Multiple-Use BAdIsUnderstand how the "multiple use" setting changes BAdI behaviour: several implementations running in sequence, no guaranteed order, CHANGING parameters in multiple-use BAdIs, single-use BAdIs that return values, conflicts between implementations and how to manage several teams in one BAdI.
- BAdI Part 6: Debugging BAdIs in Real ProjectsDebug BAdI problems systematically: is the BAdI called at all, which implementations are active and match the filter, is my method reached, what data arrives — using breakpoints in CL_EXITHANDLER, GET BADI / CALL BADI, the implementation class, and the debugger's enhancement tools.
- BAdI Part 7: Using Filter-Dependent BAdIsImplement filter-dependent BAdIs correctly: filter characteristics and values, comparison operators and value ranges in new BAdIs, FLT_VAL in classic BAdIs, overlapping filters, one implementation for several org units vs one per unit, and testing filter behaviour.
- BAdI Part 8: Implementation Design — Keep BAdI Logic CleanDesign BAdI implementations that stay maintainable: thin implementing classes delegating to service classes, clear responsibilities per method, message handling, no UI and no COMMIT, testability with ABAP Unit, and naming/documentation standards.
- BAdI Part 9: Performance and Database Access in BAdIsKeep BAdI implementations fast: how often methods are called (per item, per field change, per screen round trip), guard conditions, buffering with keyed tables per document, avoiding SELECT in loops and BAPI calls, instance creation modes, and measuring with ST05 and SAT.
- BAdI Part 10: BAdIs in S/4HANA and Clean CoreSee how BAdIs fit clean core: released BAdIs for developer extensibility, Custom Logic app for key user extensibility, BAdIs in RAP business objects, what happens to classic BAdI implementations after conversion, and ATC checks for cloud readiness.
Interview questions covered
- Difference between classic and new BAdI.
- BAdI slows down document save by 200 ms. What do you do?
- What is the difference between classic and new (Enhancement Framework) BAdIs?
- A BAdI implementation is active but not getting triggered. What would you check?
- What is a BAdI?
- BAdI CHANGING parameter is not reflected in caller. Why?
- My BAdI implementation is not triggered. Why?
- What is a BAdI in SAP ABAP?
- A purchasing process has two active BAdI implementations — one classic, one created later via the migrated enhancement spot. How do classic and new BAdIs coexist here, and what do you check?
- How do you design a BAdI implementation for maintainability?
- Why are released BAdIs important in S/4HANA clean-core strategy?
- What is a filter-dependent BAdI?
- Different company codes need different validations in a process where SAP offers a BAdI. How do you find and implement the right BAdI?
- A new sales organization went live, and suddenly a custom BAdI-based check was not applied to it. The BAdI is filter-dependent by sales organization. What happened, and how should the BAdI be designed?
- A sales order BAdI method contains validation, SQL, message formatting and email sending in one block. How would you redesign it?
- Different company codes require different tax validations in a filter-dependent BAdI. How would you set up the implementations?
- Purchase order save is blocked only for one plant and nobody knows why. How do you debug it?
- A sales validation previously implemented as an implicit enhancement in standard code must be moved during an S/4HANA project. What target would you choose?
- A purchase order validation (purchasing group mandatory for PO type ZNB) must be added in ME21N. How would you implement it with a BAdI?
- A delivery field was changed twice during save by two implementations of a multiple-use BAdI, with inconsistent results. How do you resolve it?