SAP BADI: Enhancement of a SAP Standard Program/Class/function are a daily routine for ABAP-er ( at least for me ).
The most harsh part is to find the right place to put the custom code.
This article will give two different step-by-step guides to find the BADI or User-Exit for a transaction or program. It is up to you to choose the most relevant for your case.
- Debugging the CL_EXITHANDLER Class
- Analyse SQL Trace
Find BADI with CL_EXITHANDLER
How To Find BADI and User Exit for any SAP Transaction ?
The simplest way is debugging a method of exit handler class. You will go through all the existing BADI and Exit one by one.
The class CL_EXITHANDLER: Class for Ext. Services Within Framework of Exit Technique
Then put a break-point in the method GET_CLASS_NAME_BY_INTERFACE.
For each Standard Transaction, the framework calls the class CL_EXISTHANDLER to retrieve the list of BADI.
Let take an exemple and try to find all the exit for Customer transaction ( XD02 ) in SAP SD.
Go to SE24: CL_EXITHANDLER
And then navigate to method and select GET_INSTANCE
- Complete list of SAP Purchase Document ME21N Exit and BADI
- The Main SAP SRM BADI’s List to enhance Standard SAP SRM
- SAP Invoice IDoc INVOIC2 – Structure, Enhancement (exit and BADI)
Put the Break Point
Place a BREAK-POINT after the call of method GET_CLASS_NAME_BY_INTERFACE.
The Name of SAP BADI will be in variable EXIT_NAME
Execute your Transaction
In Our Case, we want to list all the SAP BADI called for Customer Save.
And the list for SAP SD Customer Transaction Save is:
Tips: Activate only the Break-point only before the action you want to find BADI for.
SAP BADI Tcodes
|SE18||Business Add-Ins: Definitions|
|SE19||Business Add-Ins: Implementations.|
Other Ways to find BADI in SAP
Use the performance Trace ( SQL trace ) with Tcode ST05. Don’t forget to set field “Buffer trace” as flagged.
Actually, the BADI Database are buffered.
In the Trace result, filter on Object Name: V_EXT_IMP and V_EXT_ACT.