cancel
Showing results for 
Search instead for 
Did you mean: 

Script just works one time

Former Member
0 Kudos

Hi there,

I made a script button in my persona screen in transaction IW24 to set the notification time to 'this current moment' via a little bit of javascript.

The script:

var d = new Date(); args.time=d.getHours() + ':' +(d.getMinutes()<10?'0':'') d.getMinutes()':'+d.getSeconds();

Then I paste args.time to the field.

The script is ok because it does this the first time right, but when I try to do it again it fails.

Any idea why?

Accepted Solutions (0)

Answers (1)

Answers (1)

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Jasper,

This sounds like a typical case where a program keeps some session data and behaves differently the next time you open one of its transaction. To find out what is wrong with you script, I would recommend to open the transaction in Basic View after login, then get out and open it again. Did something change? Maybe a popup that comes only the first time or, a field that is prefilled? If you find this difference, you can handle it in your scripts using IF conditions.

Cheers,
Tobias.