SAP BADI enhancement implementation (Business Add-In)

The use of object orientated code within SAP has lead to a new method of enhancing standard SAP code called a Business Add-In or BADI for short. Although the implementation concept is based on classes, methods and inheritance you don't really need to understand this fully to implement a BADI. If you need to, simply think of methods as a function modules 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. Also see here for how to find an SAP BADI


Note the type attributes of this BADI as it is not a multiple use badi and has no filter option. I will go into what this means later in the multiple use badi section


3. Select menu option Implementation->Create


4. Give the implementation a name such as Z_HRPBSGB_HESA_NISR


On the next screen enter some implementation short text


5. You can now implement any ABAP code changes you require within this BADI implementation. For example choose the Interface tab to see the list of available methods you can add your code into.


6. Before we go any further press the save button and assign your new implementation to a transaport or create it as a local object.


7. Double click on the method you want to change (i.e. CONTRACT). You can now enter your ABAP code as required.


8. Please note to view the Methods import and export parameters simply select the menu option Goto->Method Definition.


The method definition will then be displayed


You could also return to the original BADI definition screen (i.e. HRPBSGB_HESA_NISR) and double click on the method name from there.


9. Once you are familiar with the parameters available you can add your own custom ABAP code. For this example we are going to update changing parameter p_contract based on importing parameter p_pernr


10. Save and activate the method


11. Then return to the main implementation screen and save and activate the overall implementation


12. Remember, as mentioned earlier this is not a multiple use BADI? This basically just means that you can only have one implementation active at any one time. For example if you now create a new implementation called somthing like Z_HRPBSGB_HESA_NISR2.


Then try activating this, you would get the error message that there are implementations already active.


Ignore the fact that it says active at the top of the screen. If you back out to the main definition screen and then choose change implementation


Select the second implementation


You will see that it is still inactive


Additional Info

If you have used a different method that has filter options, when you save you might get an error message saying 'Specify filter values'. To do this simply go to the properties tab and click on the dropdown menu options for filter values at the bottom and select the entry approriate to you.


Multiple use BADI
Basically a multiple use BADI means that you can create and activate multiple implementations of the BADI definition, which will all get called upon execution of the BADI. See here for more information on Multiuse BADI's


BADI related articles
  Find which BADI's are triggered within a SAP transaction
  Classic BADI enhancement
  Multiple Use BADI's
  Classic BADI with filter
  Migrated BADI to enhancement
  All SAP Enhancement


Related Articles

ABAP Enhancements - Modify SAP standard code using the SAP enhancement transaction CMOD
Changing SAP Data Element documentation (F1 help text)
Changing SAP Data Element field text
Find SAP BADI triggered from a SAP transaction, also find tcode from BADI name
Access values outside the SAP customer exit
SAP User Exits to Add functionality to the PBO and PAI of SAP HR infotypes
Adding fields to SAP standard Infotype
SAP User exist enhancements
SAP Field Exits implementation to update global dictionary field details
SAP filter BADI allows multiple implementations to be active
SAP migrated BADI using enhancement point implementation
Modifying Standard SAP System and help Menu options
Modifying Standard SAP System and help Menu options
SAP mutiple use BADI and enhancement spot implementation (Business Add-In)
SAP User exits to allow developers to enhance standard SAP functionality without modifiy SAP code