cancel
Showing results for 
Search instead for 
Did you mean: 

BADI REQUIREMENT

Former Member
0 Kudos

HELLO FRIENDS IF ANYBODY HAVE TECHNICAL DOCUMENTATION FOR BADI ENHANCEMENT PLEASE HELP ME .I NEED TO SEE THE REQUIREMENT WHEN WE CAN USE IT.

THANKS IN ADVANCE.

Accepted Solutions (0)

Answers (4)

Answers (4)

jayanthi_jayaraman
Active Contributor
0 Kudos
former_member927251
Active Contributor
0 Kudos

Hi Manish,

I have a document that will help you get started with BADI Implementation. This document will help you in getting answers to all your Wh type questions regarding BADIs.

Please reward appropriate points if it helps you.

Business Add-ins

Contents

I. Basic concept

II. Basic skills required

III. BADI in detail

a. Different views

b. Architecture

c. Technical details

i. Defining a Business Add-in

ii. Implementation of BAdi

iii. Calling BAdi in the Application

iv. Filter dependent Badi

v. Multiple use Badi

IV. Difference between different enhancement technique with BADI

V. Advantages of BADI’s

VI. Technical stuff

Basic concept

SAP has introduced new enhancement technique Business Add-ins from release 4.6A.

Business Add-in is the new enhancement technique based on ABAP Objects. BADI is an exit point in a source that allows specific industry sectors, partners, and customers to attach additional software to standard SAP source code with out modifying the original object.

The users of Business Add-ins can customize the logic according to requirement or they can use the standard logic one available.

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.

Basic skills required

• Work Experience/Knowledge on ABAP Objects (Object orientation of ABAP) is mandatory.

• Experience on SAP enhancement technique.

BADI in detail

Business Add-ins infrastructure is multi-level system landscape (SAP, partner, customer solutions, as well as country versions, and industry solutions). Definitions and implementations of Business Add-ins at each level within system infrastructure.

Different Views

a) The different views of the BADI’s are:

i. Definition view, Application Programmer can predefine the exit points in the source in which specific industry sector customers can attach additional software to standard SAP source code with out having to modify the original object.

ii. Implementation view, the users of Business Add-ins can customize the logic they need or use a standard logic if available.

Architecture

a) Architecture:

b) User defined BADI’s:

i. First define a Business Add-In, application developer creates an interface for the add-in.

ii. Enhancement management creates an adapter class that implements the interface and thus provides the interface for implementation by the customer, partner and so on.

iii. The programmer/developer creates an instance of the adapter class in the application program and calls the corresponding method at the appropriate time.

c) Standard BADI’s:

i. For Standard Business Add-ins, the interface and adapter class will be predefined by SAP. The adapter class that implements the interface and provides the interface for implementation by the customer, partner specific to business.

d) Each Business Add-in will have one interface and an adapter class that implements interface. Depending on the business requirement user will implement the interface. The generated class (Adapter class) has the following tasks.

i. Control, the adapter class calls the active implementations.

ii. Filtering, If the Add-in has to be executed under certain conditions, then the adapter class ensures that only certain implementations will be executed.

Technical Details

e) 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.

f) 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.

g) 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.

a) 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.

b) Enter the Badi name and choose create.

c) Enter the short text, choose the interface tab.

d) Double click on the interface name field. The system branches to the class builder.

e) In the class builder assign a method to the interface and define a parameter with the attributes.

f) 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.

g) 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

a) 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.

b) In the SAP menu, choose ABAP Workbench -> Utilities -> Business Add-ins or transaction code SE19.

c) Enter the implementation name and click on the create button.

d) Enter the BAdi name

e) Enter the short description for the BAdi implementation and implement the interface in the class appearing in the BAdi implementation screen.

f) 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.

g) 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.

h) Following is the code for the class ZCL_CONVERSION_BADI_IMPL method CONVERSION

Method ZIF_EX_BUSINESSADDIN~CONVERSION.

translate parameter to upper case.

endmethod.

Calling Badi in the Application

