cancel
Showing results for 
Search instead for 
Did you mean: 

Call SAP BAPI using RFC - How to and examples

Former Member
0 Kudos

Hi,

We have built connectivity between a VB application and SAP using DCOM connector. Because its end of life is Dec 31st, 2004, we have to use a different technology.

We can't use .Net because the application is not .Net capable. JCo is out too. I believe we're left with using RFC via LIBRFC32.DLL.

My question is...Can anyone provide an example of how to do this call using standard RFC capability from VB?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

kyo_choi2
Participant
0 Kudos

There's ActiveX Controls which comes with SAPGUI installation. These use RFC dll that you are mentioning.

This will become client application but if dcom is not going to be used than this is another choice. How come you can't use dcom App to be upgraded to .net?

Former Member
0 Kudos

I have used ActiveX controls in VB 6.0, calling RFC enabled function modules from R/3 4.6C.

Its working fine.

My questions are..

1. Each time when I am executing VB application, Ihave to enter Username,Password. Even though the same is hardcoded, to start application one has to ATLEAST click on OK button.

I'll hardcode username,password in program. Application should directly start. Is it possible?

2. Is there any licensing issues for using ActiveX?

Former Member
0 Kudos

Hi All,

I am trying this first time.

I have also used mentioned SAP activex controls

now problem with me is i have tried to login to SAP in two ways

Way 1---> using following code

Dim oConnection As Object

Set SAPBAPIControl1.Connection = SAPLogonControl1.NewConnection

Set oConnection = SAPBAPIControl1.Connection

oConnection.Logon

On Error GoTo ERR

MsgBox ("I am logged in SAP")

oConnection.Logoff

now problem with this is it pops up window where in i choose system and all other details

but i dont know what to put about saprfc.ini

when i go ahead putting all details..my PC Hangs!!!!!!!!!!!!!!!!

way 2------> using help,sap,com example

i have using example given in BAPI user guide

but i am stuck with an error in code line. The line is as below

If oBAPICtrl.Connection.Logon(frmStart.hWnd, False) = False Then

it shows in debugging object reqd.

anyways ......if you know anything i can do for login please guide

dhanyawad

Niketan Maral

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you