Mastering SAP ABAP Enhancements : Kernel BADI
- chandinisirigirise
- 21 hours ago
- 6 min read

Business Add-Ins (BAdIs) are one of the most powerful enhancement techniques in SAP, allowing developers to add custom business logic without modifying standard SAP code. Among the different types of BAdIs available, Kernel BAdI (also called New BAdI or Kernel-Based BAdI) stands out as a modern and optimized framework introduced to overcome the limitations of Classic BAdIs.
In this blog, we’ll explore:
What Kernel BAdIs are and why they matter
How they differ from Classic BAdIs
A practical step-by-step example in MM01 (hiding unwanted buttons)
How to create your own Kernel BAdI definition
What is Kernel BAdI and Why Do We Need It?
A Kernel BAdI is an enhancement technique embedded in the ABAP Kernel to deliver better performance and flexibility compared to Classic BAdIs. They were introduced with the Enhancement Framework in SAP NetWeaver 7.0 and are now the standard method for implementing BAdIs.
Why use Kernel BAdIs?
🚀 Faster Execution: Kernel-level integration improves performance.
🔄 Upgrade-Safe Enhancements: Changes remain intact during system upgrades.
🎛 Flexible: Supports multiple and filter-dependent implementations.
📦Better Framework: Managed under Enhancement Spots for easier organization.
Classic BAdI vs. Kernel BAdI
Aspect | Classic BAdI | Kernel (New) BAdI |
Finding | Via CL_EXITHANDLER=>GET_INSTANCE | Via CALL BADI / GET BADI |
Container | None | Enhancement Spot |
Implementation Container | Not required | Enhancement Implementation |
Implementing Class | Auto-generated | Defined manually |
Usage | Limited | Stronger Integration, Better Performance |
Practical Example: Hiding Unwanted Buttons in MM01
Let’s walk through a business scenario where a customer requires changes in the Material Creation (MM01) transaction.
Requirement
When creating a material in MM01, the user provides the following input:
Industry Sector: Pharmaceuticals
Material Type: Raw Materials

After pressing Enter, the system asks to select the required views. The user clicks Continue and proceeds to the next screen, where they provide:
Material Description
Base Unit of Measure
At this stage, the application toolbar displays additional options like “Additional Data” and “Org. Levels.”

However, the customer’s requirement is simple:
They do not need these two buttons, as the business process does not use them. Our goal is to hide or disable the “Additional Data” and “Org. Levels” buttons to make the screen cleaner and customer-specific.
Why Use a BAdI Here?
Since these buttons are part of the standard MM01 transaction, we cannot simply hide them through configuration. Instead, we must apply a customer-specific enhancement.
This is where a Kernel BAdI (New BAdI) comes into play:
It allows us to control and adapt the toolbar elements without modifying the standard SAP code.
We can implement logic to suppress or disable the “Additional Data” and “Org. Levels” buttons, ensuring the UI matches the customer’s requirement.
Since this requirement involves modifying the standard MM01 toolbar, we first need to check the feasibility and identify the correct Kernel BAdI.
Approach: Debugging with CALL BADI / GET BADI
The most reliable way to discover the relevant BAdI is through debugging, by setting breakpoints on the statements CALL BADI or GET BADI. This approach is preferred by technical consultants because it gives full control and visibility into where SAP is instantiating BAdIs during runtime.
Steps:
Go to transaction MM01.

Activate debugging by typing h in the command field.

Set breakpoints:
Navigate to Breakpoints → Breakpoint at → Statement.

Enter CALL BADI and GET BADI and click on continue.

Press F8 to continue execution.
The debugger will stop whenever a BAdI is called. However, we are only interested in the point after the Basic Data screens, because that’s where the application toolbar (with Additional Data and Org. Levels) appears. So we skip earlier stops and continue until the relevant screen is loaded.
Discovering the Kernel BAdI
When the debugger halts at a GET BADI statement, check the program/include details. For example, we find:
GET BADI l_badi


Here, l_badi is an object referring to the BAdI definition BADI_MATERIAL_OD. Double-clicking this leads us to the BAdI definition and its interface methods.

Unlike Classic BAdIs, Kernel BAdIs are tied to Enhancement Spots. In this case:
BAdI: BADI_MATERIAL_OD
Enhancement Spot: BADI_MATERIAL_OD
Relevant Method: PF_STATUS_SETZEN
Parameter: EXTAB_INSERT (used to activate/deactivate toolbar functions)
Why This Works
The method PF_STATUS_SETZEN controls the GUI Status, which includes the application toolbar.
By using the parameter EXTAB_INSERT, we can deactivate specific toolbar buttons — exactly what our requirement demands (hiding Additional Data and Org. Levels).
SAP follows the same object-oriented principle:
GET BADI creates the BAdI object.
The instance method (here, PF_STATUS_SETZEN) is then called through that object.
Implementing the Kernel BAdI
Now that we’ve identified the correct Kernel BAdI (BADI_MATERIAL_OD → method PF_STATUS_SETZEN), let’s implement it to hide the unwanted toolbar buttons in MM01.
Step 1: Start Implementation
Go to transaction SE19.
Select the New BAdI radio button (Classic BAdI uses the “Classic” option).

