Liquid UI - Documentation - 4.17 Adding bell sounds for SAP messages(/alerts) using Liquid UI Server

4.17 Adding bell sounds for SAP messages(/alerts) using Liquid UI Server


Generally, in SAP, alerts will make beeping sounds – prompting users to validate the entered information. Now using the Liquid UI Server, you can add the bell sounds to your SAP notifications/messages for your Android/Scangun devices. In other words, we now support the same SAP beeping functionality in our Android App. This bell sounds functionality alerts you about error-prone entries entered in the SAP fields, thus increasing efficiency for your SAP business processes.

In Liquid UI Server, using WS scripts, you can also create different bell sounds. The different bell sounds can be added to different types of SAP messages. Such variations in bell sounds will help you to show the difference between success, error, and warning messages that appear on the status bar in your SAP.

 

//Create the following script files inside your Liquid UI Server script folder for customizing Create Sales Order: Initial Screen (SAPMV45A.E0101.sjs) to add bell sounds for your SAP messages that appear upon user action on Order Type input field
//Now let's start adding the content to the above file

  • //SAPMV45A.E0101.sjs
    // Loads belltest.sjs and stringFunctions.sjs files to Create Sales Order screen
    load('belltest.sjs');
    load('stringFunctions.sjs');
    text([0,20], "      ");
    text([0,20], "&V[G_RF_BEEP]");
    pushbutton([2,30], "Test Beeps",{"process":fn_belltest});
    
     
  • //Belltest.sjs
    // Function to check the input field value and assign bell sounds 
    function fn_belltest() {
                  onscreen 'SAPMV45A.0101'
    	set("V[G_RF_BEEP]" ,"");
    	set("z_test" ,"&F[Order Type]");
    	if(isBlank(z_test)) {
    		set("V[G_RF_BEEP]" ,"BEL BEL BEL BEL");  // Beep 4 Times
    		return("E: Enter Value");
    	} else {
    		set("V[G_RF_BEEP]" ,"BEL BEL");  // Beep 2 Times
    		return("S: Field is not blank")
    	}
    }
    
     
  • //stringFunctions.sjs
     
    // Functions to trim the blank characters from a string and pad values to a string 
    // Function prototype to trim blank characters from a string
    String.prototype.trim = function () {
       return this.replace(/^\s+|\s+$/g, "");
    }
    
    // Function to return trimmed string
    function getString(strInput) {
    	return (typeof(strInput) == 'undefined') ? "" : strInput.toString().trim();
    }
    
    // Function to check for blank string
    // Specifically used to determine if input exist in the edit field
    function isBlank(strInput) {
    	var strVal = getString(strInput);
    	var blank = strVal == "";
    	return blank;
    }
    
    // Function to pad specified character (either left or right) to a string 
    // usage: strReturn = padString('0',20,strValue,true); 	// Right Pad
    // usage: strReturn = padString('0',20,strValue);		// Left Pad
    function padString(charPad, nSize, strInput, bRight) {
      var strPad = Array(nSize+1).join(charPad);
    
      if (typeof strInput === 'undefined') 
    	return strPad;
    
      if (bRight) {
        return (strInput + strPad).substring(0, strPad.length);
      } else {
        return (strPad + strInput).slice(-strPad.length);
      }
    }
    
    // Function to get Description of a key value
    // Usage: bbObject = {'FF':'Customer Block','ZZ':'Vendor Block'};
    // Usage: bbDescription = getKeyDescription(bbObject,'FF');	// Will Return Customer Block
    function getKeyDescription(inpObject,strKey){
    	if(strKey in inpObject){
    		return inpObject[strKey];
    	}else{
    		return '';
    	}
    }
    


Configure your end-user device to connect to your Liquid UI Server

In this scenario, you will learn how to add bell sounds for your SAP notifications/messages upon user action on the Order Type input field on VA01 (Create Sales Order) screen in the Liquid UI for Android device.

  1. Initially, you need to place the required script files (SAPMV45A.E0101.sjs, Belltest.sjs, and stringFunctions.sjs) in your Liquid UI Server script directory as defined in its configuration file.
     

    Note: If you want to assign bell sounds on different fields of different SAP screens, you need to make a few changes to the script and script file names accordingly.

     
  2. Start (/Restart) your Liquid UI Server.
     
  3. Configure your Liquid UI for Android device to connect to your Liquid UI Server, as shown below:
     
     
  4. Navigate to the VA01 transaction, as shown below:
     
     
  5. In this case, if you click Test Beeps pushbutton, keeping Order Type input field empty then you will listen a long beep sound with an error message on SAP screen, as shown below:
     
     
  6. If you enter the correct value in the Order Type input field and click Test beeps. You will listen to a short beep sound while navigating to the Create Sales Order: Overview screen successfully.
     
     

    Note: Make sure to check the sound settings for notifications that appear on your Liquid UI for Android devices.

     

Can't find the answers you're looking for?