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

Connecting SAP using Visual Basic 6.0

Former Member
0 Likes
1,012

How to connect SAP using SAP System user through Visual Basic 6.0 and call RFC

I am connecting via SAP GUI user login. for that i am using following code (Using VB 6.0)

8----


Set ctlLogon = CreateObject("SAP.LogonControl.1")

Set oConnection = ctlLogon.NewConnection

oConnection.User = oRst.Fields(1).Value '"exe8698" 'Trim(oRst("USER_NAME"))

oConnection.Client = oRst.Fields(3).Value '"239" ' Trim(oRst("APP_CLIENT"))

oConnection.Password = oRst.Fields(2).Value '"globegm1" ' Trim(oRst("USER_PASS"))

oConnection.ApplicationServer = oRst.Fields(4).Value '"10.40.0.1" 'Trim(oRst("APP_SERVER"))

oConnection.Language = oRst.Fields(5).Value '"EN" 'Trim(oRst("APP_LANG"))

oConnection.SystemNumber = oRst.Fields(6).Value '"00" ' Trim(oRst("APP_NO"))

'logon to RFC Connection - Silent

booReturn = oConnection.Logon(0, True)

If booReturn <> True Then

gSIILConnect = False

Else

gSIILConnect = True

End If

*----


but i dont know how to use System user from vb

Can anybody please guide me

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
679

Hi,

First of all you need a connector to connect to SAP System like for Java there is Jco connector. After successful connection you can call RFCs and BAPIs.

Thanks,

Muhammad Usman

1 REPLY 1
Read only

Former Member
0 Likes
680

Hi,

First of all you need a connector to connect to SAP System like for Java there is Jco connector. After successful connection you can call RFCs and BAPIs.

Thanks,

Muhammad Usman