Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all articles
Browse latest Browse all 325

Macro said I am log in SAP, but actually not the case...

$
0
0

Hi,

 

I have this macro that work and tell me that i sucessfuly log on in SAP.

 

Dim sapConn As Object 'Declare connection object 'added Set objshell = CreateObject("WScript.Shell") Set objapp = objshell.Exec(Environ("PROGRAMFILES") & "\SAP\FrontEnd\SAPgui\saplogon.exe") Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object 'Specify user sapConn.Connection.User = "Flie" 'Then password sapConn.Connection.Password = "Mz123" 'Client sapConn.Connection.Client = "100" 'added sapConn.Connection.System = "PVE" 'Target server address sapConn.Connection.ApplicationServer = "10.169.555.233" '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!" End If

When it open SAP...I still need to click logon and input my password and user name..

 

any clue? It seem there is no conenction between the two


Viewing all articles
Browse latest Browse all 325

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>