For professionals working in SAP environments, terms like BADI and BAPI are frequently used, but they serve completely different purposes. While both are integral to ABAP development, it’s crucial to understand how they differ in concept, functionality, and application.
This post simplifies the difference between BADI and BAPI, explains when to use each, and includes essential lists of commonly used implementations along with their T-codes.
What is BADI in SAP?
BADI (Business Add-In) is part of SAP’s enhancement framework that enables developers to insert custom logic into standard SAP applications—without changing the core code.
Key Characteristics of BADI:
- Based on object-oriented ABAP
- Offers extension points in SAP programs
- Enables client-specific implementations
- Allows multiple implementations
T-Codes:
- SE18 – BADI Definition
- SE19 – BADI Implementation
What is BAPI in SAP?
BAPI (Business Application Programming Interface) is a predefined interface that allows external programs or SAP modules to communicate with the SAP system in a secure and structured way.
Key Characteristics of BAPI:
- Built on function modules
- Enables external systems to perform business tasks in SAP
- Follows standard input/output parameters
- Frequently used for integration and automation
T-Codes:
- SE37 – Display Function Module
- BAPI – Direct BAPI search
Comparison Table: BADI vs BAPI
Criteria | BADI | BAPI |
---|---|---|
Function | Modify SAP behavior through custom logic | Bridge SAP with external systems or programs |
Architecture | Object-oriented enhancement | Function module interface |
Custom Implementation | Fully supported | Generally not customizable |
Purpose | Internal customizations | Data sharing and process automation |
SAP Transaction | SE18 / SE19 | SE37 / BAPI |
Flexibility | Multiple implementations supported | Mostly single-purpose |
Used In | Enhancing standard SAP logic | Interfacing and external integrations |
Frequently Used BADIs in SAP
BADI Name | Purpose | T-Code |
---|---|---|
ME_PROCESS_PO_CUST | Customize PO creation process | ME21N |
HRPAD00INFTY | Modify employee infotype behavior | PA30 |
BADI_SD_SALES | Alter sales document logic | VA01 |
BADI_MATERIAL_CHECK | Validate material entries | MM01 |
BADI_FDCB_SUBBAS01 | Additional checks before finance postings | FB01 |
BADI_LE_SHP_DELIVERY | Add logic to delivery document | VL01N |
Frequently Used BAPIs in SAP
BAPI Name | Purpose | T-Code |
---|---|---|
BAPI_MATERIAL_SAVEDATA | Create/update material master | MM01 |
BAPI_CUSTOMER_CREATEFROMDATA1 | Add new customer record | XD01 |
BAPI_SALESORDER_CREATEFROMDAT2 | Sales order creation | VA01 |
BAPI_PO_CREATE1 | Generate purchase order | ME21N |
BAPI_EMPLOYEE_GETDATA | Retrieve employee master data | PA20 |
BAPI_INCOMINGINVOICE_CREATE | Record incoming vendor invoice | MIRO |
When Should You Use BADI or BAPI?
Scenario | Recommended Tool |
---|---|
Customizing SAP’s standard screen behavior | BADI |
External app integration with SAP | BAPI |
Adding logic to material master creation | BADI |
Auto-creating customer records via API | BAPI |
Final Thoughts
The key takeaway is:
- Use BADI when you want to inject custom logic into SAP’s standard processes.
- Use BAPI when you need to integrate SAP with external systems or automate business transactions.
Both are powerful in their own context, and mastering their use can greatly enhance your SAP development capabilities.