ERPClimb logoERPClimb

SAP ABAP BAdI Interview Questions

In SAP ABAP rounds, badi questions are where configuration knowledge meets day-to-day behaviour — what a setting does, and what breaks in a live system when it is wrong.

Master Business Add-Ins with classic BAdIs, new BAdIs, filters, multiple implementations, fallback classes, debugging and S/4HANA enhancement strategy.

This page carries 19 reviewed SAP ABAP badi interview questions, each with a complete written answer and no sign-in required. The set breaks down into 2 foundational, 11 mid-level and 6 advanced questions, so you can start at the top for a first interview or skip ahead to the scenario-based items for a senior round.

Rehearse these out loud rather than reading them. If you can explain each answer in your own words, including one realistic way it goes wrong on a project, you are covering what a normal SAP ABAP round on badi expects.

19 BAdI questions with answers

easyBAdI

1. A purchase order validation (purchasing group mandatory for PO type ZNB) must be added in ME21N. How would you implement it with a BAdI?

I would use classic BAdI ME_PROCESS_PO_CUST, which SAP provides for Enjoy purchase order processing. In SE18 I check its methods and that it is multiple-use, in SE19 I review existing implementations, then create my own implementation (ZIM_PO_CHECK) with class ZCL_IM_PO_CHECK. In method CHECK I read the header via im_header->get_data( ), and if BSART = 'ZNB' and EKGRP is initial, I issue an error through the MM message macros (INCLUDE mm_messages_mac, mmpur_message_forced) and set ch_failed = abap_true to prevent saving. The rule itself sits in a small class for reuse and unit tests. I test ME21N/ME22N and PO creation via BAPI_PO_CREATE1, which also runs the BAdI.
mediumBAdI

2. What is the difference between classic and new (Enhancement Framework) BAdIs?

Classic BAdIs (SE18/SE19) are single-use or multiple-use, based on interfaces and filter values, and are called via CL_EXITHANDLER=>GET_INSTANCE. New BAdIs are part of Enhancement Spots, support context-based filters, are called with GET BADI / CALL BADI, offer better performance (no cross-client lookup at every call) and support fallback classes.
mediumBAdI

3. A BAdI implementation is active but not getting triggered. What would you check?

I would check whether the correct business process is being executed, whether the BAdI is called in that process, whether the implementation is active, whether filter values match, whether multiple implementations exist and whether the breakpoint is placed in the correct method.
mediumBAdI

4. 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?

When SAP migrates a classic BAdI to the Enhancement Framework, the calling code uses GET BADI/CALL BADI, and existing classic implementations are still executed through the migrated definition. New implementations are created via the enhancement spot. So both can be active and both run if the BAdI is multiple-use. I would check SE18 for the migration status, list implementations of both kinds in SE19, check filters and activation, and debug the call to see the actual sequence and data changes. If both implement related rules, I consolidate them into one implementation (preferably the new one) to avoid order dependency and duplicate messages.
hardBAdI

5. How do you design a BAdI implementation for maintainability?

I keep the BAdI method small, use guard conditions, delegate business logic to a service class, avoid heavy database logic, use configuration where required, handle messages consistently and document the purpose. This keeps the implementation easier to debug, test and support.
hardBAdI

6. Why are released BAdIs important in S/4HANA clean-core strategy?

Released BAdIs are intentionally provided extension points and are generally more upgrade-safe than implicit source-code enhancements. In S/4HANA clean-core strategy, teams should prefer released extensibility options such as BAdIs, APIs, key-user extensibility, RAP/CDS extensions or side-by-side extensions before using risky source-code enhancements.
mediumBAdI

7. Different company codes need different validations in a process where SAP offers a BAdI. How do you find and implement the right BAdI?

I would find the BAdI through SPRO documentation for the process, SE18/SE84 by package, or by debugging with breakpoints on GET BADI and CL_EXITHANDLER=>GET_INSTANCE. In SE18 I check whether it is filter-dependent (e.g. by BUKRS) and single or multiple use. If it is filter-dependent, I create one implementation per company-code group with the corresponding filter values in SE19 — no IF on company code in the code. If it has no filter, I create one implementation with a dispatcher that selects rules via a customizing table or company-specific classes. I activate, test each company code and verify activation in each system after transport.
mediumBAdI

8. 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?

Filter-dependent implementations only run for the filter values they list. The new sales org matched no implementation, so either nothing ran (multiple-use) or the fallback class ran with only default behaviour. This is a design gap, not a coding error. For a custom BAdI I would define a fallback class containing the group-wide default rule, and add specific implementations only for deviations. For go-lives, reviewing filter values of all filter-dependent BAdIs becomes a checklist item. If a single-use BAdI has no fallback and no match, GET BADI raises CX_BADI_NOT_IMPLEMENTED — the caller must handle it deliberately.
mediumBAdI

9. A sales order BAdI method contains validation, SQL, message formatting and email sending in one block. How would you redesign it?

