My company provides us access to S/4HANA through their corporate portal, not SAP GUI. I guess because of security reasons. Not sure how it logs us in, probably SSO or has some sort of session key in the back ground, but I tried the script below to automate some SAP processes and it does not played.
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
If I go to the script file and double click it, I get a syntax error in line 2. I think because of lack of access to SAP through the GUI it asks me for a credentials (in portal I sign in through SSO).
Is this a reason of an error?