Screen Personas 3.0 - Javascript only works with me

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;

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Feb 27, 2017 at 05:02 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 28, 2017 at 09:29 AM

    Hi

    How can I fix that?

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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 28, 2017 at 06:19 PM

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

    What is the error message you get?

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 01, 2017 at 06:28 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 06, 2017 at 04:35 PM

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

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content