I would make the implementing class a thin adapter: map parameters to an input structure, call a rule class, and map exceptions/messages back to the BAdI's mechanism. SQL goes into a DAO with buffering, validation rules into a rule class with unit tests, message formatting into one place. Email sending does not belong in a save-time validation at all: it has side effects and would be sent even if the save fails later. It moves to an after-save mechanism (output/workflow/event or an update task step). Each part becomes testable and the BAdI method shrinks to a few lines.
mediumBAdI

10. Different company codes require different tax validations in a filter-dependent BAdI. How would you set up the implementations?

Let the filter do the selection. Company codes with the same rule share one implementation with several filter values (e.g. BUKRS = 3000 OR 3100 for India), and a different rule gets its own implementation (BUKRS = 1000 for Germany). No IF on BUKRS inside the code. A fallback class (for own new BAdIs) holds the default rule. I ensure filter conditions don't overlap for single-use BAdIs, keep the tax rules in unit-tested classes, and review filters when new company codes go live. Tests cover each filter group plus a non-matching company code.
mediumBAdI

11. Purchase order save is blocked only for one plant and nobody knows why. How do you debug it?

I would reproduce in a test system with that plant and debug the save: breakpoints at CL_EXITHANDLER=>GET_INSTANCE (classic, e.g. ME_PROCESS_PO_CUST) and GET BADI / CALL BADI, plus a watchpoint on the failure flag (CH_FAILED) or the message. The call stack shows which implementation sets it. Then I check that implementation: filter values or conditions on plant, customizing tables it reads, and data it uses. Plant-specific behaviour often comes from a filter or a Z table entry. I also list all implementations in SE19 and check other enhancements (user exits, validations). After finding the cause, I document it and add a test case for that plant.
mediumBAdI

12. A delivery field was changed twice during save by two implementations of a multiple-use BAdI, with inconsistent results. How do you resolve it?

In a multiple-use BAdI all active implementations run, one after another, in an undefined order, and each sees the CHANGING values of the previous. Two implementations changing the same field produce a result that depends on order — which may change after transports. I would find both implementations (SE19), decide which rule is correct or how they combine, and merge them into one implementation with a dispatcher class that calls the rules in a defined order, or split responsibilities so that each implementation changes different fields. If the BAdI must return a single decision, a single-use design (for own BAdIs) is the right choice. A register of implementations prevents repeats.
mediumBAdI

13. A purchase order BAdI reads the vendor master for every item. What is the performance impact and how do you fix it?

Vendor data is header-level, but PROCESS_ITEM runs for each item on every change or Enter, so the same SELECT runs items × interactions times. For large POs or mass creation this causes long response times. Fix: move the vendor check to a header-level method (CHECK or PROCESS_HEADER), use data available from the header object, and if a read is needed, buffer it by vendor/purchasing org in a hashed table. Add guard conditions (PO type). Verify with ST05 (identical selects) and SAT before and after.
mediumBAdI

14. How do you find the correct BAdI to enhance a transaction?

Set an SE24 breakpoint on CL_EXITHANDLER=>GET_INSTANCE, run the transaction and observe which BAdIs are called. For new BAdIs, set a breakpoint on GET BADI/CALL BADI or search the transaction's package for enhancement spots in ADT.
easyBAdI

15. What is the difference between BAdI definition and BAdI implementation?

A BAdI definition defines the enhancement option and method interface. A BAdI implementation contains the actual custom logic written by the developer. SE18 is commonly used to view definitions and SE19 is used to create or manage implementations.
hardBAdI

16. BAdI slows down document save by 200 ms. What do you do?

Profile with SAT the exact call, remove any DB SELECT inside the loop, buffer master data at session start, batch DB reads with FOR ALL ENTRIES, and consider a background job if the logic is not strictly real-time.
hardBAdI

17. BAdI CHANGING parameter is not reflected in caller. Why?

New BAdIs pass parameters by value by default; declare parameters as CHANGING in the interface and confirm the standard code uses the returned values. If the standard reads a separate copy, you may need a different hook.
hardBAdI

18. 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?

Following clean core, I first check standard and configuration, then a released BAdI for sales document checks: simple rules via the Custom Logic app (key user extensibility), more complex ones as a released BAdI implementation in ABAP for Cloud Development using only released APIs. If data needed is not released, a tier 2 wrapper provides it. The implicit enhancement is removed after the new implementation is tested in all channels (Fiori, VA01, APIs). ATC cloud readiness checks confirm the new code, and the decision is documented in the extension register.
hardBAdI

19. How would you structure BAdI implementations for a large program?

Keep the BAdI implementation class thin — delegate immediately to a service class in a domain package. This isolates business rules from framework code and enables ABAP Unit tests independent of the BAdI runtime.

Related lesson

BAdI Part 6: Debugging BAdIs in Real Projects

Related topics

Next practice step

Go deeper on this topic