on 2015 Sep 23 10:26 PM
All:
I have a SAPScript that generates a Message Type X error when it runs. I can run the same steps outside a script and everything is fine, but when a script executes them, it fails.
The script is opening a DP forecasting log for a given day when there are multiple runs that day. It chooses the job with the latest start time.
I have copied the script below. Please excuse any typos.
Jeff
>session.findById("wnd[0]/tbar[0]/okcd").text = "/n/SAPAPO/MC8K"
>session.findById("wnd[0]").sendVKey 0
>session.findById("wnd[0]/usr/ctxtJOB1").text = strFileName
>session.findById("wnd[0]/usr/ctxtDAY1").text = strDate
>session.findById("wnd[0]/usr/ctxtDAY1").setFocus
>session.findById("wnd[0]/usr/ctxtDAY1").caretPosition = 9
>session.findById("wnd[0]/tbar[1]/btn[8]").press
>session.findById("wnd[1]/usr/lbl[12,1]").setFocus
>session.findById("wnd[1]/usr/lbl[12,1]").caretPosition = 4
>session.findById("wnd[1]").sendVKey 2
>session.findById("wnd[1]").sendVKey 33
>session.findById("wnd[1]/usr/lbl[1,3]").setFocus
>session.findById("wnd[1]/usr/lbl[1,3]").caretPosition = 6
>session.findById("wnd[1]").sendVKey 2
Request clarification before answering.
Hi Jeff,
what is the line number of the command which caused the error?
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
unfortunately I did not have access to the transaction /SAPAPO/MC8K. But you could try the following:
session.findById("wnd[0]/tbar[0]/okcd").text = "/n/SAPAPO/MC8K"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtJOB1").text = strFileName
session.findById("wnd[0]/usr/ctxtDAY1").text = strDate
'session.findById("wnd[0]/usr/ctxtDAY1").setFocus
'session.findById("wnd[0]/usr/ctxtDAY1").caretPosition = 9
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[1]/usr/lbl[12,1]").setFocus
session.findById("wnd[1]/usr/lbl[12,1]").caretPosition = 1
session.findById("wnd[1]").sendVKey 2
wscript.sleep 500
session.findById("wnd[1]").sendVKey 33
session.findById("wnd[1]/usr/lbl[1,3]").setFocus
session.findById("wnd[1]/usr/lbl[1,3]").caretPosition = 1
wscript.sleep 500
session.findById("wnd[1]").sendVKey 2
Regards,
ScriptMan
| User | Count |
|---|---|
| 12 | |
| 8 | |
| 4 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.