Liquid UI - WS Reference Library

Key/Value Pair Validation


Runs On

  SAP GUI Android iOS WM Web
Direct Connect          
Liquid UI Server Connect        


Perform data validation using key value pair logic.

User Interface

Log into SAP and on the SAP Easy Access Screen enter required data.

Liquid UI Script


// Data Validation Array in Key/value pairs
var requiredDataArr = [{key:'Material',value:z_material},
                        {key:'EAN Category',value:z_ean_cat},

// Function to trim blank spaces at the end of the string
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');}
// Function to check if the string value is blank
function isBlank(jvar){
    if(typeof jvar == 'string') {
        jvar = jvar.trim();
    if(typeof jvar == 'undefined') {
        jvar = '';
    return(jvar == 'undefined' || jvar == undefined || jvar == null || jvar == "" || jvar == void 0);

// Function is used to check if value is blank for a any key in the array
// If value is blank, then returns the key associated with the blank value
function isBlankKeyValue(arr){
            return arr[i].key;
    return null;    

// Function to validate required fields                            
function validateRequiredData(){
    var validateReqData = isBlankKeyValue(requiredDataArr);
        message('E: '+validateReqData+ ' is required field');
        goto SCRIPT_END;
    message('S: Validation successful');

// User Interface
inputfield([1,0], "Material", [1,25], {"size":10, "name":"z_material", "required":true});
inputfield([2,0], "Vendor", [2,25], {"size":10, "name":"z_vendor", "required":true});
inputfield([3,0], "Division", [3,25], {"size":2, "name":"z_division", "required":true});
inputfield([4,0], "EAN Category", [4,25], {"size":2, "name":"z_ean_cat", "required":true});
inputfield([5,0], "Season", [5,25], {"size":2, "name":"z_season", "required":true});
pushbutton([7,7],"@01@Read Data", "?", {"process":validateRequiredData});