BADI - Business Add Ins are enhancements to the standard version of the code of SAP. They can be inserted into the SAP system to accommodate user requirements too specific to be included in the standard delivery. Customers can find the possible enhancements (BADIs) in their SAP system in the Implementation Guide (IMG) and in the component hierarchy. BADI definitions are included in the IMG so that the customer can create suitable, company-specific implementations. SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces.
Two different views are available:
* In the definition view, an application programmer defines exit points in a source that allow specific industry sectors, partners, and customers to attach additional coding to standard SAP source code without having to modify the original object.
* In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard solution if one is available.
Definition of A BAdI
SAP application developer actually defines a Business Add-In available to an application program. Tcode SE18 can also be used to see the definition of existing badi .The following are the steps in defining a BADI:
1. Using the SAP BADI builder, the SAP application developer defines an enhancement (BADI). It consists of an interface with a method.
2. The interface name is generated automatically and can be changed. The system branches to the Class Builder.
3. Using the Class Builder, the developer assigns a method to the interface.
4. For each method, he defines parameters. Parameters can either be importing or changing and these are the fields available for customer to use for enhancements. Importing parameters are the fields being passed from the calling program and changing parameters are the fields being passed back to the program.
5. The Business Add-In is then activated in the Class Builder.
Note: Documentation of the BADI usually provides the list of parameters and their definition. For example, for method DETERMINE_EXTPO, the available parameters are:
Importing
o ITEM_DATA Item data (is a structure)
Changing
o BBP_EXTPO_GL
o If the field has the value X, the request is subject to the extended classic scenario.
o If the field is empty, the request is not subject to the extended classic scenario.
Implementation of a BAdI
If a customer wishes to use a Business Add-In, he or she first creates an implementation. The customer must implement the methods and the enhancements. You need to program the interface method in such a way that, when the add-in is called from the application program, it will perform the specific action the customer intends. The following are the steps customer can follow in implementing a BADI:
1. In the SAP menu, choose ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE19) or double-click the corresponding activity in the Implementation Guide (IMG).
2. Enter a name for the implementation and then click the Create pushbutton.
3. Enter the name of the add-in for which you want to create an implementation for in the dialog box that appears. Choose the Interface tab.
4. Choose ABAP Code as the implementation type.
5. Navigate to the Class Builder by double-clicking the method. You must first enter a
package before the Class Builder is displayed.
6. Insert the desired source code for the implementation between the method if_ex_businessaddin~method. and endmethod (statements that already exist) You need to use the parameters (importing and changing) as fields within the BADI. You can define additional fields you need in the coding as local data fields.
7. Save your entries and return to the Change Implementation screen.
8. Choose Activate. The enhancement’s active components are then called at runtime.
EXAMPLE (code)
Definition name BBP_EXTLOCALPO_BADI
Implementation Name ZEXTENDEDCLASSIC
Interface name IF_EX_BBP_EXTLOCALPO_BADI
Name of implementing class: ZCL_IM_EXTENDEDCLASSIC
Method DETERMINE_EXTPO
ABAP Code Determination of Control for Extended