Business Add-In'S (Badis)

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 21

Business Add-Ins (BADIs) Submitted by Sylendra Prasad

SESSION OVERVIEW
Business Objects

BAdIs
Defining BAdIs Implementing BAdIs

Multiple Use BAdIs


Filter dependent BAdIs

Business Add-ins (BAdI)


New SAP enhancements using SAP Objects. Users of BAdI can customize the logic according to the specific requirements (User-defined) or use the standard logic available. Each Business Add-In has
At least one BAdI definition A BAdI interface A BAdI class that implements the interface

For User-defined BAdI,


developer creates an interface for the add-in. Enhancement management creates an adapter class that implements the interface Developer creates an instance of the class in the application program and calls the corresponding methods.

For standard BAdI, interface and class will be predefined by SAP. Adapter class performs these tasks
Control ( the class calls all active implementations) Filtering (If the Add-in has to be executed under certain conditions, the class ensures that only certain implementations are executed)

In BAdI, all the enhancement components are grouped together.


Program Enhancements (interface methods) Menu Enhancements (function codes in interface definition) Screen Enhancements .

Defining BAdIs
From SAP Easy Access goto Tools -> ABAP Workbench -> Utilities -> Business Ad-Ins -> Definition or SE18.

BADI Implementation
From Easy Access, goto Tools->ABAP Workbench -> Utilities -> Business Add-Ins->Implementation or SE19.

During implementation, the class for implementing the interface is created automatically. Navigate to Class Builder by double-clicking the method. Implement the method of the class and activate it. In the main program, create a reference variable to the BAdI definition (interface). Find out if any active implementation exists for the definition. If it exists, perform the implementation by calling the required method implemented in the adapter class.

Implementation for Standard BAdIs


Find the required BAdI for the transaction

Create custom implementation for the BAdI


From the available methods, select the required one Enter the custom code in the method and activate Execute the transaction and check if the method with the custom code is being invoked.

Finding the BAdI Go to any transaction (say CV02N) and from the menu, select System ->Status to get the program name. In the program, search for CL_EXITHANDLER=>GET_INSTANCE with the radio button In Main Program selected. Select one program from the list of programs containing calls to BAdIs. The changing parameter INSTANCE will have the interface assigned to it. Find out the corresponding BAdI Interface and definition
For eg: if the inteface name is IF_EX_DOCUMENT_MAIN02 is the interface , the BAdI definition name will be DOCUMENT_MAIN02.

Creating custom implementation In SE19, in the place of BAdI definition name, give the obtained definition name.( say DOCUMENT_MAIN02)

In the interfaces tab, select by double clicking, the required method to be called to suit the requirement. Insert your own code in the method selected. Save the code and activate it. If it is not activated, previous active version of the method will be called.

Multiple Use BAdIs


Multiple implementations are possible for the same BAdI

There is no sequence control for multiple implementation since at the time of definition, it doesnt know which implementation will be active.
All active implementations will be triggered by the application program.

To display the list of all implementations of a BAdI definition, go to Implementation -> Display in SE18.

Filter dependent BAdIs


BAdIs are implemented based on some filter values

Filter type must specified while defining the enhancement.


It can be a single filter value or a set of values. All methods in the interface will have the filter value FLT_VAL as their importing parameter. The method then selects the active implementation based on the data provided in the filter value.

Navigate to the Interface definition in SE24 for defining the methods. For each of the methods defined, appropriate filter value must be defined as an importing parameter.

The method then selects the active implementation based on the value. When implementation is done, select from the search help or enter a valid value.

Select the method of the adapter class to enter the source code. The parameter FLT_VAL contains the filter value passed to the implementation. Save and activate the method. In the application program, include the exporting parameter FLT_VALUE in the method to be called. Different implementations can be made with different set of filter values.

THANK YOU ALL

You might also like