Hi, I'm new to the SAP GUI scripting and I'd like to understand some line of codes.
The code works, but I'm not sure what it does. Could someone explain line by line?
Also, WScript seems to never be an object, so I'm not sure of the purpose of those last lines.
Thanks!
Code:
Set SAPGUIAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object
Set SAPApp = SAPGUIAuto.GetScriptingEngine 'Get the currently running SAP GUI
Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
Set session = SAPCon.Children(0) 'Get the first session (window) on that connection
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject Application, "on"
End If
The code works, but I'm not sure what it does. Could someone explain line by line?
Also, WScript seems to never be an object, so I'm not sure of the purpose of those last lines.
Thanks!
Last edited: