We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, does anybody tryied connect to SAP Gui and its ScriptingEngine??? In VBScript you have to run this code
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" End If session.findById("wnd[0]").maximize
But in LuaCOM it failed at connection = application:Children(0) see the Lua code
function help(t) for k,v in pairs(t) do print(k,v) end end require("luacom") -- luacom.config.abort_on_API_error = true -- luacom.config.abort_on_error = false print("SapGuiAuto") -- local Wrp = luacom.CreateObject ("SapROTWr.SapROTWrapper") -- local SapGuiAuto = Wrp:GetROTEntry ("SAPGUI") local SapGuiAuto = luacom.GetObject("SAPGUI") if not SapGuiAuto then error("SapGuiAuto missing") else help(SapGuiAuto) end print() print("application") local application = SapGuiAuto:GetScriptingEngine() if not application then error("application failed") else help(application) end print() print("connection") local connection = application:Children(0) if not connection then error("connection failed") else help(connection) end print() print("session") local session = connection:Children(0) if not session then error("session failed") else help(session)end print() -- WScript.ConnectObject session, "on" -- WScript.ConnectObject application, "on" -- session.findById("wnd[0]").maximize print("working")
Program output:
c:\l>bin\lua.exe SAPconnect.lua SapGuiAuto USERDATA_REF userdata: 0071A000
application USERDATA_REF userdata: 01E52AC0
connection
c:\l>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
does anybody tryied connect to SAP Gui and its ScriptingEngine???
In VBScript you have to run this code
But in LuaCOM it failed at connection = application:Children(0)
see the Lua code
Program output:
c:\l>bin\lua.exe SAPconnect.lua
SapGuiAuto
USERDATA_REF userdata: 0071A000
application
USERDATA_REF userdata: 01E52AC0
connection
c:\l>
The text was updated successfully, but these errors were encountered: