cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas 3.0 - Javascript only works with me

Former Member
0 Kudos

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;

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi, don't get any pop-ups in original screen

Jelena
Active Contributor
0 Kudos

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.

chinthan_yajamaan
Active Contributor
0 Kudos

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?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

If everyone uses the same date format setting, then that cannot be the reason for the problem.

What is the error message you get?

Former Member
0 Kudos

Hi

How can I fix that?

We all use the same format: dd.mm.yyyy

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.