Skip to Content

How to create a loop in a script

Dec 27, 2017 at 09:58 PM


avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers