cancel
Showing results for 
Search instead for 
Did you mean: 

Can the system make a beep/bell sound when there is an error using SAP screen personas script?

mrajesh1
Explorer
0 Kudos
471

If we have an error shown in a screen, can we allow the system to make a beep/bell sound using SAP Screen personas scripts/flavour? Any help on this is mich appreciated.

View Entire Topic
tamas_hoznek
Product and Topic Expert
Product and Topic Expert

I could imagine adding an onAfterRefresh script that determines if there is an error on the screen (by checking the status bar) and then plays the sound you want, specified by its URL. So, something like this:

function beep() { 
  var audio = new Audio( 
'https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3'); 
  audio.play(); 
} 
        
if (session.findById("wnd[0]/sbar").messageType == "E") {
    beep();
}

 

cristin_charbonneau
Participant

This is great.... the audio file could also be stored with Resources and pulled from there.

mrajesh1
Explorer
0 Kudos
Thanks Tamas. How can we do it for EWM RF MObgui if the error field name is say "wnd[0]/usr/txt/SCWM/S_RF_SCRELM-MSGTX"
cristin_charbonneau
Participant

I have just implemented this idea in a flavor for the RF transaction LM06 in Slipstream and it uses field contents and error checking. I'm sure it isn't the same in EWM but maybe it is close.  I'm using the onEnter event.

 

//SAP bin field
var binID = session.findById("wnd[0]/usr/txtLTAP-VLPLA");

//SAP verification bin field
var scanBinID = session.findById("wnd[0]/usr/txtRLMOB-CLGPLA");

//SAP values for checking
var bin = binID.text;

//values entered or scanned by the user
var scanBin = scanBinID.text;

if (scanBin !== bin) {

    scanBinID.setProperty("borderColor", "red");
    scanBinID.text = "";
    beep();
    return true;

}

function beep() {
 
  var audio = new Audio(
'/sap/bc/personas3/resource/864834621B021EDF92CF7BCB2D4AC76F');
  audio.play();
}
mrajesh1
Explorer
0 Kudos
Hi Cristin...I'm getting the beep voice when I use the link send by Tamas. I have uploaded a beep wave sound in /sap/public/XXX folder but it does not beep when I use this link like you mentioned in your comment. Is that working for you when you upload into MIME objects and use that link in flavour scripts?
cristin_charbonneau
Participant

Hi,

I should mention I am using Slipstream Engine with ECC 6 and not S/4 HANA.

The path in my comment that is "/sap/bc/personas3/resource/" is the path I will follow to reach my resource files that I upload to the Resources area of /PERSONAS/ADMIN.

If you are not on ECC 6 using Slipstream it's possible the path to your resource files is different. Hopefully Tamas can shed some light.

Kindly,

Cristin

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
The path to Resources is the same for Slipstream and webgui / mobgui. I like Cristin's solution of storing the audio file there.
mrajesh1
Explorer
0 Kudos
Yes it worked for me. Thanks a ton!