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

CriteriaBADIBAPI
FunctionModify SAP behavior through custom logicBridge SAP with external systems or programs
ArchitectureObject-oriented enhancementFunction module interface
Custom ImplementationFully supportedGenerally not customizable
PurposeInternal customizationsData sharing and process automation
SAP TransactionSE18 / SE19SE37 / BAPI
FlexibilityMultiple implementations supportedMostly single-purpose
Used InEnhancing standard SAP logicInterfacing and external integrations

Frequently Used BADIs in SAP

BADI NamePurposeT-Code
ME_PROCESS_PO_CUSTCustomize PO creation processME21N
HRPAD00INFTYModify employee infotype behaviorPA30
BADI_SD_SALESAlter sales document logicVA01
BADI_MATERIAL_CHECKValidate material entriesMM01
BADI_FDCB_SUBBAS01Additional checks before finance postingsFB01
BADI_LE_SHP_DELIVERYAdd logic to delivery documentVL01N

Frequently Used BAPIs in SAP

BAPI NamePurposeT-Code
BAPI_MATERIAL_SAVEDATACreate/update material masterMM01
BAPI_CUSTOMER_CREATEFROMDATA1Add new customer recordXD01
BAPI_SALESORDER_CREATEFROMDAT2Sales order creationVA01
BAPI_PO_CREATE1Generate purchase orderME21N
BAPI_EMPLOYEE_GETDATARetrieve employee master dataPA20
BAPI_INCOMINGINVOICE_CREATERecord incoming vendor invoiceMIRO

When Should You Use BADI or BAPI?

ScenarioRecommended Tool
Customizing SAP’s standard screen behaviorBADI
External app integration with SAPBAPI
Adding logic to material master creationBADI
Auto-creating customer records via APIBAPI

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.