6 Columns with Active Background
6 Columns with Active Background
Active List Item Background

24ENHANCEMENT1709 – BADI Definition and BADI Implementation

BADI (Business Add-In) is a flexible SAP enhancement technique that allows developers to modify standard SAP programs without modifying the core system. It is part of the SAP enhancement framework and is commonly used in scenarios where customers or partners need to implement their custom logic in SAP systems.

Key Concepts of BADI:

  1. BADI Definition: A BADI is essentially a predefined hook in SAP applications that allows you to insert your own custom logic. The definition of a BADI includes an interface with methods that need to be implemented to inject custom behavior. A BADI is an object-oriented alternative to the traditional user-exit approach. In SAP, it is used to define enhancement points where custom logic can be inserted.
  2. BADI Implementation: A BADI implementation is where you actually provide the logic that the system should execute at those predefined hook points. Multiple implementations can be created for a single BADI, depending on the requirement.

Tcode:

  • SE18: Used to define the BADI (Enhancement Spot and Interface).
  • SE19: Used to implement the BADI (Provide custom logic in the interface methods).

 

BADI Definition (SE18)

  1. Go to Transaction SE18:
    • Open transaction SE18 to start creating the BADI definition.
  2. Create Enhancement Spot:
    • In the SE18 screen, enter an Enhancement Spot name and click on the Create button.
    • Provide a Description and save it under a relevant package or as a local object.
  3. Create BADI Definition:
    • In the next step, under the enhancement spot, right-click on the BAdI Definitions folder and choose Create.
    • Provide the BADI Definition name and fill in the Description.
  4. Assign Interface:
    • Specify the interface for your BADI. This interface will contain methods where custom code will be added during implementation.
    • Click on the Interface tab and assign an interface or create a new one by providing a name.
  5. Define Methods:
    • Once the interface is created, you need to define the methods that will be called when the BADI is triggered.
    • Save and activate both the interface and the BADI definition.

 

BADI Implementation (SE19)

  1. Go to Transaction SE19:
    • Open transaction SE19 to implement the BADI.
  2. Select Classic BADI or New BADI:
    • In SE19, select the option Create (New BADI) for the enhancement framework.
    • If you’re working with classic BADIs, select the appropriate option.
  3. Choose the BADI Definition:
    • In the next screen, enter the name of the BADI definition that was created in SE18.
    • Click Create Implementation.
  4. Provide Implementation Details:
    • Give your implementation a name and description, then save it under a relevant package or as a local object.
  5. Implement the BADI Interface Methods:
    • The system will present you with the methods from the BADI interface.
    • Double-click on the method(s) you need to implement.
    • Enter your custom logic within the methods.
  6. Activate the BADI Implementation:
    • Once the code is added, save and activate the BADI implementation.
  7. Test the BADI:
    • After activation, test the functionality where the BADI is supposed to be triggered to ensure your custom logic works as expected.

 

These steps allow you to create a flexible and upgrade-safe enhancement in SAP using BADI.

Author : Aniket Pawar, 9373518385  

24ENHANCEMENT1709 – BADI Definition and BADI Implementation

BADI (Business Add-In) is a flexible SAP enhancement technique that allows developers to modify standard SAP programs without modifying the core system. It is part of the SAP enhancement framework and is commonly used in scenarios where customers or partners need to implement their custom logic in SAP systems.

Key Concepts of BADI:

  1. BADI Definition: A BADI is essentially a predefined hook in SAP applications that allows you to insert your own custom logic. The definition of a BADI includes an interface with methods that need to be implemented to inject custom behavior. A BADI is an object-oriented alternative to the traditional user-exit approach. In SAP, it is used to define enhancement points where custom logic can be inserted.
  2. BADI Implementation: A BADI implementation is where you actually provide the logic that the system should execute at those predefined hook points. Multiple implementations can be created for a single BADI, depending on the requirement.

Tcode:

  • SE18: Used to define the BADI (Enhancement Spot and Interface).
  • SE19: Used to implement the BADI (Provide custom logic in the interface methods).

 

BADI Definition (SE18)

  1. Go to Transaction SE18:
    • Open transaction SE18 to start creating the BADI definition.
  2. Create Enhancement Spot:
    • In the SE18 screen, enter an Enhancement Spot name and click on the Create button.
    • Provide a Description and save it under a relevant package or as a local object.
  3. Create BADI Definition:
    • In the next step, under the enhancement spot, right-click on the BAdI Definitions folder and choose Create.
    • Provide the BADI Definition name and fill in the Description.
  4. Assign Interface:
    • Specify the interface for your BADI. This interface will contain methods where custom code will be added during implementation.
    • Click on the Interface tab and assign an interface or create a new one by providing a name.
  5. Define Methods:
    • Once the interface is created, you need to define the methods that will be called when the BADI is triggered.
    • Save and activate both the interface and the BADI definition.

 

BADI Implementation (SE19)

  1. Go to Transaction SE19:
    • Open transaction SE19 to implement the BADI.
  2. Select Classic BADI or New BADI:
    • In SE19, select the option Create (New BADI) for the enhancement framework.
    • If you’re working with classic BADIs, select the appropriate option.
  3. Choose the BADI Definition:
    • In the next screen, enter the name of the BADI definition that was created in SE18.
    • Click Create Implementation.
  4. Provide Implementation Details:
    • Give your implementation a name and description, then save it under a relevant package or as a local object.
  5. Implement the BADI Interface Methods:
    • The system will present you with the methods from the BADI interface.
    • Double-click on the method(s) you need to implement.
    • Enter your custom logic within the methods.
  6. Activate the BADI Implementation:
    • Once the code is added, save and activate the BADI implementation.
  7. Test the BADI:
    • After activation, test the functionality where the BADI is supposed to be triggered to ensure your custom logic works as expected.

 

These steps allow you to create a flexible and upgrade-safe enhancement in SAP using BADI.

Author : Aniket Pawar, 9373518385