www.itp-consulting.com
Objectives
The purpose of this presentation is to: Provide an Overview of the Enhancement Framework Describe what a BADI is Classic vs. Kernel BADIs Implement a BADI (Classic) Tips & Tricks Address feedback and questions from Audience
Enhancement Framework
SAP is known for delivering business software easily adaptable by customers for their specific needs. Typically the software (for example, mySAP ERP) can be adapted by one of the following techniques:
Customizing (defining system behavior through standard SAP provided mechanism without coding), Enhancement (adding custom code at strategic hook positions provided by SAP) Modification (modifying SAP supplied code directly often called Core-Mod
.
Enhancement Framework
Let us first take a look at how the enhancement technique has evolved so far in SAP.
User-Exit is one of the very first mechanisms provided by SAP to execute custom code in between the standard SAP control flow. This is implemented as subroutine call (PERFORM xxx). A classical example for User-Exit is MV45AFZZ include in order processing module of SAP R/3. Though this include object doesnt fall under customer namespace, the object doesnt get overwritten during upgrade. Customer-Exit is better than the user-exit, in the sense that it is implemented using Function Modules and so has a well defined parameter interface. Also since the custom coding done as part of these customer-exits is located away from the original SAP code, the maintenance is easier than user-exits. The BADI-s (Business Add-Ins), as they exist in pre NW04s releases are now called old classic-BADIs. This was the first object-oriented way to enhance the ABAP system. This, to a certain extent, allows multiple implementations with limited filter support. The classic-BADIs are implemented using ABAP Objects
Enhancement Framework
So what's so cool about this new enhancement technology?
Source Code enhancement
Function Group enhancement Class enhancement Kernel-BADI Enhancement
The first three methods, viz., Source Code enhancement, Function Group enhancement, and Class enhancement are brand new ways to enhance the ABAP system. The final one Kernel-BADI is an improvement of the old classic-BADI now integrated into the Enhancement Framework. Remember that all of these techniques are considered enhancing and not modifying the system.
What is a BADI?
Business Add In
Business Add-Ins may be simply defined as an object-oriented extension of the SAP. They consist of special hooks provided by SAP core developers for incorporating customer (or company) specific logic. (BADI Definition) The process of adapting your program according to your specific scenario is known as implementation of the BADI. BADIs are based upon the concept of object-orientation. The program that incorporates the enhancement option calls a method of a generated BADI class. During the implementation procedure, the customer-specific code is written in the relevant method. The method name is specified via a BADI interface. The name of the interface is of the form IF_EX_BADI, where BADI is the name of the Business Add-In in question. For example, in the case of the HR Add-In HR_INDVAL, the involved interface is IF_EX_HR_INDVAL.
What is a BADI?
BADI Architecture in SAP
What's important about this diagram is that it reflects both the definition of a classic BADI as well as its implementation.
1.CORE SAP Application developers define an interface for the add-in 2.SAP generates an adapter class for implementing the add-in thus opening a path for customer or partner implementations
1.Customer/partner developer creates an interface of the adapter class 2.The interface definition ensures that consistent data is passed to the different add-in implementations 3.Adapter class takes care of calling and filtering out the proper
What is a BADI?
SAP guarantees upward compatibility of all BADI interfaces BADIs are not a replacement for Customer Exits (already existing exits were not converted to BADIs) Enhancements, interfaces & generated classes all lie in the SAP namespace Implementations lie in the customer/partner namespace and are transportable Standard naming conventions apply for BADIs start your implementations with Z Object oriented coding rules apply (i.e. no header lines on internal tables) If an BADI is called frequently, performance problems can occur (No longer an issue with new Kernel BADIs) Customers can create BADIs Creating a BADI within a CMOD project exit can allow multiple developers to share an exit without stepping on each others toes
Go to Maintain Transaction (TCODE- SE93). Enter the Transaction for which you want to find BADI. Click on the Display push buttons. Get the Package Name. Go to TCode: SE84->Enhancements->Business Addinns->Definition, enter the Package Name and Execute.
Here you get a list of all the Enhancement BADIs for the given package
Conclusion
I reviewed the rudiments of Business Add-Ins and their benefits for SAP users and developers. Then, I discussed in detail the steps required in implementing an add-in. I hope this presentation will provide you with some breadcrumbs to help you in adapting standard SAP programs quickly and easily using BADIs!
Further Information
Help Portal http://help.sap.com Documentation SAP Netweaver (04s) Application Platform ABAP technology ABAP Workbench Enhancement Framework SDN http://sdn.sap.com