Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: inputfield(), pushbutton(), set()
Purpose
Learn how to assign value into the inputfields and clear values of the inputfields. We will walk you through the following steps.
- Delete unnecessary elements.
- Add five inputfields on the SAP Easy Access screen
- Add two pushbuttons to load variables and clear variables
- Add a function to load values into the inputfields
- Add a function to clear all the values in the inputfields
//Create this file inside your script folder for customizing SAP Easy Access screen SAPLSMTR_NAVIGATION.E0100.sjs
//Now let's start adding the content to the above file
- Delete the image container on the SAP Easy Access screen.
del("X[IMAGE_CONTAINER]");
- Add five inputfields on the screen sequentially as shown below:
// Creates five inputfields with technical names as z_var1, z_var2, etc. 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"});
- Add two pushbuttons Load Variables and Clear Variables on the screen as shown below:
// Creates a pushbutton that runs a loadVar function to load variable values pushbutton([0,35],"Load Variables",{"process":loadVar});
// Creates a pushbutton that runs a clearVar function to load variable values pushbutton([1,35],"Clear Variables",{"process":clearVar});
- Add a function (loadVar) to set all the variable inputfields with GROUP-SET value.
// Creates a function loadVar that sets variables to "GROUP-SET" function loadVar()
{
set("V[z_*","GROUP-SET");
}
- Add a function clearVar to clear all the inputfields with null values.
// Creates a function that assigns null values to all the variables with technical name starting with z_
function clearVar()
{
set("V[z_*","");
}
- Click the Load Variables pushbutton to load values into the inputfields.
- Click the Clear Variables pushbutton to load values into the inputfields.
Next Steps
Assign values into SAP table from Liquid UI table
Learn how to assign values into the SAP table using variables
Learn how to assign values into the SAP table using variables
10 min.
This article is part of the Liquid UI Variables tutorial.