Sei sulla pagina 1di 3

BADI's

Business Add-Ins is a new SAP enhancement technique based on ABAP Objects

Create an Implementation for an SAP provided BAdI

Find the corresponding BAdI for the SAP transaction

Create a custom Implementation for the BAdI

From the methods available in the BAdI select the appropriate method

Enter custom code in the method and activate

Execute SAP transaction and test if method with custom code is being invoked

Finding BADI

1. Using SPRO

Go To IMG (Implementation guide)

Find the BADI in implementation Guide (IMG)

TCODE: SPRO (IMG)

Search for BADI

Check the Documentation for BADI’s functionality

Data Populated as Parameters in the BADI .

Functionality will be implemented in the Method.

2. Search for ‘CL_EXITHANDLER=>GET_INSTANCE’


To find a BAdI for any SAP transaction does the following:

– Click on System->Status

– Double click on the program name

– Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.


Make sure the radio button – In main program is checked

– A list of all the programs with call to the BAdIs will be listed.

– The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class

CL_EXITHANDLER will have the user exit assigned to it.

– The changing parameter ‘INSTANCE’ will have the interface assigned to it.

If the BAdI name is not specified in the CL_EXITHANDLER=>GET_INSTANCE method call, you can find
out the BAdI name by removing the prefix IF_EX_ from the interface name

3. Using SE80 or SE18 or SE81


Open the Repository Information
System in SE80

Goto Enhancements->Business Add-Ins and open up Implementations

Place your cursor in the Definitions field and hit F4 for help

Alternatively you could go to the first screen of SE18 and hit F4 in the definition name field to get the same
result

In SE81 Drill down through the component hierarchy and select a component. All BAdI’s related to this
application area will be displayed in the tree

4. Find BADI using FM SXV_GET_CLIF_BY_NAME


Go to the transaction SE37
Locate the function SXV_GET_CLIF_BY_NAME.

Put a breakpoint there.

Now open a new session.

Go to your transaction.

At that time, it will stop this function.

Double click on the function field NAME.

That will give you name of the BADI that is provided in your transaction.

Creating an implementation
– Choose ABAP Workbench -> Utilities -> Business Add-Ins (transaction SE19) from the SAP menu
Enter the name of the BAdI you want to create an implementation for.
− Choose Create Impl.
Enter a name for the implementation.

In the Attributes tab

− Enter the description for the custom implementation

− Click on the Activate button to activate the implementation

In the interface tab you will find the Interface name and a list of methods included in the BAdI Interface

Double clicking on Interface name you will find a list of Methods. Select a line (method) and hit
Parameters. (If associated type is also an Interface then select the Parameter and double click on Associated
Type, select a method and hit Parameter again).

Double clicking on any of the methods will take you into the Class Builder where you can enter custom
code for the corresponding method, using the parameters you found with the above procedure.

Potrebbero piacerti anche