BAdI Part 2: Finding and Implementing a BAdI Step by Step
Preview · a free account unlocks the full lesson
Implement 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.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 1 explained a BAdI's structure; now we build one from start to finish, from finding it through to activating and testing it.
Finding the right BAdI starts with SPRO, where many areas have "Business Add-Ins (BAdIs)" nodes with their own documentation — for example under MM → Purchasing → BAdIs. SE18 can also be searched with F4 by application component or by package, and SE84 has an Enhancements → Business Add-Ins node.
Find BAdIs via SPRO ("Business Add-Ins" nodes), SE18/SE84 by package, or the debugger. If you already know roughly where in the code the extension point should be, setting a breakpoint at CL_EXITHANDLER=>GET_INSTANCE or at the GET BADI statement, as covered in Part 6, will catch it as the program runs.
Whichever way you find it, read its documentation and check its "Multiple use" and filter settings before implementing it.
Creating the implementation happens in SE19. SE19: enter the BAdI (classic) or enhancement spot (new), create an implementation, SE19 generates the class with empty methods. For a classic BAdI, choose Create Implementation, enter the classic BAdI's name, give the implementation a name such as ZIM_…, and SE19 proposes an implementing class named ZCL_IM_….
For a new-style BAdI, choose Create Implementation, enter the enhancement spot, give the enhancement implementation a name such as ZEI_…, the BAdI implementation a name such as ZBI_…, and the implementing class a name such as ZCL_…; if the BAdI is filter-dependent, set the filter values at this point too. Assign a package and transport request as usual.
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.