Application Development 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: 

Tutorial on BAPI

Former Member
0 Kudos

Hi all,

I want to learn about BAPI's

Can anyone suggest me a good tutorial on how to create and use BAPI's.

My requiremnet is as follows:

We have to create a screen in EP where the employee or user would be applying for say a loan. This information is to be captured by the bapi. The function module of bapi should then check through infotype 45 and some others that wheather the employee is eligible for infotype, and how much amount he can apply for. He will then get a pop up message wheather he can apply or not or how much amount can be sanctioned to him.

Please suggest wheather to create a new BAPI or to use and existing one- which one in that case.

Pls give me some explanatory notes regarding importing and exporting variables through bapi and also how to pass messages which would pop up in EP when the user applies for the loan.

Thanks

Ribhu

1 ACCEPTED SOLUTION

Former Member
0 Kudos
7 REPLIES 7

Former Member
0 Kudos

Former Member
0 Kudos

Check out this thread to learn Bapi's

http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html

Regards,

Santosh

Former Member
0 Kudos

<a href="http://sapbrain.com/TUTORIALS/TECHNICAL/BAPI_tutorial.html">http://sapbrain.com/TUTORIALS/TECHNICAL/BAPI_tutorial.html</a>

Former Member
0 Kudos

Programming a BAPI consists of some tasks like:

• Defining BAPI Data structures ( using SE11 )

• Creating BAPI Function Modules (For each method)

• Defining BAPI Methods in the BOR

• Generate and release

1. Defining BAPI Data structures: This is the basic step followed while creating BAPIs. All the relevant structures that are required for BAPI have to be created using T-Code SE11. The structures can be created for Import/Tables parameters.

2. Creating BAPI Function Modules: We must create new function group for each BAPI. If the BAPIs are related then the same can be grouped under the same FUNCTION GROUP to enable the sharing of global data amongst the related BAPIs.

3. Defining BAPI Methods in the BOR: When creating a new object type in BOR (Business Object Repository), there can be two possibilities. Either it is created as a subtype of an existing business object or it is created as a new business object from scratch. Create a business object using the T-Code SWO1. The business object gets created with the standard interface that contains an Interface IFSAP, an Attribute ObjectType, and two methods namely ExistenceCheck and Display. All these cannot be changed. You can add a method to the business object. For this, we will choose from the menu path, Utillities -> API methods -> Add method. To use the business object Object type status has to be set to Implemented.

4. Generate and Release: Go to SE37 and release the API enabled Function module. In the Object created in the BOR, set the status of Object Type Component to Released.

You can then display the BAPI in the BAPI Explorer. Invoke the same using the T-code BAPI.

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

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://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec9f74ac011d1894e0000e829fbbd/frameset.htm

http://www.allsaplinks.com/bapi.html

http://www.allsaplinks.com/bapi_example.html

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

http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html

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

I hope it helps.

Best Regards,

Vibha

<b>*Please mark all the helpful answers</b>

former_member189631
Active Contributor
0 Kudos

Hi Ribhu Ahuja,

<u><b> BAPI Totorial:</b></u>

For Bapi Tutorials see these links..

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

http://www.sappoint.com/abap/bapiintro.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

There are three 2 ways to display screen for your requirement in EP.

1)<u><b>Creating a A transaction Iview</b></u>

<b>Create a ABAP Program:</b>

1)write a abap program which use your Bapi and displays the result screen.

2)Create a new TCode for Your Progam.

<b>System Creatation:</b>

1)In EP go to system admin -->system config ->systems

2)Create a system in EP for R/3 server.

3)Fill the required details such as Host id ,Client ,logontype,Transaction

4)Create alias

<b>Iview Creation:</b>

1)Create a Transaction iview for Your System.

2)Preview it.

3)Attach your code iview with any role/workset/page

4)Now Your application is ready to use

-


<b><u>2)Creating Webdynpro Application.</u></b>

1)Create a webdynpro application(Java/ABAP)which is utilize your Bapi

2)Create UI for Import and export.

3)Map the model context with your view context

4)Bind the context with Ur ui element

5)Write a code to execute your BAPI.

-


In both ways You can use BAPI.

Regards,

Ramganesh.