a) When we define BAdi, enhancement management generates a class that implements the interface. The application developer uses a factory method to create an instance of adapter class in the application program and calls corresponding method. The adapter class method generated by the enhancement management decide by checking the entries in the table whether one or several active implementations need to be called. If required, the implementations are subsequently executed. The application program ensures only the adapter class method is called. The application program doesn’t know which implementations are called.

b) Call the string conversion Business Add-in, the program calling the Business Add-in. Following is the ABAP source code

REPORT ZMPTEST_BADI.

  • Declaring the handler

class: cl_exithandler definition load.

  • Interface Reference

data: badi_interface type ref to ZIF_EX_BUSINESSADDIN.

  • String

data: w_str(15) type c value 'baddi test'.

*************************************************

****Start of Selection Event.....................

************************************************

start-of-selection.

call method cl_exithandler=>get_instance

changing

instance = badi_interface.

write: / 'Please click here'.

*************************************************

****At line-selection Event.....................

************************************************

at line-selection.

write: / 'original word', w_str.

if not badi_interface is initial.

call method badi_interface->conversion

changing parameter = w_str.

endif.

write: / 'Converted word', w_str.

Filter dependent Badi

a) Business Add-in definition level (for example a country, industry sector) we can have filter dependent option. If an enhancement for country specific versions then it is likely that different partners can implement this enhancement. The individual countries can create and activate their own implementation.

b) In the enhancement definition, all the methods created in the enhancement’s interface need to have filter value as their importing parameter. The application program provides the filter values for the implementation method.

c) Filter dependent BAdi is called using one filter value only, it is possible to check active implementation for the filter value using the function module SXC_EXIT_CHECK_ACTIVE.

Multiple use Badi

a) There are multiple use and single use Business Add-ins. This option can be choose at Business Add-in definition.

b) The distinction is base on the procedure or event character of an enhancement. In the first case the program waits for the enhancement to return a return code. Typical example is benefit calculation in HR depending on the implementation, alternative calculations can be executed. In case of multiple use add-ins, an event that may be interest to other components in program flow. Any number of components could use this event as a hook to hang their own additional actions on to.

c) There is no sequence control for multiple-use implementations of BAdi’s. Sequence control is technically impossible, at the time of the definition the interface does not know which implementations parameters will be change the implementations.

d) The concept of multiple use of the Business Add-in is that has been implemented once already can be implemented again by right of the software chain.

Difference between different enhancement technique with BADI

a) Difference between Business Transaction Events and BADI’s.

iii. The concept of the BADI is similar to Business Transaction Events (Open FI). BTE’s was developed specific to Financial Accounting module. But were as BADI’s was developed in generalised to all modules.

iv. BTE’s can only be used to make the program enhancements. You cannot enhance user interface with Open FI, but you can with Business Add-ins.

v. Open FI assumes that enhancement can only take place on three levels i.e. SAP- partners – customers, but in case of BAdi’s you can create and implement enhancements in as many software layers as you like.

vi. Function modules are used for program enhancements in Open FI. With BAdi’s, ABAP Objects is used to enhance programs.

b) Difference between customer exits and BAdi’s.

i. Customer exits assume a two-tiered system infrastructure (SAP - Customers). Where as in case of BAdi’s you can created and implement enhancements in as many software layers as you like.

ii. BAdi’s are considered as generalized BTE’s that can be used to bundle program, menu and screen enhancements into a single add-in. BAdi’s can be created and employed in each of the various software levels.

Advantages of BADI’s

a) This enhancement technique has the advantage of being based on a multi-level system landscape (SAP, country versions, IS solutions, partner, customer and so on).

b) We can create definitions and implementations of business add-ins at any level of the system landscape.

Technical stuff

a) Following are the Tables which are relevant to BAdi’s

i. SXS_ATTRT - BAdi Definition list

ii. V_EXT_ACT - Active implementations of an exit

iii. V_EXT_ IMP - Implementation class for an interface+filter

iv. V_EXT_M - BAdi’s with filters

b) Transaction related to BAdi’s

i. SE18 - Business Add-in builder

ii. SE19 – Implementation of Badi

iii. SE24 – Class/Interface Builder

Regards,

Amit M. Mishra

Former Member
0 Kudos
Former Member
0 Kudos