Hi,
Basically, you need to install saplogon with RFCSDK.
(which includes librfc32.dll and other requried .ocx modules.)
Then, can write a code like below which does login to SAP.
vb Code:
Dim sapConn as object 'Declare variant
Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
sapConn.Connection.user = "USER"
sapConn.Connection.password = "PASSWORD"
sapConn.Connection.client = "001"
sapConn.Connection.ApplicationServer = "127.0.0.1"
sapConn.Connection.Language = "EN"
If sapConn.Connection.Logon(0, True) <> True Then 'Try Logon
msgbox "Logged on to SAP"
end if
After logging on to SAP, you can call function module in SAP.
R,
mas