Instead of directly entering a BAdI definition (like in Classic BAdIs), provide the Enhancement Spot:
Enhancement Spot: BADI_MATERIAL_OD

This will list all BAdI definitions under the spot. Select BADI_MATERIAL_OD.
Step 2: Create Enhancement Implementation
Unlike Classic BAdIs, Kernel BAdIs require an Enhancement Implementation, which acts as a container for individual BAdI implementations.
Provide a name and description for the Enhancement Implementation.

Save it in your package.
Now, create a BAdI Implementation inside it:

Assign the BAdI definition (BADI_MATERIAL_OD).
Provide an implementation class name (in Classic BAdIs this is generated automatically, but here we must define it).

Step 3: Implement the Interface Methods
Once the class is created, SAP will insert the interface with all its methods.

⚠️ Important: All interface methods must be redefined, even if you don’t add custom logic to each. Otherwise, the implementation remains inactive.
For our case, we only add logic inside:
Method: PF_STATUS_SETZEN

Changing Parameter: EXTAB_INSERT (controls toolbar functions).

Step 4: Find Function Codes of Buttons
Each toolbar button has a function code. To hide a button, we need to know its code.
Ways to find it:
System → Status → Double-click the GUI Status (e.g., DATE00) → Check function codes.


Or, run MM01 with a breakpoint in method PF_STATUS_SETZEN, press the button (e.g., Additional Data), and check variable sy-ucomm in the debugger.



For example:
Function code for Additional Data: ZU01
Function code for Org. Levels: (retrieved similarly).
Step 5: Write the Logic
Inside method PF_STATUS_SETZEN, add the unwanted function codes into the internal table EXTAB_INSERT.

This ensures those buttons are suppressed from the toolbar.
Step 6: Test the Implementation
Run MM01 again.
Enter the same details (Industry: Pharmaceuticals, Material Type: Raw Materials).
Proceed to the screen with the toolbar.
The buttons Additional Data and Org. Levels will now be hidden.

If not, set a breakpoint in PF_STATUS_SETZEN to debug.
How to Create a New Kernel BAdI Definition
So far, we have seen how to implement an existing Kernel BAdI (for example, hiding unwanted buttons in MM01). But what if we want to create our own Kernel BAdI definition?
In real SAP projects, especially in product development scenarios, SAP itself often provides the BAdI definition and customers implement it as per their needs. However, as developers, it’s also important to know how to create a new Kernel BAdI definition from scratch.
Step 1: Create an Enhancement Spot
A Kernel BAdI definition always sits inside an Enhancement Spot (a container for one or more Kernel BAdIs).
Go to transaction SE18.

Enter an Enhancement Spot name and click Create.

Provide a short description and save it in your local object or custom package.

Step 2: Create a New BAdI Definition
Inside the Enhancement Spot, create your own BAdI definition:
Click Create BAdI.

Enter a BAdI Definition name and description, then click Continue.

Select the checkbox Multiple Use if you want to allow multiple implementations.

Assign an Interface name (starting with Z or Y) and save it.
Example: ZINT_CHANGE.

SAP will prompt you to confirm. Select Yes, and your interface will be generated.
Step 3: Define Methods and Parameters
In the interface, define a method — for example:
Method: CHANGE
Level: Instance
Description: Change values or behavior.

Inside the Parameters section, create:
Parameter: PVALUE
Type: CHANGING
Data type: CHAR1.

Once you complete this, your Enhancement Spot and BAdI definition will be activated automatically.
Step 4: Using Your New BAdI in a Program
Now that we have defined the Kernel BAdI, we can use it inside a custom program.
Go to transaction SE38 and create a new report.

Since Kernel BAdIs are fully based on OOP principles, you will work with classes and objects.
Just like SAP calls methods (e.g., PF_STATUS_SETZEN in MM01), you will now call your own BAdI method (CHANGE) in the program.

Conclusion
Kernel BAdIs are the modern way to enhance SAP standard:
They are organized, upgrade-safe, and performance-oriented.
They allow developers to customize SAP behavior (like toolbar buttons in MM01).
They can be created and reused in product development projects.
👉 Whether you’re consuming SAP’s definitions or building your own, mastering Kernel BAdIs will make you more effective in real-world SAP enhancements.
Use full Links -

Chandini Sirigirisetti
SAP ABAP Consultant




