A BADI can be used any number of times where as standard enhancement techniques can be used only once. For example if we assign an enhancement to one custom project, then that enhancement cannot be assigned to any other custom projects. The implementation of the methods can be done in SE19 transaction. By default this option is checked.
|Published (Last):||3 April 2016|
|PDF File Size:||7.26 Mb|
|ePub File Size:||20.83 Mb|
|Price:||Free* [*Free Regsitration Required]|
Enhancement spots carry information about the positions at which enhancement options were created. One enhancement spot can manage several enhancement options of a Repository object. Conversely, several enhancement spots can be assigned to one enhancement option. Enter the description and if you want you can assign the new enhancement spot to a composite enhancement spot.
Composite enhancement spots are used for the semantic grouping of simple enhancement spots. You can use composite enhancement spots to combine simple enhancement spots into meaningful units. On creating the Enhancement spot, you will be directed to Enhancement Spot Editor. Click on the create BADI button. You will find certain options for the BADI definitions as below.
Usability — Multiple use — that is, there can be several active implementations Limited Filter Use — This makes the BADI 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.
The first two specifications define context-free BAdIs. Reusing Instantiation — An object plug-in that was used once in the current internal mode is reused, if it is required more than once. This context controls the instantiation.
Only one object plug-in is created for each context and implementing class. The specification takes place in the form of a reference to such an instance. As soon as there is an active BADI implementation, the fallback class is not used any longer at runtime. Now we need to add an interface to the BADI. You can either add existing interface or will be prompted to create.
First the system will ask for enhancement implementation name. Please enter a name and description. Enter the names and click ok. Next we have to implement the interface method. You will be directed to the enhancement implementation screen, shown below.
Double click on the Interface method and you will be prompted to create implementation for the method. On clicking yes, you will be navigated to editor for the method. Add the following code for showing a message or anything as per your requirement. Save it and activate.
So the BADI definition and implementation part is complete. Create or open an existing program in SE Point to the line where you need to add enhancement option. Right click and select Create Option. While creating an option either you could use an existing enh spot imp or can create a new one there. Rather than explaining the topic in an atmosphere of real business scenario, I focused on giving the reader an understanding in the concepts.
Give an Enhancement point or section name and Enhancement spot implementation name. A new line will be added to the existing code as shown below.
Then add the below code which is shown in the red box below. Now activate the program and execute it. Here we have only one implementation and that will be triggered, which shows the below message as we have written in the BADI implementation. Thank You.
Weblog Series: Three Use Cases of the Switch- and Enhancement Framework Introduction The basic idea of Enhancement Framework is to make modification-free enhancements of development objects such as programs, function modules, global classes, and Web Dynpro components. Better upgrade support Switching of enhancements with the Switch Framework Support for grouping enhancements and appropriate tool support for documentation. Think of an enhancement option as a hook where you can attach the enhancement implementation elements to. If an SAP system provides these hooks, you can add an implementation element there at later stages of development in other system, without modifying the original SAP code. This is possible because enhancement implementation elements are in a package of their own and transport objects in their own right. This way, you avoid all the trouble with modifications that stems from the fact that modifications are, from a technical point of view, part of the compilation unit they modify. These preconceived enhancement possibilities are called explicit enhancement options.
Is Kernel BADI ‘really’ faster than Classic BADI ?
These BAdi Enhancement can be done with the Interfaces which contains various methods standard or customized. This Interface name is generated automatically and can be changed as required. After defining the Interfaces developer assign some methods as required to these interfaces. These methods can have only Importing and Changing parameters Exporting Parameters are not allowed. Finally BAdi is Activated and ready to be used in program. For creating BAdi first we need to create Enhancement Spot.
Enhancement Framework and Kernel BADI