‎2008 Apr 01 6:46 AM
Hi Experts,
Sorry for this silly question.
I have the doubt about BADI. what is the main use of BADI. Whether change the stdandard coding or Insert the custom fields to the standard screen?
In transaction SE18 and 19 what will we do?
Please clarify my basic doubt.
Thanks for all suggestions.
‎2008 Apr 01 6:50 AM
Business add-ins are SAP's new enhancement concept. There are two different views:
In the definition, you create an enhancement that is called from the application code
In the implementation, you save the code for the functions for the enhancement
You create business add-in definitions using transaction SE18. They contain the business add-in interface. In the application code the instance variable is typed according to this interface. You can create several implementations for each add-in definition.
There are two main types of BADI definitions:
Multiple use - that is, there can be several active implementations
Filter-dependent - that is, you apply a filter value to each method called (for example, a country). A different (active) implementation is then called for each value. Possible filter values are characterized by the filter type.
‎2008 Apr 01 6:50 AM
BADI is used to enhance standard transactions...
in se18 u define a BADI and in se19, u provide implementation for badi
‎2008 Apr 01 6:50 AM
Business add-ins are SAP's new enhancement concept. There are two different views:
In the definition, you create an enhancement that is called from the application code
In the implementation, you save the code for the functions for the enhancement
You create business add-in definitions using transaction SE18. They contain the business add-in interface. In the application code the instance variable is typed according to this interface. You can create several implementations for each add-in definition.
There are two main types of BADI definitions:
Multiple use - that is, there can be several active implementations
Filter-dependent - that is, you apply a filter value to each method called (for example, a country). A different (active) implementation is then called for each value. Possible filter values are characterized by the filter type.
‎2008 Apr 01 6:54 AM
Hi see this
What are BAdIs?
is an anticipated point of extension these points act like sockets and exist in the original source code
based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own
Important! There are 2 roles: Enhancement Option-provider & Implementer.
In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.
Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.
Classic BAdIs already exist since SAP Release 4.6
BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework
Classic BAdIs
To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI
BADI Class is created automatically.
The various options are described below in detail:
1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.
You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.
2. Multiple-Use
3. Filter-Dependent
Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.
Adding event handling & exception(s) is not a necessary step
Exceptions:
Events:
Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.
Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.
Save and activate the BAdI definition!
BADI Implementation
BAdI Implementation (SE19)
Save and activate the BAdI implementation!
Implementation for SAP provided BAdI
Roles: (BADI Definition & Implementation)
Developer: Enhancement (BAdI) Option-Implementer
SAP: Option-Provider
BAdI as a controlled Enhancement Option:
Option-provider defines the interface and limits the implementer to the class that the implements the BAdI
Assured that BAdI implementer can only change the parameters handed over to the BAdI by the option provider
Steps:
1. Search for the BAdI corresponding to the transaction
2. Create a custom Implementation for the BAdI by adding code in the appropriate method
3. Test that the method with custom code is invoked on executing the transaction.
Create Material using MM01. Copy from existing Material.
Select the required views.
Enter mandatory data and click on Save.
Check the Exit Name BADI_MATERIAL_CHECK. This is the BAdI we are going to implement.
Implementing the BAdI BADI_MATERIAL_CHECK
Go to SE18 & check the BAdI definition (Methods)
We will be using the CHECK_DATA method. Double Click to see the Method Parameters.
Implementing BADI
Go to SE19. Specify a name for the BAdI Implementation.
Enter the Definition Name.
Double-click the method CHECK_DATA to enter the source code
Double-click the method CHECK_DATA to enter the source code
We are only showing an message in this case; if division in Basic Data tab of Material Creation is not entered.
The structure CMARA is defined as Exporting Parameter. Data can be modified using this.
Activate the Implementation
Testing the BAdI
Testing the BAdI implementation (BADI_MATERIAL_CHECK)
MM01 / MM02 and create / change material and save. On clicking Save, our BADI will trigger.
Message is displayed (Division not entered)
BAdIs in the new Enhancement Framework (ECC 6.0)
How the new BAdIs differ from the Classic BAdI?
Good news is that basic thing about the BAdI remains the same!
Differ in the manner in which new BAdI is embedded in the container-structure of the Enhancement Framework
Better performance & Lower Memory consumption
Evaluates as much information as possible during compile time
40-600 times faster than Classic BAdIs
Internal handle-class integrated in the SAP Kernel
Provides switchable implementation(s) through use of Switch Framework
Special optimizations with GET BADI & CALL BADI (new ABAP commands)
Implementation Inheritance
Usage of old (classic) BAdIs versus New BAdIs
Two new ABAP commands for the new BAdI:
GET BADI : all active implementations are selected and the method of BAdI is called (amounts to a loop with different method calls in it)
Enhancement Spot as a container for BAdI
Enhancement Framework has containers for BAdI implementations as well
‎2008 Apr 01 7:16 AM
HI.
The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called
Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and
inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods
as a function module with the same import and export parameters and follow the simple instructions below.
Steps:
1. Execute Business Add-In(BADI) transaction SE18
2. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display
button
3. Select menu option Implementation->Create
4. Give implementation a name such as Z_HRPBSGB_HESA_NISR
5. You can now make any changes you require to the BADI within this
implementation, for example choose the Interface tab
6. Double click on the method you want to change, you can now enter
any code you require.
7. Please note to find out what import and export parameters a
method has got return the original BADI definition
(i.e. HRPBSGB_HESA_NISR) and double click on the method name
for example within HRPBSGB_HESA_NISR contract is a method
8. When changes have been made activate the implementation
http://esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
http://esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
http://esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
http://esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
http://esnips.com/doc/365d4c4d-9fcb-4189-85fd-866b7bf25257/customer-exits--badi.zip
http://esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt
Regards.
Kiran Sure