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

How to develop a BAPI

Former Member
0 Likes
704

Hi all,

I got a requirement to develop a BAPI and call it from Visual Basic.

Can anyone please let me know how to develop a BAPI from scratch?

With a simple example of addition of two numbers or some example which I can understand?

Please kindly help !!!

Regards,

Martin.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
621

Hi,

In VB it is possible to call "simple" RFC modules that are not BAPIs. Enhancing such a RFC toward a BAPI is - in my opinion - a lot of work and does not necessarily offer any benefits.

Since a BAPI is - more or less - simply an RFC module that has to keep certain requirements (no implicit COMMIT, return a BAPIRETx structure etc.), it should normally be enough to simply write an RFC enabled FM and call it from VB.

So my suggestion is: stick with your FM and don't bother turning it into a BAPI.

Regards, Joerg

5 REPLIES 5
Read only

Former Member
0 Likes
621

Hi,

Some of the points are.

1. Bapi is basically an RFC registered in BOR. So you have to implement ur code in a function module using se37

where in the attributes u have to choose remote call.

2. RFC's dont use exception hence dont raise any exception instead use a return parameter ( type bapireturn or bapiret2) and pass all the message and message related data ( message id, message number ) with it.

3. Implement the logic in RFC.

4. Release the FM and register it in BOR.

Now the BAPI is available for external system.

If you want detailed explanation i think its better u refer to sap documentation.

Sharath.

Read only

Former Member
0 Likes
621

Hi Sharath,

Thanks for the reply.

I developed FM which is RFC enabled.

How do i registerd the developed FM in BOR?

Please help...

Thanks in Advance.

Martin

Read only

Former Member
0 Likes
621

Hi,

Once ur bapi is done..

go to transaction SWO1 (O for Orange)

and create an object.

In the methods of the object type that is created. Create a new method, for example method called addnumber. When creating it will ask for a function module for which u can give this FM name.

After this u have to change the status from 'MODELLED' to 'IMPLEMENTED' and then release ur object.

I am sorry i only know in bits, i hope my info is of any help.

Sharath kumar.

Read only

Former Member
0 Likes
622

Hi,

In VB it is possible to call "simple" RFC modules that are not BAPIs. Enhancing such a RFC toward a BAPI is - in my opinion - a lot of work and does not necessarily offer any benefits.

Since a BAPI is - more or less - simply an RFC module that has to keep certain requirements (no implicit COMMIT, return a BAPIRETx structure etc.), it should normally be enough to simply write an RFC enabled FM and call it from VB.

So my suggestion is: stick with your FM and don't bother turning it into a BAPI.

Regards, Joerg

Read only

Former Member
0 Likes
621

hi Joerg,

We use VB for data migration for we have an interfaces being develoed in Bapi's. which we use to post data in SAP. get data from Access database and post data into SAP using BAPI's for which we developed the modules in Visual Basic.