Liquid UI - Documentation - 18.02 File handling

18.02 File handling


Prerequisites


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

  1. 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

  1. 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.

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