Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: inputfield(), pushbutton(), view()
Purpose
Learn how to open a file, where the filename is entered in the input field. To explain this, we'll walk you through the following steps.
- Add the required files to your scripts folder.
- Add an input field on the screen to enter the Material number.
- Add a toolbar push button to view files on click.
- Add a function to view the file.
- Add a scenario to open a file.
User Interface
//Create this file inside your script folder for customizing the SAP Easy Access screen: SAPLSMTR_NAVIGATION.E0100.sjs.
//Now, let's add the Liquid UI script to the above file and save it.
- Delete the unnecessary elements on the screen using the del command.
// Delete an imahe conatiner on SAP Easy Access screen del('X[IMAGE_CONTAINER]');
- Add an input field with the label Material Number to open a file based on the material number entered.
// Creates an inputfield with Material Number as label name and technical name as z_matno
inputfield(["1,5"],"Material Number",[1, 31],{"name":"z_matno","size":20}); - Add a toolbar push button with the label View Files to trigger a function z_view on click.
// Creates a push button on the toolbar pushbutton([TOOLBAR],"View Files",{"process":z_view});
- Add a function z_view to view a file.
// Function to open the rtf file
function z_view() { view("File&V[z_matno].rtf"); }
SAP Process
- Refresh the SAP screen. Now, enter the Material Number in the input field, and then click the View Files toolbar push button.
- You will see the file of the specified material number opened, as shown below.
This article is part of the Integrating HTML tutorial.