Hi,
I want to open sap and launch sap transaction using vba from excel.
Until now I managed only to logon, but i can't open a sap session and launch a transaction. Please, give me some ideeas. Here is the code until now:
Dim sapConn As Object 'Declare connection object
Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
'Specify user
sapConn.Connection.user = "xxxxx"
'Then password
sapConn.Connection.Password = "xxxxxx"
'Client
sapConn.Connection.client = "600"
'Target server address
sapConn.Connection.ApplicationServer = "172.19.64.5"
'Language code
sapConn.Connection.Language = "EN"
If sapConn.Connection.logon(0, True) <> True Then
MsgBox "Cannot Log on to SAP" 'Issue message if cannot logon
Else
MsgBox "Logged on to SAP!"
thank you for your time!
I want to open sap and launch sap transaction using vba from excel.
Until now I managed only to logon, but i can't open a sap session and launch a transaction. Please, give me some ideeas. Here is the code until now:
Dim sapConn As Object 'Declare connection object
Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
'Specify user
sapConn.Connection.user = "xxxxx"
'Then password
sapConn.Connection.Password = "xxxxxx"
'Client
sapConn.Connection.client = "600"
'Target server address
sapConn.Connection.ApplicationServer = "172.19.64.5"
'Language code
sapConn.Connection.Language = "EN"
If sapConn.Connection.logon(0, True) <> True Then
MsgBox "Cannot Log on to SAP" 'Issue message if cannot logon
Else
MsgBox "Logged on to SAP!"
thank you for your time!