Skip to Content
author's profile photo Former Member
Former Member

BAPI & BADI

Hi Buddies,

can anybody help me understanding BAPI functionality and BADI functionality.

and there differences.

Thanks

Soni

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 04:59 AM

    Hi,

    Business Add-Ins

    Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

    As with customer exits (SMOD/CMOD Page 40), two different views are available:

    ? In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

    ? In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

    In contrast to customer exits, Business Add-Ins no longer assume a two-system infrastructure (SAP and customers), but instead allow for multiple levels of software development (by SAP, partners, and customers, and as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

    SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

    The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time.

    In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example). All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard.

    A single Business Add-In contains all of the interfaces necessary to implement a specific task. In Release 4.6A, program and menu enhancements can be made with Business Add-Ins. The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects

    DEFINING THE BADI

    1) execute Tcode SE18.

    2) Specify a definition Name : ZBADI_SPFLI

    3) Press create

    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :

    multiple use.

    5) Choose the interface tab

    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.

    7) Dbl clk on interface name to start class builder . specify a method name (name,

    level, desc).

    Method level desc

    Linese;ection instance methos some desc

    8) place the cursor on the method name desc its parameters to define the interface.

    Parameter type refe field desc

    I_carrid import spfli-carrid some

    I_connid import spefi-connid some

    9) save , check and activate?adapter class proposed by system is

    ZCL_IM_IM_LINESEL is genereated.

    IMPLEMENTATION OF BADI DEFINITION

    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 generarted.

    5) Specify short desc for method

    6) Dbl clk on method to insert code..(check the code in ?AAA?).

    7) Save , check and activate the code.

    Some useful URL

    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt

    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf

    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc

    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc

    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf

    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm

    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm

    Now write a sample program to use this badi method..

    Look for ?BBB? sample program.

    ?AAA?

    data : wa_flights type sflight,

    it_flights type table of sflight.

    format color col_heading.

    write:/ 'Flight info of:', i_carrid, i_connid.

    format color col_normal.

    select * from sflight

    into corresponding fields of table it_flights

    where carrid = i_carrid

    and connid = i_connid.

    loop at it_flights into wa_flights.

    write:/ wa_flights-fldate,

    wa_flights-planetype,

    wa_flights-price currency wa_flights-currency,

    wa_flights-seatsmax,

    wa_flights-seatsocc.

    endloop.

    ?BBB?

    &----


    *& Report ZBADI_TEST *

    *& *

    &----


    REPORT ZBADI_TEST .

    tables: spfli.

    data: wa_spfli type spfli,

    it_spfli type table of spfli with key carrid connid.

    *Initialise the object of the interface.

    data: exit_ref type ref to ZCL_IM_IM_LINESEL,

    exit_ref1 type ref to ZIF_EX_BADISPFLI1.

    selection-screen begin of block b1.

    select-options: s_carr for spfli-carrid.

    selection-screen end of block b1.

    start-of-selection.

    select * from spfli into corresponding fields of table it_spfli

    where carrid in s_carr.

    end-of-selection.

    loop at it_spfli into wa_spfli.

    write:/ wa_spfli-carrid,

    wa_spfli-connid,

    wa_spfli-cityfrom,

    wa_spfli-deptime,

    wa_spfli-arrtime.

    hide: wa_spfli-carrid, wa_spfli-connid.

    endloop.

    at line-selection.

    check not wa_spfli-carrid is initial.

    create object exit_ref.

    exit_ref1 = exit_ref.

    call method exit_ref1->lineselection

    EXPORTING

    i_carrid = wa_spfli-carrid

    i_connid = wa_spfli-connid.

    clear wa_spfli.

    BAPI stands for Business API(Application Program Interface).

    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..

    You can make your function module remotely enabled in attributes of Function module but

    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).

    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.

    The following standardized BAPIs are provided:

    Reading instances of SAP business objects

    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.

    The BAPI GetList() is a class method.

    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type

    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.

    Create( ) and CreateFromData! ( )

    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.

    Change( )

    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.

    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.

    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.

    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.

    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.

    BAPI-step by step

    http://www.sapgenie.com/abap/bapi/example.htm

    just refer to the link below

    http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g

    list of all bapis

    http://www.planetsap.com/LIST_ALL_BAPIs.htm

    for BAPI's

    http://www.sappoint.com/abap/bapiintro.pdf

    http://www.sappoint.com/abap/bapiprg.pdf

    http://www.sappoint.com/abap/bapiactx.pdf

    http://www.sappoint.com/abap/bapilst.pdf

    http://www.sappoint.com/abap/bapiexer.pdf

    http://service.sap.com/ale

    http://service.sap.com/bapi

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf

    http://www.planetsap.com/Bapi_main_page.htm

    http://www.topxml.com/sap/sap_idoc_xml.asp

    http://www.sapdevelopment.co.uk/

    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf

    Benefits of BAPICan be used in diverse languages / Development Environments(ABAP, Visual Basic, Java, C++, etc.)Can be called from diverse platforms (COM, CORBA, Unix)Reduced development costReduced maintenance cost?Best-of-both-worlds? approachRich functionality of the R/3 systemUser-specific front-ends

    SAP transactionsBAPI Business Object Browser (BAPIs only)SWO1 Business Object Builder (all objects)SWO2 Business Object Browser (all objects)SE11 Data DictionarySE37 Function Builder

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 01, 2008 at 11:19 PM

    Hi Soni,

    Just search the forum. Lots of thread and links on the same topic.

    Also there is explaination in wiki.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 01, 2008 at 11:45 PM

    Hello Soni,

    Although the name is similar, the differences of BAPI and BAdI is huge.

    BAPI (Business Application Interface) transfers data from outside SAP into SAP. BAPIs are Function

    Modules.

    BAdI (Business Add-In) are Enhancement Objects which are built-in into SAP Objects. BAdI is one technique for User Exits (besides Customer Functions, Subroutines and OPEN FI). BAdI manipulates data.

    I hope I could explain the main difference. For detailed information please go to SAP Help Portal.

    Good luck,

    Heinz

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 03:31 AM

    BADI : (Business Addins)

    1. BADI is a new concept and are also known as Business Addins

    2. BADI is a also used to ehnacnce existing functioanlity of the transaction. It is aobject-oriented technology. We write our code in the method.

    3. SE18 and SE19 are the two transactions which are used to make a BADI.

    4. Mostly BADIS are not made but selected from what is given in SAP. These are similar to user-exits but are method based. One can say it is an extension to the user exits. If one has an issue in which one has to change so existing things in SAP then BADI can be used. First one has to define it and then find out a suitable implementation for the issue concerned

    5. BADI's are oops based.

    BAPIs (Business Application Programming Interfaces),

    BAPI basically works like a function module. the major difference being that it can work like a RFC. That means it can work from system to system. Mostly the name of a BAPI can be seen in se37 by just giving BAPI_* F4 and you will see a lot of BAPIS.

    SAP created the Business Framework to allow the technical integration and exchange of business data among SAP components and between SAP and non-SAP components. Important components of the Business Framework are the Business Application Programming Interfaces (BAPIs), which represent visible interfaces at the component boundaries and whose properties serve to integrate these components.

    The integration can include both components within a local network and components that are connected with one another through the Internet.

    BAPIs allow integration at the business level, not the technical level. This provides for greater stability in the link, and independence from the underlying communication technology.

    You can get all the standard SAP BAPI functions with the transactions code 'BAPI'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.