Dears
I am training to automate sap process to attach documents via transaction code FB03 add attachment . but when recording the steps with SAP with the VBS and taking the script in (Run VBScript) in power automate it gives me syntax error
the below is the script recorded from SAP
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]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "fb03"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/txtRF05L-BELNR").text = "1726000004"
session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").text = "1000"
session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").setFocus
session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").caretPosition = 4
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
the main issue is in the last sentence
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
i can not find why it is not accepting it