Liquid UI - Documentation - 18.05 View file based on data entered

18.05 View file based on data entered


Prerequisites


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.

  1. Add the required files to your scripts folder.
  2. Add an input field on the screen to enter the Material number.
  3. Add a toolbar push button to view files on click.
  4. Add a function to view the file.
  5. 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.

  1. Delete the unnecessary elements on the screen using the del command.
     
     // Delete an imahe conatiner on SAP Easy Access screen
    del('X[IMAGE_CONTAINER]');  
     
  2. 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});
     
  3. 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});
    
     
  4. 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

  1. Refresh the SAP screen. Now, enter the Material Number in the input field, and then click the View Files toolbar push button.
     
     
  2. You will see the file of the specified material number opened, as shown below.
     
     

This article is part of the Integrating HTML tutorial.


Can't find the answers you're looking for?