Good Morning Guys and Girls,
I'm trying to create a VBscript to automate a function in SAPGUI
But I Am unsure how to get the VBS to read the text file relace the %USERID% and then loop the script.
Currently I have :
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]/usr/radSYSCEN").select
session.findById("wnd[0]/usr/chkORG").selected = true
session.findById("wnd[0]/usr/txtUSRID").text = "%USERID%"
session.findById("wnd[0]/usr/chkORG").setFocus
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]").sendVKey 3
session.findById("wnd[0]").sendVKey 3
session.findById("wnd[0]").sendVKey 3
session.findById("wnd[0]").sendVKey 3
Which will work If I put in a single %userID%.
Any Assistance would be great.
p.s. total noob to VBS. - Only using it SAP GUI integrates with it easily.
Scripting.FileSystemObject. But would having it from a command-line argument be better? - Dai