Hello there,
We've been running this VBA Macro for a while then it suddenly stopped working. I tried to specify the 'session.StartTransaction' window again, but it still doesn't work as it runs into 'Error 619: Control could not be found by ID.
Here's the script:
The debug stops at this line when the error message occurs:
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press Set SapGuiAuto = GetObject("SAPGUI")
Set App = SapGuiAuto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr
session.findById("wnd[0]").maximize
session.startTransaction "/nVA02"
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").Text = Cells(i, 1)
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press
session.findById("wnd[0]/mbar/menu[1]/menu[1]/menu[0]").Select session.findById("wnd[1]/usr/cmbRV45A-S_ABGRU").Key = "11"
session.findById("wnd[1]/tbar[0]/btn[7]").press
If session.ActiveWindow.Name = "wnd[2]" Then
session.findById("wnd[2]/tbar[0]/btn[0]").press
End If
session.findById("wnd[0]/tbar[0]/btn[11]").press
Cells(i, 2) = session.findById("wnd[0]/sbar").Text
Next i
End Sub
We've been running this VBA Macro for a while then it suddenly stopped working. I tried to specify the 'session.StartTransaction' window again, but it still doesn't work as it runs into 'Error 619: Control could not be found by ID.
Here's the script:
The debug stops at this line when the error message occurs:
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press Set SapGuiAuto = GetObject("SAPGUI")
Set App = SapGuiAuto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr
session.findById("wnd[0]").maximize
session.startTransaction "/nVA02"
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").Text = Cells(i, 1)
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_MKAL").press
session.findById("wnd[0]/mbar/menu[1]/menu[1]/menu[0]").Select session.findById("wnd[1]/usr/cmbRV45A-S_ABGRU").Key = "11"
session.findById("wnd[1]/tbar[0]/btn[7]").press
If session.ActiveWindow.Name = "wnd[2]" Then
session.findById("wnd[2]/tbar[0]/btn[0]").press
End If
session.findById("wnd[0]/tbar[0]/btn[11]").press
Cells(i, 2) = session.findById("wnd[0]/sbar").Text
Next i
End Sub