I am using SAP GUI 7.50 and running the script from Excel. I recorded a script for transaction ZC9_SE16_MAT table MARA. I want to select multiple material numbers, but pressing the button with the recorded script is ignored (does not open new window). The button is marked in the image. How can I open that window?
' Connect to SAP
Set SapGuiAuto = GetObject("SAPGUISERVER")
Set SAPApp = SapGuiAuto.GetScriptingEngine
If Not IsObject(Connection) Then
Set Connection = SAPApp.Children(0)
End If
If Not IsObject(session) Then
Set session = Connection.Children(0)
End If
If Not IsObject(Connection) Then
Set Connection = SAPApp.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
' Start Transaction
session.StartTransaction "ZC9_SE16N_MAT"
' Confirm Mara
session.findById("wnd[0]").sendVKey 8
' Press the button
session.findById("wnd[0]/usr/tblSAPLZ_C9_SE16NSELFIELDS_TC/btnPUSH[4,1]").SetFocus
' Bellow line does not work
session.findById("wnd[0]/usr/tblSAPLZ_C9_SE16NSELFIELDS_TC/btnPUSH[4,1]").press
The last line does not work.
I saw similar problem in this post, but the answer did not work for me.