Chapter 02_Business Addins (BAdi).ppt

10
IBM Global Services Business Addins (BAdi)| 8.0 2 March-2005 © 2005 IBM Corporation Business Addins (BAdi)

Transcript of Chapter 02_Business Addins (BAdi).ppt

EnhancementsDescribe Business Add-Ins and their advantages over User Exits.
Analyze definition and Implementation of BAdi through transactions SE18 and SE19.
Find Business Addins for a particular SAP transaction (if it has a BAdi).
Business Addins (BAdi)| 8.02
IBM Global Services
© 2005 IBM Corporation
What is BAdi
Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. (It has Interfaces & Methods)
Business Add-Ins should be considered generalized Business Transaction Events that can be used to bundle program, menu and screen enhancements into a single add-in.
Business Add-Ins have two parts: One is the Definition and the other is its Implementation. The definition can either be SAP provided or user may also create it.
Business Addins (BAdi)| 8.02
In the definition view, an application programmer predefines exit points in a source that allow customers to attach additional software 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 logic if one is available.
SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software. You do not have to register Business Add-Ins in SSCR.
IBM Global Services
© 2005 IBM Corporation
Uses Object oriented approach
Two parts - Definition and its Implementation - definition can either be SAP provided or user may also create it
The Business Add-In definition can be used actively by any number of implementations at the same time. I.e. it supports multiple active implementations. (e.g. Multiple use BAdis)
There can be more than one implementations of the same BADI definition, and in that case only the active implementations will be executed. You can activate or de-activate any of the implementations after creation.
In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).
Business Addins (BAdi)| 8.02
In Business Add-Ins, all the components of an enhancement option are grouped together.
Program Enhancements: Functional enhancement of the program are defined in the form of interface methods and can be used with or without Menu Enhancements or Screen Enhancements.
Menu Enhancements: Function codes can be entered for a BAdi for the corresponding menu entries in the user interface definition.
Screen Enhancements: Subscreen areas can be entered for a Business Add-In. Screen enhancements can be implemented for these in the form of subscreens.
IBM Global Services
© 2005 IBM Corporation
BAdi : Where to Find
Look for BAdi definition in IMG and in component hierarchy. (using transaction SE18)
Create own implementation of the add-in (complete coding for Methods) and activate. (using transaction SE19)
Enhancement's active components are called at runtime.
Business Addins (BAdi)| 8.02
IBM Global Services
© 2005 IBM Corporation
BAdi Definition (SE18)
In the Definition view, an application programmer predefines exit points in a source that allow customers to attach additional software to standard SAP source code without having to modify the original object.
To define a BAdi use Sap Menu -> Tools -> ABAP Workbench -> Utilities -> Business Add-Ins -> Definition (transaction SE18).
Call the interface at the appropriate point in application program, where you want to provide an exit to the customer
Customers can then select the add-in and implement it according to their needs
Business Addins (BAdi)| 8.02
When a BAdi is created following are automatically generated :
An interface with ‘IF_EX_’ inserted between the first and second characters of the BAdi name
An adapter class with ‘CL_EX_’ inserted between the first and second characters of the BAdi
name.
The Application developer creates an interface for this Add-In Enhancement management
generates an adapter class for implementing the interface. This opens a path for custom
implementations to be created by partners or customers. By instantiating the adapter class in the
application program, its corresponding methods can be used.
Multiple use : With this option you can have multiple implementations for the same BAdi.
Filter-Dependent : Business Add-Ins may be implemented depending on a specific filter value (example, country-specific versions: Distinct implementations of the BAdi can be created for each country). A filter type must be entered when defining your enhancement (a country or industry sector, for example). All methods created in the enhancement's interface have filter value 'FLT_VAL' as their import parameter. The method then selects the active implementation based on the data provided in the filter value.
Note: Normally you wont need to create BAdi definitions. You would implement BAdi definitions provided by SAP for SAP standard transactions.
IBM Global Services
© 2005 IBM Corporation
BAdi Implementation (SE19)
In the Implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.
Find the suitable Business Add-Ins present in system (Use IMG or Component hierarchy)
Use Add-Ins Documentation to understand functionality & to decide which Definition to implement.
Use SAP Menu ABAP Workbench ->Utilities -> Business Add-Ins -> Implementation (transaction SE19)
Business Addins (BAdi)| 8.02
To create an implementation, proceed as follows:
Choose ABAP Workbench -> Utilities -> Business Add-Ins (transaction SE19) from the SAP menu.
Enter a name for the implementation and choose Create.
Enter the name of the BAdi definition you want to create an implementation for in the dialog box that appears.
During implementation creation, a class for implementing the enhancement's interface is
also created.
Navigate to the Class Builder by double-clicking the method. Insert the source code between the method and endmethod statements and activate the Method.
IBM Global Services
© 2005 IBM Corporation
Find the corresponding BAdi for the SAP transaction
Create a custom Implementation for the BAdi
From the methods available in the BAdi and 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
Business Addins (BAdi)| 8.02
To find a BAdi for any SAP transaction do 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. (To do this double click on the Interface variable name and go to its definition and see the Interface it refers to).
IBM Global Services
© 2005 IBM Corporation
Summary
Business Add-Ins are a new SAP enhancement technique based on ABAP Objects.
Business Add-Ins are defined through transaction SE18 and implemented through transaction SE19.
Business Addins (BAdi)| 8.02
Which transactions are used for BAdi Definition and Implementation ?
How do you locate BAdis defined by SAP for a SAP standard transaction ?
Business Addins (BAdi)| 8.02