Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: openfile(), appendfile(), closefile()
Purpose
File handling entails the process of writing and reading data within a file. This article serves as a comprehensive guide on the procedures involved in opening, appending, and closing a text file. Moreover, it encompasses the utilization of various file formats, including.csv and.xls.
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.
Customization
- Add the following script to the file mentioned and save it.
// Open the file up
openfile("filenames.txt", {"delimiter":";", "output":true});
name1 = "John";
name2 = "Nancy";
name3 = "Alexander";
// Append to the file, set the variables you want to carry over as true
appendfile("filenames.txt", {"name1":true, "name2":true, "name3":true});
// Always close the file after
closefile("filenames.txt");
SAP Process
- Refresh the SAP screen and execute the script. Now, open the filenames.txt file, and you’ll observe the variables are appended with a delimiter, as shown below.
Note: Make sure the .txt file is empty before running the script.