Download GuiXT / InputAssistant / Viewer / Controls Dokumentation

Transcript
Special Topics / SAPGUI Scripting und GuiXT
Save the generated VBScript in a suitable directory, e.g. "C:\guixt\sapgui scripts". The script looks as
follows:
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]").resizeWorkingPane 139,15,false
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellRow = 2
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectedRows = "2"
In your GuiXT script, use "ApplyGuiScript" and specify the name of the VBScript file:
ApplyGuiScript "C:\guiXT\sapgui scripts\select_grid_row_3.vbs"
The screen will then show up like this:
You can simplify the VBScript, if you always use the drag&drop method for testing, since the "session"
variable is then defined automatically. The following script does the job as well:
Set aw = session.activeWindow()
aw.findById("usr/cntlGRID1/shellcont/shell").selectedRows = "2"
Please observe that the row index starts with 0 in SAP GUI scripting, so the third row has index 2.
For more examples please refer to
http://www.synactive.com/docu_d/specials/guiscripting.html
© by Synactive GmbH
261-274