Skip to Content
avatar image
Former Member

How to create a loop in a script

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

** This part needs to loop N times the only change will be ***n****

session.findById("wnd[0]/usr/chk[1,***n****]").selected = true session.findById("wnd[0]/usr/chk[1,3]").setFocus session.findById("wnd[0]/tbar[1]/btn[13]").press session.findById("wnd[0]/usr/ctxtTSP01_SP0R-RQDESTL").text = "CJBIMPSV01P" session.findById("wnd[0]/usr/ctxtTSP01_SP0R-RQDESTL").caretPosition = 11 session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/tbar[1]/btn[13]").press

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers