A Step-by-Step Guide on Utilizing BADI in SAP

How To Use Badi In Sap

To begin, access transaction code SE18. Next, provide a name for the definition such as ZBADI_SPFLI and click on the create button. Proceed to the attribute tab where you can enter a brief description for the BAdI and specify its type as multiple use. Then, navigate to the interface tab and input ZIF_EX_BADI_SPFLI as the interface name before saving your changes. To initiate the class builder, double-click on the specified interface name. Within this class builder, assign a method name such as (name, level, desc).

8) Position the cursor on the method name and describe its parameters to establish the interface.

To utilize BAdI in SAP, you can use the parameter type “refe” with the field description “descI_carrid” and import the value of “spfli-carrid”.

9) Save, verify, and activate the adapter class suggested by the system.

Using Badi in my program: A guide for Indian programmers

To perform the task, follow these steps:

1. Open Tcode SE18.

2. Enter the definition name as ZBADI_SPFLI.

3. Click on the create button.

4. Select the attribute tab.

5. Choose the interface tab.

6. Specify the interface name as ZIF_EX_BADI_SPFLI and save your changes.

7. Double click on the interface name to initiate class builder.

How to Utilize BADI in SAP

1) EXECUTE tcode se18.choose menuitem create from the implementation menubar. 2) Specify aname for implementation ZIM_LINESEL 3) Specify short desc. 4) Choose interface tab. System proposes a name fo the implementation class. ZCL_IM_IMLINESEL which is already generated. 5) Specify short desc for method 6) Double click on method to insert code..(check the code in “AAA”). 7) Save , check and activate the code.

Next, create a demonstration program that utilizes the badi method.


Declare a variable named “wa_flights” of type sflight and create a table named “it_flights” consisting of multiple entries of type sflight.

You might be interested:  Sap Basis Training Institute In Hyderabad

Write the heading in a different color and format, stating “Flight information of:” followed by the carrier ID and connection ID.

Retrieve all the data from the table “SFLIGHT” and store it in the internal table “IT_FLIGHTS”. The selection is based on the condition where the value of “CARRID” matches with the provided input parameter “I_CARRID”.

Iterate through the internal table “it_flights” and assign each row to the work area “wa_flights”. Output the fields “fldate”, “planetype”, “price” in currency format, “seatsmax”, and “seatsocc”.


Declare a variable named “wa_spfli” of type “spfli”. Also, create an internal table called “it_spfli” with the structure of “spfli”, and define the primary key fields as “carrid” and “connid”.

Create an instance of the interface by declaring a variable named “exit_ref” with the data type as a reference to the ZCL_IM_IM_LINESEL class.

Begin the selection screen block with the select-options statement, specifying s_carr as the name for a range of values that will be used to filter data from the carrid field in the spfli table.

In the beginning of the selection process, retrieve all data from the SPFLI table and store it in the IT_SPFLI internal table.

In the end-of-selection loop, we iterate through the data in the it_spfli table and assign each row to a work area called wa_spfli. Then, we write out the values of certain fields from wa_spfli such as carrid, connid, cityfrom, and deptime.

Check if the value of “carrid” in the structure “wa_spfli” is not initial at line-selection. If it is not initial, create an object called “exit_ref”.

Invoke the method exit_ref1->lineselection and pass the value of wa_spfli-carrid as the input parameter i_carrid.

Find additional queries and responses along with detailed explanations on this subject at.. Generate fresh content in English for India without elaborating on the topic, solely focusing on providing original text.

How can the standard BADIs be invoked from the standard code? For example, if there is a BADI for transaction code VA01 and I have chosen to use BADI instead of a user exit, how can this be accomplished? I understand the definition and implementation of BADIs. Thank you.

  • 28 Feb 2009 11:55 am Guest it was very usefull example. I tried with this code.but i am getting error that “the type exit_ref1 cannot be converted into exit_ref.” why its getting like that.
You might be interested:  How to establish a purchasing group in SAP using Tcode

On October 23, 2009 at 4:10 am, a guest mentioned the usage of BADI and how it can be implemented using the transaction code SE19.

  • 09 Dec 2009 10:02 am Guest Can any one define BADI in Functional language about the BADI, I know this is used for enhancement of SAP functionality. but can any one provide more info about what type of enhancements can be achieved and its limitation. Dont mind SAP GURU’s but please provide inputs from Laymens idea… Can also provide inputs at [email protected] THANKS IN ADVANCE

On 11th December 2010 at 8:00 pm, a guest asked for clarification regarding the use of BADI in an example. They expressed their doubt and questioned whether the same task could be achieved without utilizing BADI. The guest requested an explanation on the purpose of using BADI in the given example.

The purpose of Badi

1. What is BAdI?

2. How does it work?

When you want to enhance an application using BAdI, you first identify the specific BAdI relevant for your requirement. Each BAdI represents a specific area where enhancements can be made. Once identified, you implement the necessary methods within that BAdI by writing your own ABAP code.

3. Benefits of using BAdIs

– Flexibility: You can easily activate or deactivate your enhancements based on business needs.

– Reusability: The same enhancement can be applied across multiple systems and scenarios.

– Collaboration: Multiple developers can work simultaneously on different aspects of an enhancement without conflicts.

How can I show a BAdI?

To begin, access the Object Navigator in SAP. Once opened, locate and select the enhancement spot that you wish to view or modify. This can be done by navigating to the Definitions tab page and searching for the specific BAdI definition you are interested in.

You might be interested:  Guide on Verifying SAP Kernel Version in Windows

Next, click on Implementations within the selected BAdI definition. A list of available implementations will appear. Double-click on the implementation that you want to work with, which will open it in a new pane for easier editing.

By following these steps carefully, users can effectively utilize BAdIs (Business Add-Ins) within SAP systems. These powerful tools allow for seamless integration and customization of functionalities based on individual requirements and preferences

Is it possible to generate personalized BAdI?

To utilize BADI in SAP, follow these steps:

1. In the attributes section, provide a brief description for the BADI and select the “Multiple Use” checkbox.

2. Navigate to the Interface tab.

3. Double-click on the interface name to access the class builder screen.

The Purpose of BAPI and BAdI in SAP

BAPIs, or Business Application Programming Interfaces, are pre-built programs that allow users to upload data into the SAP system. These programs provide a standardized way of transferring information between external systems and SAP. BAPIs offer a wide range of functionalities and can be used for various purposes such as creating sales orders, updating customer data, or posting financial transactions.

On the other hand, BADI stands for Business Add-Ins. It is a program enhancement technique provided by SAP to extend the functionality of standard programs without modifying them directly. BADI openings are predefined points in standard SAP programs where custom code can be inserted to enhance or modify their behavior according to specific business requirements.

To use BADI in SAP, you first need to identify the suitable BADI based on your requirement. This involves searching through available BADIs within the relevant program area. Once you have identified the appropriate BADI, you can proceed with coding your enhancements and plugging them into the program using transaction SE19 (BADI Builder). The custom code added through BADIs will then execute alongside the standard program logic when triggered by specific events or conditions.