Liquid UI - Documentation - 18.02 File handling

18.02 File handling


Prerequisites


Purpose

File handling refers to writing and reading the data in a file. In this article, you will learn how to open, append, and close a .txt file. However, you can implement this feature on both .csv and .xls file types.

 

User Interface

//Create this file inside your script folder for customizing the SAP Easy Access screen. SAPLSMTR_NAVIGATION.E0100.sjs

//Now, let's start adding the Liquid UI script to the above file and save it.

  1. Add the following script to the file 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.  Logon to SAP and execute the script. Initially, our .txt file will be blank, and after executing the script, the file will be opened and appended with the data, as shown in the following image.
     
     

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