Liquid UI - WS Reference Library

Liquid UI: Set a Group of Variables


Prerequisites


Runs On

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


Purpose

The set command can be used to set more than one variable. If we name all the variables with a naming convention in a script, then the set command can set all the variables in one simple line. In this example, the variables all begin with “z_”. When the set command is used, the first parameter passed is “V[z_*]”. This will set all variables that begin with “z_”. This is very useful for clearing variables at the end of a script.


User Interface

Log into SAP. On the easy access screen five input fields will show. The load button will set all variables to a string “GROUP-SET”. The clear button will clear all the variables.


 


Liquid UI Script

//SAPLSMTR_NAVIGATION.E0100.sjs

// Have 5 inputfields with the variable name all starting with "z_"
inputfield([0,0],"Variable_1",[0,12],{"size":15,"name":"z_var1"});
inputfield([1,0],"Variable_2",[1,12],{"size":15,"name":"z_var2"});
inputfield([2,0],"Variable_3",[2,12],{"size":15,"name":"z_var3"});
inputfield([3,0],"Variable_4",[3,12],{"size":15,"name":"z_var4"});
inputfield([4,0],"Variable_5",[4,12],{"size":15,"name":"z_var5"});
// a button to load the variables
pushbutton([0,35],"Load Variables",{"process":loadVar});
// a button to clear the variables
pushbutton([1,35],"Clear Variables",{"process":clearVar});
// function sets variables to "GROUP-SET"
function loadVar()
{
    set("V[z_*","GROUP-SET");
}
// function clears variables
function clearVar()
{
    set("V[z_*","");
}