cancel
Showing results for 
Search instead for 
Did you mean: 

In SAP Screen personas scripting how to give a beep sound when a particular screen is shown?

mrajesh1
Explorer
0 Kudos
278

I need to give a beep sound when a particular screen is shown using scripting in SAP screen personas. How to identify a screen when it gets navigated from a different screen. I have some controls on this screen but I need to provide the beep sound right when it shows up. I tried putting the beep audio call in Onbeforerefresh and Onload screen events but if I dont put a condition it beeps for all screens. If I put a condition for a control which exist in the screen it is not successful since I think the controller loads after the screen is loaded. So my plan is to find the screen number and put a condition on the screen number so that when it loads it can sound the beep. Appriciate any help on this

View Entire Topic
Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

A script giving the beep sound, assigned to the onLoad event of the screen will do the trick.

mrajesh1
Explorer
0 Kudos

Hi Tamas,

Thanks for the reply. I have multiple screens and I want the beep to come for only a particular screen. How to identify the right screen in  the script to trigger the beep sound from onload event?

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos
You just need to assign the beep script to the screen's onLoad event where you want the sound. The onLoad event is screen-specific.
mrajesh1
Explorer
0 Kudos

Hi Tamas, This is for EWM RF screens and in personas 3.0 SP18. What ever script I put in onLoad event triggers for all RF screens, I have different screens but this beep should appear only for a particular screen. The screen that I'm looking to put the beep on has a label which has ID like "wnd[0]/usr/subX:XXXXX/XXXX:0354/XXX" where 354 is my screen number where I need to have the beep. Is there a way to look for this screen number in the onLoad event to trigger the beep for this screen only?

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos
Now, this being an EWM RF flavor is an important information, and it certainly changes things. Using session.info.screenNumber in your script will give you the screen number.
mrajesh1
Explorer
0 Kudos

Thanks Tamas. The screen number is always coming as 1 if I use session.info.screenNumber. May be I need to get the subscreen number and also I see the onLoad getting triggered only once since the main screen is loaded only once and the subscreens are loaded everytime in EWM RF. I tried to put the script on onBeforeRefresh but seems its causing little bit of performce while loading each RF screen. Do you have any other suggestion on how I can run a beep audio script for a RF screen? Appriciate your help on this.

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

Not really... onBeforeRefresh indeed may cause some performance hit since it is executed every time a roundtrip takes place, but it shouldn't be too bad. I guess in this case, you could query the existence of a control that is only present on the screen when you need the sound and control it that way. Perhaps onAfterRefresh is a better event for this, you'll need to experiment what works better. I'm not aware of a way to query the subscreen number(s).

mrajesh1
Explorer
0 Kudos
Thanks for the reply Tamas. Putting it in onAfterRefresh worked for me.