Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: set(), del(), pushbutton()
Purpose
Learn how to display values into the inputfields automatically from a message. We will walk you through the following steps.
- Delete an image container
- Add two inputfields
- Add a pushbutton
- Add functionality to retrieve values from a message
//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 an image container on the SAP Easy Access screen.
// Delete an Activex Controller on the screen del('X[IMAGE_CONTAINER]');
- Add two noneditable input fields Order Number and Deliv. Number.
//Creates two inputfields Order Number and Deliv. Number and are non editable inputfield([1,1],"Order Number", [1,15], {"name":"z_num0", "size":"15", "readonly":true}); inputfield([2,1],"Deliv. Number", [2,15], {"name":"z_num1", "size":"15", "readonly":true});
- Add a pushbutton on the toolbar which on click executes a testFunction process.
//Creates a toolbar pushbutton to execute a process on click pushbutton([TOOLBAR],'Execute','?',{'process':testFunction}); // Function Call
- Click Execute toolbar pushbutton that executes a function associated with it to retrieve required values from a message and assigns them to the input field.
// Extract values from an message and display them in the inputfield function testFunction(){ myarr = []; mymsg = 'The order 123021213 is saved and 542321 updated'; // Sample message var res = mymsg.match(/[-+]?[0-9]*\.?[0-9]+/g); myarr = res.toString().split(','); // Store the numbers in an array for(var idx=0;idx<myarr.length;idx++){ set('V[z_num&V[idx]]',myarr[idx]); } }
Next Steps
Translate text to another language
Learn how to translate the text entered in the inputfield using wscurl.
Learn how to translate the text entered in the inputfield using wscurl.
10 min.
This article is part of the Take a deep dive into the input field and pushbutton tutorial.