on 09-01-2015 9:30 PM
I am working on Screen Personas for CN22. My requirement is to Call CN22 flavor using URL, pass network and skip few screens by calling script and finally open Network Assignment screen.
https://<server>/sap/bc/personas?~transaction=*CN22 CAUFVD-AUFNR=400000193;DYNP_OKCODE= &sap-personas-flavor=0050569160BC1ED594858D2A7FBFC0E6&sap-client=102
I am able to create a script which will take me directly to Network Assignment screen in CN22. I am able to achieve this functionality if I assign this script to a Button and press it manually. But I have to automate this process at the time of URL call.
I tried assigning this script to Screen Event "onBeforeRefresh". So the URL will pass Network and automatically go for "Enter" press (Dynp_okcode = blank for ENTER in this case).
The problem here is "Enter" press in CN22 takes me to some other screen. So My script is not getting triggered or something going wrong.
Please suggest if I can overwrite the standard SAP button or Enter in this case and can call my script by using URL.
This could be happening because of roundtrip. please check below link. Try
return = true;
at the end of your script.
Available Events for Scripting - SAP Imagineering - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
Have a script button with the script that takes you to the Network Assignment screen in CN22.
Create a new script like the following, then attach it to the OnBeforeRefresh event of the screen (or if that doesn't work, then OnLoad😞
if (triggerType !== source.EVENT_ENTER) return;
if (focused && focused.id === 'ID_1'){
session.findById("ID_button").press();
}
where ID_1 is the field where you are going to press ENTER in (or for ENTER anywhere, you don't need the IF) and ID_button is the ID of your script button.
Now hide your script button.
This should hopefully achieve what you're after - however if the transaction is coded to do something / go to another screen on the ENTER press, then this may not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for help. This is not working because (as you mentioned) the transaction is coded to display another screen on ENTER press.
Meanwhile I tried an alternate way. First Screen I am skipping using a different OK_CODE (not enter) and on next screen I have recorded a script to achieve my functionality. Now I am calling this script OnLoad. This way next screen will not be visible to me for input.
This looks like working for me. I will do some more test.
put your script for onLoad event..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.