cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable/manipulate the enter key in Screen Personas 3.0

Swetabh
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

ankur_jain15
Explorer
0 Kudos

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

clemens_gantert
Active Participant
0 Kudos

Hi,

small correction to Anur's response. In order to suppress the standard action that triggered the event a script must return true.

So, you have to write

return true;

at the end of your script (not return = true).

Cheers,

Clemens

ankur_jain15
Explorer
0 Kudos

Thanks Clemens

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Swetabh
Explorer
0 Kudos

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.

0 Kudos

put your script for onLoad event..

Swetabh
Explorer
0 Kudos

I tried script for onLoadEvent as well. Still through URL it is taking me to the screen which opens when I press Enter. The screen recorded in the script is not opening.