' Lesson 3: same recording with variables instead of hard-coded values.
Dim tableName : tableName = InputBox("Table to display (e.g. T001)", "SE16N", "T001")
If tableName = "" Then WScript.Quit
Set session = GetObject("SAPGUI").GetScriptingEngine.Children(0).Children(0)
session.findById("wnd[0]/tbar[0]/okcd").text = "/nSE16N"
session.findById("wnd[0]").sendVKey 0          ' Enter
session.findById("wnd[0]/usr/ctxtGD-TAB").text = tableName
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[8]").press ' Execute (F8)
