on 2018 Oct 28 5:42 PM
This is my Script - I have two sessions opened - everytime I am ont he second window where the second session is opened and asked on which sessions is my CK11N i get seesion number 2 -
I do call the script - and fails because it goes to the first session where is my CK74N that is session Number 1
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
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[0]").text = "11/01/2018"
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[1]").text = "12/31/9999"
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[2]").text = "11/01/2018"
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[3]").text = "11/01/2018"
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[3]").setFocus
session.findById("wnd[0]/usr/sub/1/tabsREITER/tabpTERM/ssub/1/2/4/ctxt[3]").caretPosition = 10
session.findById("wnd[0]/tbar[1]/btn[0]").press
How can I make the script work on session 2 when i call the script from my program?
Thank you!
Request clarification before answering.
Hi Maria,
try it like this:
...
Set session = connection.Children(1)
...
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
45 | |
9 | |
9 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.