Liquid UI - WS Reference Library

Pass values to function


Prerequisites


Purpose

The “using” option is very useful when calling processes. It allows variables to be passed to functions. In this example, we will have an input field for the user to enter a name. When then click on the pushbutton, the name will be displayed in a message to the screen.


User Interface

Log into SAP. On the Easy Access screen there will be an input field with a pushbutton next to it. Enter your name and click this pushbutton and a welcome message will appear at the bottom of the screen.



Liquid UI Script

//SAPLSMTR_NAVIGATION.E0100.sjs

// Create an inputfield to retrieve the name of the User
inputfield([0,0],"Your Name:",[0,12],{"size":20,"name":"z_name"});
// a button to run the function to display the message
// use "using" to pass the variable for the name
pushbutton([0,35],"Enter",{"process":displayMessage,"using":{"name":"&V[z_name]"}});
// function displays the welcome message
function displayMessage(param)
{
    message("S:Welcome to the Easy Access Screen, "+param.name+"!")
}

Was this information helpful? Send Feedback