on 02-27-2017 7:07 AM
Hi, I've made this script. It work great on my user, but gets an error on this line:
session.findById("wnd[0]/usr/ctxtERDAT-LOW").text = fraText;
The script will put todays date in HIGH and todays dat - 3 in LOW.
var idag = new Date();
var fra = new Date();
fra.setDate(fra.getDate()-3);
var dd = idag.getDate();
var mm = idag.getMonth()+1; //January is 0!
var yyyy = idag.getFullYear();
if(dd<10) {
dd='0'+dd;
}
if(mm<10) {
mm='0'+mm;
}
var idagText = dd +'.' + mm +'.'+yyyy;
dd=fra.getDate();
mm = fra.getMonth()+1;
var fraText = dd +'.' + mm +'.'+yyyy;
session.findById("wnd[0]/tbar[0]/okcd").text = "iw58";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/ctxtERDAT-LOW").text = fraText;
session.findById("wnd[0]/usr/ctxtERDAT-HIGH").text = idagText;
Hi, don't get any pop-ups in original screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI - when you are replying to an answer use comment on that answer, not another answer. Others are not notified about new answers, they're only notified when you comment on their answer. See this blog.
Can you navigate to IW58 transaction in Original Screen or by disabling Personas with other user login (who is getting script error in Personas) to see if there are any popup window which is blocking access to wnd[0]/usr/ctxtERDAT-LOW field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If everyone uses the same date format setting, then that cannot be the reason for the problem.
What is the error message you get?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
How can I fix that?
We all use the same format: dd.mm.yyyy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you mean that the script works for you but not for another user, this can be caused by different date format settings for the other user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.