BAdIs are contained in the system and are fully operational as of Release 4.6B. SAP creates Add-ins for specific programs, menus, and screen enhancements for standard R/3 applications. This Add-ins doesn’t contain any functionality. Instead you can add-on functionality onto these hooks.
Customers can find the enhancements in their system in the implementation guide and in the component hierarchy. If customer wishes to use a Business Add-in, he has to first create an implementation. The customer must implement the methods and the enhancements, and afterwards activate the implementation of the enhancement. The enhancement’s active components are then called at runtime.
Business Add-in contains an interface and other additional components such as function codes for menu enhancements. Business Add-ins also includes enhancements for screens. The enhancement, interface and generated classes are all located in the appropriate application development namespace. Business Add-in implementations are created in the respective implementation namespace.
Defining a Business Add-in
SAP provides the Badi’s where are applicable in the standard applications. Application programmer who ever wishes to have a Business Add-ins in a particular program can define the interface for an enhancement in the Business Add-in builder. Programmer has to program the interface call in the program at the appropriate place. Customers can select the add-in and implement it accordingly to their business needs.
From SAP menu, choose Tools -> ABAP Workbench -> Utilities -> Business Add-ins or transaction code SE18. The example, which is illustrated, is the string conversion in the program. And giving the provision to the users to determine themselves how their strings are to be converted. Application developer define an enhancement, consists of interface with a method with changing parameter used to pass the string.
Enter the Badi name and choose create.
And the next screen shot is here.
Save and activate the interface and navigate back to the Business Add-in definition. Now in the Badi screen, displays the method you have created for the interface. When you maintain the interface methods, corresponding executing class (Adapter class) is generated.
Save your entries and document the description of the Business Add-in. Documentation is important for the users to understand the purpose of the Add-in.
Implementation of Badi
The list of Business Add-ins available in the system can be found through SAP Reference Implementation guide (IMG) or in component hierarchy. Badi’s definition is included in IMG so that the customer/partner can create suitable, company-specific implementations.
In the SAP menu, choose ABAP Workbench -> Utilities -> Business Add-ins or transaction code SE19.
Enter the implementation name and click on the create button.
Double click on the implementation class and insert the desired source code for the implementation between the method ZIF_EX_BUSINESSADDIN~CONVERSION. And Method. In this particular example enter the statement translate parameter to upper case. Save and activate your entries and return to the change implemention screen.
Choose Activate, now you can use this implementation when the application program is executed. Several implementations may exist for a Business Add-in but that is not used in multiple use basis. However only one implementation can be activate at any one time. But in case of multiple use of the BAdi, we can have multiple implementations activate. The instance generation of the implementing class must set the attribute as public and not as private, protected or abstract. System will give dump if you do so.
Following is the code for the class ZCL_CONVERSION_BADI_IMPL method CONVERSION
Method ZIF_EX_BUSINESSADDIN~CONVERSION.
translate parameter to upper case.
endmethod.
This is how we define and implement business add in sap abap.
1 comment:
Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online for Free
SAP EP - Standard Portal Services
Portal Eventing and Navigation
Portal Look and Feel - Branding the Portal
How to Develop Portal Applications
SAP EP-Developing portal content and assigning permissions
SAP EP-Role maintenance
SAP EP-How to make Enterprise Portal highly available
SAP Material Management Introduction
SAP EP-J2EE architechture
And Many More...
Basics of Web Dynpro ABAP
ABAP Data Types and Objects
ABAP Statements
WD4A - Topics to be covered in the upcoming posts
WD4A - Introduction
WDA - SAP Logon Procedures
WD4A-Format the Values appearing on value Axis of Business Graphic
WD4A-Navigate from one view to another and back to previous view
WD4A - How to Calculate next 12 months from current month in web dynpro ABAP
WD4A - Validate Inputs in a web dynpro ABAP Application
And Many More...
Post a Comment