Business Add-In'S (Badis)
Business Add-In'S (Badis)
Business Add-In'S (Badis)
SESSION OVERVIEW
Business Objects
BAdIs
Defining BAdIs Implementing BAdIs
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)
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.
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.
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.
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.