Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: load()
Purpose
In this article, you will learn how to load external files into the SAP transaction using the load command. Once the file is loaded, anything included in the file will be available for global use in WS scripts.
User Interface
//Create these files inside your script folder for customizing the SAP Easy Access screen. SAPLSMTR_NAVIGATION.E0100.sjs and functions.sjs
//Now, let's start adding the script to the above files and save them.
- Log into SAP. On the SAP Easy Access screen, delete the unnecessary screen elements using del().
// Deletes an image container on SAP Easy Access screen del('X[IMAGE_CONTAINER]');
- Using the load(), load the external file functions.sjs in the SAP.
// Load the file functions.sjs
load("functions.sjs"); - Using createText(), call the function createTexts, defined in the other files.
// Run the function that is deined in the other file. createTexts();
- Add the following script to the functions.sjs file and save it.
//Create a function createTexts()
function createTexts() { println("in here"); for(var i=0; i<1; i++)
{ text([0+i,0], "Liquid UI is the programming platform for SAP ERP."); text([1+i,0], "With Liquid UI WS, you can simplify SAP and streamline SAP processes as per your business needs.\n"); text([3+i,0], "The load command is used to load content of an external file."); text([4+i,0], "Once the file is loaded, then its content will be available for global use in WS scripts.");
}
}
SAP Process
- Log into SAP. On the SAP Easy Access screen, you will see a bunch of text displayed based on the defined function, as shown in the image below.