BAdI Part 6: Debugging BAdIs in Real Projects
Preview · a free account unlocks the full lesson
Debug 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.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 through 5 built BAdI implementations; in support work, the recurring question is usually "why doesn't my BAdI run?" The debugging approach breaks down into four steps: is the BAdI even called; which implementations get found for it; does my specific method actually execute; and if it does, is the data what I expect it to be?
Useful breakpoints include a statement breakpoint on GET BADI or CALL BADI for new-style BAdIs, a method breakpoint on CL_EXITHANDLER=>GET_INSTANCE for classic BAdIs, and a breakpoint directly in your own implementation method.
Most "BAdI not working" cases trace back to one of a few causes: the implementation is inactive, a filter value doesn't match, the wrong BAdI or code path is actually involved, or another implementation is overriding yours.
One thing to plan for: when the BAdI runs inside an RFC or HTTP call, such as from Fiori or OData, you need an external (user) breakpoint rather than a session one, and background jobs need JDBG or SM50-based debugging instead.
To check whether the BAdI is called at all, set a statement breakpoint on GET BADI/CALL BADI, or a method breakpoint on CL_EXITHANDLER=>GET_INSTANCE, and run the transaction. If it's never reached, the likely explanation is that you're in the wrong transaction step, looking at the wrong BAdI, or that the code path you're exercising — a BAPI call instead of the dialog, for instance — simply doesn't call it.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
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.