What is Enhancement in SAP?
- Enhancement in SAP refers to the process of customizing or extending the standard SAP software without modifying its original code.
- When a company implements SAP, it comes with predefined standard objects provided by SAP. However, businesses often require additional functionality to meet specific needs that are not covered by the standard features.
- Enhancements enable organizations to introduce new functionalities or modify existing ones while preserving the integrity of the core SAP system.
- Dictionary Object Enhancement: Used to add custom fields (Z-fields) to standard SAP tables.
- Domain Value Enhancement: Allows adding new values to standard SAP domains that are not provided by SAP.
- Source Code Enhancement: Used to insert custom logic into standard SAP programs. Ex: Adding validation rules to a standard SAP report.
- Screen Enhancement: Enables adding fields to standard SAP screens.
Types of Enhancement:
- User Exits (Obsolete):
- Available only in the SD module (Sales and Distribution).
- SAP provides subroutines (PERFORM statements) that begin with
USEREXIT_ in standard programs. - Requires an access key for implementation, hence it is called modification rather than an enhancement.
- Downside: Changes do not persist after an SAP upgrade.
- Customer Exits:
- Provides a custom way to enhance functionality of std.programs, function modules and screens.
- Also known as Function Module Exits, Because Customer Exits are implemented thrw FM.
- Types:
- Menu Exits – Add custom menu options.
- Screen Exits – Add custom fields to standard screens.
- Function Module Exits – Extend SAP logic via function modules.
- TCode: SMOD – Search for available customer exits.
- TCode: CMOD – Create and configure enhancement projects.
- BAdI (Business Add-Ins):
- Types: Old BAdIs and New/Kernal BAdIs
- Flexible, object-oriented approach to enhancements, supporting multiple implementations.
- Find BAdIs at SE18 using pkg or using class
CL_EXIT_HANDLER in SE24 or using Get BAdI/ Call BAdI. - Implement BAdIs at TCode: SE19.
- Enhancement Options:
- Implicit Enhancements
- Explicit Enhancements
- Enhancement Points
- Enhancement Sections
- BTE (Business Transaction Events):
- Used primarily in FI (Financial Accounting) modules.
- Custom function module attached to the standard SAP program to enhance functionality.
- Available only in the SD module (Sales and Distribution).
- SAP provides subroutines (PERFORM statements) that begin with
USEREXIT_in standard programs. - Requires an access key for implementation, hence it is called modification rather than an enhancement.
- Downside: Changes do not persist after an SAP upgrade.
- Provides a custom way to enhance functionality of std.programs, function modules and screens.
- Also known as Function Module Exits, Because Customer Exits are implemented thrw FM.
- Types:
- Menu Exits – Add custom menu options.
- Screen Exits – Add custom fields to standard screens.
- Function Module Exits – Extend SAP logic via function modules.
- TCode: SMOD – Search for available customer exits.
- TCode: CMOD – Create and configure enhancement projects.
- Types: Old BAdIs and New/Kernal BAdIs
- Flexible, object-oriented approach to enhancements, supporting multiple implementations.
- Find BAdIs at SE18 using pkg or using class
CL_EXIT_HANDLERin SE24 or using Get BAdI/ Call BAdI. - Implement BAdIs at TCode: SE19.
- Implicit Enhancements
- Explicit Enhancements
- Enhancement Points
- Enhancement Sections
- Used primarily in FI (Financial Accounting) modules.
- Custom function module attached to the standard SAP program to enhance functionality.
SAP Recommended Usage by Enhancement Type
-
BAdIs (New/Kernal BAdIs)
🔹 Use for most modern enhancements – especially in S/4HANA.
🔹 Preferred method for flexible, object-oriented, multiple implementation support. -
Customer Exits
🔹 Use when SAP provides predefined exits (still valid in ECC & some S/4HANA areas).
🔹 Recommended if BAdI is not available. -
Enhancement Points (Implicit/Explicit)
🔹 Use when no BAdI or Customer Exit is available.
🔹 Use to enhance standard code without modifications (safe for upgrades). -
BTE (Business Transaction Events)
🔹 Use specifically for FI module enhancements where SAP exposes BTE points.
🔹 Use when financial transaction enhancement is required and BAdI is not offered. -
User Exits
🔹 Not recommended by SAP.
🔹 Use only in legacy SD scenarios where other options are unavailable.
________________________Lets See In Detail________________________
Customer Exit
Types of Customer Exits:
-
Menu Exits – Add custom menu options to standard SAP applications.
-
Screen Exits – Add extra fields or modify the layout of standard SAP screens.
-
Function Module Exits – Extend SAP logic by enhancing function modules.
- TCode: SMOD and SE24 – To find customer exits. SE24->Enhnc->Cust.Ext
- TCode: CMOD – To Create and Implement enhancement projects.
To Find and Implement Funtion Module Exits:
-
Open MM01 transaction → Go to System → Status → Program Name.
Step 2: Find the Package Name
-
Double-click the Program Name → Goto → Object Directory Entry → Package Name.
-
Alternatively, use SE93:
-
Enter TCode MM01 → Find Program Name & Package Name.
-
Step 3: Search for Customer Exit
-
Open SMOD → Press F4 → Select Information System.
-
Enter the Package Name obtained from Step 2.
-
Review the available exits and select the one that fits the requirement.
Step 4: Create an Enhancement Project in CMOD
-
Open CMOD and create a new Project (ZMAT).
Step 5: Implement the Validation Logic & Activate
-
Write the custom validation logic inside the include.
- IF wmara-mtart = 'NOF1'.IF wmara-meins NE 'FT2'.MESSAGE 'For NOF1 Material, UOM must be FT2' TYPE 'E'.ENDIF.IF wmara-matkl NE 'RS21312'.MESSAGE 'For NOF1 Material, Material Group must be RS21312' TYPE 'E'.ENDIF.ENDIF.
-
Activate the enhancement project in CMOD.
Step 6: Test the Implementation
-
Run MM01 and check if the validation logic is working as expected.
-
Identify the Menu Exit:
-
Open SE38 → System → Status.
-
Double-click on the menu options (e.g., Program, Edit, Goto, Utilities) to check if +CUS exists, confirming that a custom menu option can be added.
-
-
Find the Package of the Program:
-
Open SE38, display any program.
-
Navigate to System → Status.
-
Double-click on the program name (e.g., SAPLS38E).
-
Go to Object Directory Entry and find the package name.
-
-
Find Menu Exit Using SMOD:
-
Open SMOD → Press F4 → Select Information System.
-
Enter the package name found in the previous step.
-
Look for the Menu Exit (e.g., SEU00002).
-
-
Implement Using CMOD:
-
Open CMOD → Create a project (e.g., ZSE38).
-
Assign the Menu Exit found in the previous step under Enhancement Assignment.
-
Click on Components → Select the provided menu exit (e.g., SAPLWBABAP).
-
Enter the Function Text (e.g., Call Smartform).
-
Navigate to the function module provided → Double-click on the Z-include.
-
Implement the required logic and activate it.
-
-
Custom Logic in Z-Include:
-
Single Enhancement Project per Customer Exit:
-
Only one enhancement project can be created for each customer exit.
-
Multiple implementations are not possible for the same customer exit.
-
-
Limited Flexibility:
-
Enhancement points are predefined by SAP, restricting where and how modifications can be made.
-
Customization is limited to available exits, making it less adaptable for complex business requirements.
Procedural Implementation:
-
Customer exits follow a procedure-oriented approach, meaning they rely on function modules and procedural coding rather than object-oriented principles
- Implementation is done using custom includes(Z*) provided inside function modules associated with the enhancement.
- The required logic is written inside these includes to extend the standard functionality.
-
BAdI (Business Add-Ins).
- BAdI (Business Add-In) is an enhancement technique in SAP that allows multiple implementations and offers greater flexibility compared to customer exits.
- It follows object-oriented programming (OOP) principles and is implemented through interfaces.
- More flexible than Customer Exits, supporting multiple implementations, filters and better performance.
Transaction Codes:
- SE18 / SE84 – Define or search for a BAdI.
- SE19 – Implement the BAdI.
1. Classical BAdI (Old BAdI)
- Definition: The BAdI approach introduced after customer exits as part of the enhancement framework.
- System will automatically generate a Z-Class while creating implemetation of the classical BAdI.
2. Kernel BAdI (New BAdI)
- Definition: The newer and more advanced version of BAdI introduced in the Enhancement Framework after Classical BAdIs.
- Kernal BAdI has enhancement spots, which act as containers for BAdI implementations.
- We have to enter Z-Class name while creating implemetation of the New/Kernal BAdI.
To Finding a BAdI: (SE18, SE84, Prog way for kernal, Prg way for classical)
- Open SE18 → Enter the BAdI name or package by pressing F4 to search for available BAdIs.
- BAdIs without enhancement spots are Classical BAdIs.
- BAdIs with enhancement spots are Kernel BAdIs.
- SE84->Enhancement->Bussiness Add-Ins->Defenition->Enter the BAdI name or package to search for available BAdIs.
- Finding a Kernel BAdI Programmatically:Kernel BAdIs are directly called in ABAP code using
GET BADIandCALL BADI. You can find them dynamically by debugging.Steps to Identify a Kernel BAdI in a Transaction Code:
-
Open the transaction (T-code) where you want to find the BAdI.
-
Enter the necessary details and stop just before performing the action that triggers the BAdI.
-
Activate the Debugger:
-
Enter
/hin the command field and press Enter to start the global debugger.
-
-
Set Breakpoints on Kernel BAdI Statements:
-
In the debugger, go to:Menu Bar → Breakpoints → Breakpoint At → Breakpoint At Statement
-
Enter
GET BADIandCALL BADIas breakpoints.
-
-
Press F8 (Continue) repeatedly to reach the first breakpoint.
-
The debugger will stop at the
GET BADIstatement, revealing the BAdI instance being used. -
Continue pressing F8 until the
CALL BADIstatement is reached, where you can see the exact method being executed.
Key Concepts:-
GET BADIreturns an instance of the BAdI implementation class. -
CALL BADIexecutes the methods of the retrieved BAdI instance, triggering the custom business logic.
-
- Finding Classical BAdI using CL_EXITHANDLER (Programmatic Search)
- Classical BAdIs are invoked using the proxy class
CL_EXITHANDLER. - Methods like
CL_EXITHANDLER=>GET_INSTANCEhelp identify the BAdI dynamically.
Steps to Find BAdI in Code:
- Open SE24 → Enter class CL_EXITHANDLER.
- In display mode, go to the Methods tab.
- Double-click on GET_INSTANCE to view the source code.
- Set a breakpoint on: CALL METHOD CL_EXITHANDLER=>GET_CLASS_NAME_BY_INTERFACE
- Run the transaction code for which you want to find the classical BAdI.
- The debugger will stop at this method, helping you find the associated classica BAdI at exit.
- SAP Internal - Only for SAP internal uses, we cannot use.
-
Single Implementation BAdI – Allows only one active implementation.
-
Multiple Implementation BAdI – Supports multiple active implementations running in parallel.
-
Filter BAdI – Allows different implementations to be executed based on specific filter values.
Enhancement Options.
Enhancement options define specific positions within the SAP Object Repository where enhancements can be implemented. These options can either be explicitly defined by the developer or provided by SAP.
Types of Enhancement Options
1. Implicit Enhancement Options
-
Provided by the framework and always exist at fixed positions in SAP standard programs.
-
They do not require an enhancement spot for activation.
-
Available at fixed positions, such as:
-
Start and end of a program
-
Subroutines
-
Function Modules
-
Methods in Classes
-
-
Usage:
-
Allows adding additional logic without modifying SAP standard code.
-
Cannot replace or change SAP standard logic.
-
2. Explicit Enhancement Options
-
Defined by developers within an SAP program.
-
Managed using Enhancement Spots and enhanced using Enhancement Implementations.
-
Can be placed anywhere within the code.
- Types of Explicit Enhancements:
- Enhancement Point:
- Allows adding custom logic without modifying SAP standard code.
- Does not provide default implementation.
- Enhancement Section:
- Allows modification or replacement of SAP standard code.
- Provides a default implementation, which can be overridden.
BTE (Business Transaction Events).
BTE is Business Transaction Event, an enhancement technique designed primarily for the FI (Financial Accounting) module in SAP.
It allows developers to add custom functionality using predefined interfaces by implementing custom function modules.
-
Find a Suitable BTE Event
-
Go to transaction FIBF
-
Navigate to:
Environment → Information System → Execute -
Search and identify the relevant BTE event that matches your business requirement.
-
-
Create a Custom Function Module
-
In the same screen, select the BTE event.
-
Click on Sample Function Module.
-
Copy it to a custom function module under your own function group.
-
Add your custom logic and activate it.
-
-
Create and Activate a Product
-
Go to:
FIBF → Settings → Products → Of a Customer → New Entries -
Enter a unique Product ID and description.
-
Check the Active checkbox and save.
-
-
Assign the Function Module to the BTE Event
-
Go to:
FIBF → Settings → P/S Modules → Of a Customer → New Entries -
Enter:
-
Event ID (e.g., 00001650)
-
Product ID (created in Step 3)
-
Function Module (created in Step 2)
-
-
Save your entries.
-



