on 12-23-2014 4:44 PM
Hi all
I am trying to create a script which will auto-populate the Validity End field in txn ME21N. But each time I get an error saying that the Control does not exist... why?
Am I missing something?
The screen looks as follows:
The script is as follows:
The script works as follows:
Thanks for your help!
Gareth
Thanks all for your help.
For some reason the original script simply started working - it recognised the control and pasted the values in.
Now, after some playing - and using the suggestions above - I have a working script that sets the validity period based on a drop-down selected by the user.
The screen looks as follows:
The user selects the appropriate validity period from the drop-down and clicks the button. The following script runs:
The steps are (simple enough):
The Javascript is as follows:
var d1 = new Date();
var d2 = new Date();
var day = d2.getDate();
if (day >= 29) {
d2.setDate(1);
d2.setMonth(d2.getMonth() + parseInt(args.months) + 1);
d2.setDate(d2.getDate() - 1);
} else {
d2.setMonth(d2.getMonth() + parseInt(args.months));
}
args.from_date = ("0" + (d1.getDate())).slice(-2) + "." + ("0" + (d1.getMonth() + 1)).slice(-2) + "." + d1.getFullYear();
args.to_date = ("0" + (d2.getDate())).slice(-2) + "." + ("0" + (d2.getMonth() + 1)).slice(-2) + "." + d2.getFullYear();
The script works as follows:
** This step is required to handle short months (less than 31 days).
Here's hoping it keeps working!
Regards
Gareth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you post the whole code of step 3.
also can you disable the tab caching and try as all the information is available on the same tab.
you definitely do not refresh screen. It seems, refresh screen is loosing the focus to the active tab, so the control is not found error is coming. But not exactly sure why it is going to 7 and 8 when you take that off.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lynch,
Just noticed few things:
* you don't need refreshscreen at step 2.
* paste value should use d instead of date
Also can you explain what tabs you have cached?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chinthan
Thanks for the response!
The picture below shows which tabs are cached:
Thanks
Gareth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.