mathiasdobel
New Member
- Joined
- Feb 16, 2018
- Messages
- 1
Hi Mr. Excel,
I am new to SAP scripting and I am facing an issue in my script.
When I run it, I sometimes get the question seen in the picture, but not always (As you can see I am just above the limit of 5000 and sometimes below it.).
My question is then if it is possible to run the script where, if I get this message, it will run all, but if I don't get this message it will still run the script.
My current code is:
Thank you in advance
I am new to SAP scripting and I am facing an issue in my script.
When I run it, I sometimes get the question seen in the picture, but not always (As you can see I am just above the limit of 5000 and sometimes below it.).
My question is then if it is possible to run the script where, if I get this message, it will run all, but if I don't get this message it will still run the script.
My current code is:
Code:
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApp = SapGuiAuto.GetScriptingEngine
Set SAPCon = SAPApp.Children(0)
Set session = SAPCon.Children(0)
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 = "/nCM01"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/txt[35,3]").Text = ""
session.findById("wnd[0]/usr/txt[35,5]").Text = "513"
session.findById("wnd[0]/usr/txt[35,7]").Text = "bj18"
session.findById("wnd[0]/usr/txt[35,7]").SetFocus
session.findById("wnd[0]/usr/txt[35,7]").caretPosition = 4
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/mbar/menu[3]/menu[0]").Select
session.findById("wnd[1]/usr/chkRC65A-HIEVER").Selected = True
session.findById("wnd[1]/usr/chkRC65A-ANVER").Selected = True
session.findById("wnd[1]/usr/ctxtRC65A-HNAME").Text = "støbemas"
session.findById("wnd[1]/usr/ctxtRC65A-HWERKS").Text = "bj18"
session.findById("wnd[1]/usr/txtRC65A-ZABIS").Text = " 180"
session.findById("wnd[1]/usr/txtRC65A-ZABIS").SetFocus
session.findById("wnd[1]/usr/txtRC65A-ZABIS").caretPosition = 9
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/mbar/menu[4]/menu[3]/menu[1]/menu[0]").Select
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").Select
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[0]").press
Thank you in advance
Last edited by a moderator: