Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI

Former Member
0 Likes
954

Can anybody give me good documentation for BAPI

5 REPLIES 5
Read only

Former Member
0 Likes
864

Hi,

There are 5 different steps in BAPI.

Create BAPI Structure

Create BAPI Function Module or API Method.

Create BAPI object

Release BAPI Function Module.

Release BAPI object.

Step1. Creating BAPI Structure:

Go to <SE11>.

Select Data Type & Enter a name.

Click on Create.

Select Structure & hit ENTER.

Enter the fields from your database. Make sure that the first field is the Primary Key Field.

Then SAVE & ACTIVATE.

Step 2. Creating BAPI module:

Enter Transaction code <SE37>.

Before entering any thing, from the present screen that you are in, select the menu

Goto -> Function Groups -> Create Group.

Enter a name (Note: This name Must start with ZBAPI)

Let this screen be as it is and open another window and there, enter transaction code <SE80>.

Click on Inactive Objects.

Select the group that you just created and click on Activate.

Go back to <SE37> screen and enter a name and hit <ENTER>. Then enter the group name that you just created and activated.

Now click on the first Tab that says ATTRIBUTES and select the radio button that says remote-enabled module since we will be accessing this from any external system.

Then click on the second tab that says IMPORT.

Enter a PARAMETER NAME, TYPE and the structure you created in the first step. Also select the check box ‘Pa’. All remotely enabled functional modules MUST be Pa enabled, where Pa means ‘Passed by Value’ and if you don’t select ‘Pa’, then that means it will be passed by reference..

Then click on tab that says EXPORT.

Enter the following as is in the first three fields

RETURN TYPE BAPIRETURN (These 3 field values are always same)

Here also select ‘Pa’ meaning Pass by value.

Note: BAPIRETURN contains structure with message fields.

Then SAVE and ACTIVATE.

Step 3. Creating BAPI object:

Enter Tr.Code <SWO1> (Note. It is letter ‘O’ and not Zero).

Enter a name and then click on create. Enter details.

Enter Application ‘M’, if you are using standard table Mara. If you are using your own database then select ‘Z’ at the bottom.

Then hit <ENTER>.

Now we have to add ‘Methods’. High light METHODS and then select the following from the menu: Goto Utilities -> API Methods -> Add Methods.

Enter function Module name and hit <ENTER>.

Select the second FORWARD ARROW button (>)to go to next step.

Check if every thing looks ok and again click on FORWARD ARROW button (>).

Then select ‘YES’ and click on <SAVE>.

Now on a different screen goto TR.CODE <SE37>. Enter Function Module name and select from the top menu Function Module -> Release -> Release.

Goback to TR.CODE <SWO1>.

Here select the menu combination shown below in the same order.

Edit -> Change Release Status -> Object Type Component -> To Implemented.

Edit -> Change Release Status -> Object Type Component -> To Released.

Edit -> Change Release Status -> Object Type -> To Implemented.

Edit -> Change Release Status -> Object Type -> To Released.

Then click on <SAVE>.

Then click on Generate Button (4th button from left hand side looks like spinning wheel).

Then Click on the button that says ‘PROGRAM’ to see the source code.

To check if this is present in work flow goto transaction code <BAPI>.

Here it shows business object repository.

First click on the middle button and then select “ALL” and hit ENTER.

Goto tab ALPHABETICAL and look for the object that you created. This shows that the BAPI object has been created successfully.

BAPI Links

[http://www.erpgenie.com/sap/abap/bapi/example.htm]

[http://www.sap-img.com/bapi.htm]

[http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm]

[http://help.sap.com/saphelp_nw04/helpdata/en/43/b46c1e53c111d395fa00a0c94260a5/content.htm]

[http://www.sappoint.com/abap/bapiintro.pdf#search=%22BAPI(SAP)%22]

[http://www.erpgenie.com/sap/abap/bapi/index.htm]

[http://www.erpgenie.com/sap/abap/bapi/conventions.htm]

[http://www.erpgenie.com/sapgenie/docs/BAPI%20Programming.doc]

[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]

Regards

Sudheer

Read only

0 Likes
864

actually what is BAPI and what is it used for? can you please explain me in generally?

Read only

Former Member
0 Likes
864

Hi,

Please refer to the link below :

http://www.saptechnical.com/Tutorials/BAPI/CustomBAPICreation2/page1.htm

Thanks,

Sriram Ponna.

Read only

0 Likes
864

actually what is BAPI and what is it for?

Read only

Former Member
0 Likes
864

WHAT IS BAPI?

BAPIs are special, remote-enabled methods of a business object, and are implemented as RFC-enabled function modules.

BAPIs can perform various functions such as:

cretaing an object

querying the attributes of an object

changing the attributes of an object

USES OF BAPI:

You can use BAPIs for different applications. For example:

­ Internet application components: Where individual R/3 functions are implemented on the Internet or Intranet for users with no R/3 experience.

­ Building R/3 components Communication between the business objects from different R/3 components (applications).

­ VisualBasic / JAVA / C++ : External clients access R/3 data and processes through the BAPIs.

ACCESSING BAPI FROM ABAP:

You can only access BAPIs currently from an ABAP program using the relevant direct function call (local or remote). SAP is planning for a later release for all BOR business objects to be integrated in the class library of ABAP so that you will be able to access BAPIs from ABAP using ABAP-OO.

The naming convention for BAPI function modules is: BAPI__

There are no exceptions for BAPI function modules.

Success or error messages are returned by the RETURN export parameter, which depending on the SAP R/3 Release has the dictionary structure BAPIRETURN, BAPIRETURN1, BAPIRET1, BAPIRET2 or BAPIRET2_FIX. The (common) relevant fields of these structures are:

TYPE (Message type: S(uccess), E(rror), W(arning), I(nformation) ) ;

ID (message class) ; NUMBER (message number) ; MESSAGE (message text) ;

MESSAGE_V1 , MESSAGE_V2 , MESSAGE_V3 , MESSAGE_V4 (message variables)

If the transmission is successful, RETURN is either completely empty (all the fields have their initial fields for their types), or only the TYPE field has the value 'S'. Refer to the documentation to find out which applies to the BAPI you are using.

If u cant understand reply me.