Saturday, 14 March 2015

                                                                   BAPI


What is BAPI?

A Business Application Programming Interface is a precisely defined interface providing access process and data in Business Applications Systems Such as SAP R/3.


Benefits of BAPI:
Can be used in diverse languages / Development Environments(ABAP, Visual Basic, Java, C++, etc.)
Can be called from diverse platforms (COM, CORBA, Unix)
Reduced development cost
Reduced maintenance cost
“Best-of-both-worlds” approach
Rich functionality of the R/3 system

User-specific front-ends.

Return Code Information:
Usually a structure, sometimes a table
Data dictionary structures used
BAPIRETURN
BAPIRETURN1
BAPIRET1
BAPIRET2.

BAPI Return Structure
  • Type Message type
  • blank or "S"=Success.
  • "E"=Error.
  • "W"=Warning.
  • "I"=Information.
  • "A"=Abort.
  • Message                        Message text.
  •  Log_No                         Application Log Number.
  • Log_Msg_No                Application Log Message Serial Number.
  • Message_V1 -V4         Message variables.


SAP transactions
  • BAPI Business Object Browser (BAPIs only).
  • SWO1 Business Object Builder (all objects).
  • SWO2 Business Object Browser (all objects).
  • SE11 Data Dictionary.
  • SE37 Function Builder.



               
BAPI step by step procedure
STEP 1 -Define Structure for the BAPI
In this step structures for the parameters and tables of the function module used for the BAPI are defined.
USE TCODE: SE11then Data type -> Structure
Note: You will have to define a structure for every parameter in the BAPI. You cannot use the same structures used in existing applications because BAPI structures are frozen when BAPIs are released and then there are restrictions on changing them.

Define the structure Name: Ex: ZVEND.


STEP 2-Write Function Module.
  • Each BAPI must have its own function group.
  • Under the attributes tab remember to select Processing Type Remote Enabled module, otherwise the function module cannot be invoked via RFC and used as a BAPI .
  • Import/Export parameters can only be BY VALUE for an RFC enabled function module.




STEP 3 -Create the API Method Using the BAPI WIZARD.
  • BAPI wizard is used to expose the remote function module as a BAPI.
  • Wizard will generate some additional code, so the function module is a valid method of the BOR. This allows the BAPI to be called as a workflow method in addition to be called by an outside program.
  • Each function module corresponds to a method in the BOR.

Go to the Business Object Builder SWO1.

You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch.


Note that when you create the business object a standard interface, an attribute ObjectType and the methods ExistenceCheck and Display are automatically generated. These cannot be changed!



STEP 4 –Final Steps.















1 comment:

  1. SAP is one of the customer relationship management software and it support all end to end customer related process. To know more details about SAP modules please refer the following site.
    Regards..
    SAP Training in Chennai

    ReplyDelete