BAdI Part 4: Classic BAdI vs New BAdI
Preview · a free account unlocks the full lesson
Compare 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.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 through 3 of this series used both kinds of BAdI without dwelling on the difference; this lesson makes that difference explicit, because support work involves both. Classic BAdIs, predating NetWeaver 7.0, are called through CL_EXITHANDLER=>GET_INSTANCE, while new BAdIs are called through the ABAP statements GET BADI and CALL BADI.
A classic BAdI is defined in SE18's classic view, with an interface named IF_EX_<badi> and an adapter class CL_EX_<badi> generated by SAP. It's called with cl_exithandler=>get_instance( CHANGING instance = l_badi ). followed by l_badi->method( ).. It's implemented in SE19's classic mode as a class named ZCL_IM_<impl>. It supports only one filter type (for example LAND1), with the filter value passed in as the method parameter FLT_VAL, and it's activated with a button in SE19, with the adapter checking active implementations at runtime — which carries some overhead.
A new BAdI, part of the Enhancement Framework, is defined inside an enhancement spot (in SE18 or SE20), and used with the BAdI name as a type: DATA l_badi TYPE REF TO badi_name.. It's called with GET BADI l_badi FILTERS … . followed by CALL BADI l_badi->method … ..
It's implemented as an enhancement implementation containing a BAdI implementation, itself a class combining IF_BADI_INTERFACE with the BAdI's own interface. It supports several filter characteristics with real comparisons (=, <>, CP, and so on) defined per implementation, with no FLT_VAL parameter needed, and it supports a fallback class, different instance creation modes (new instance or reuse), and context-dependent BAdIs.
Because it's handled by the kernel, it carries significantly less runtime overhead than the classic style.
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.