Liquid UI - WS Reference Library



With appendfile(), you can add content to existing files of the SAP screen.

This command enables users to quickly add data to a SAP screen or record using an external source.

Note: To append data to the file, you need to open and close the file.



Note: When appending or writing to a file, the 'output' flag must be set to 'true' to open the file.

Each variable to be added is declared and then is marked true or false in the code as shown above. Those variables marked as being 'true' will be appended to the file. If a variable is marked false, it will not get appended. The supported file types are as follows:

  • .csv
  • .txt
  • .xls


  • Source - filename
  • Variable - data to append to a file


"user-selected variable":".." 

"user-selected variable":true - This option is used to enter the variable name of the values to be appended in the file. By listing the variables, the user specifies the data to be appended. Please see the examples below for demonstrations on some of the possible usages.

Option Detail

user-selected variable

  1. This option enables the user to enter the variable names of the values appended in the file .

  2. inputfield([5,5],"User Name",[5,22],{"name":"z_appenddata","size":20});
    function append()
    name1 = z_appenddata;
  3. As per the code, usernames.txt file is created and appendfile command appends the values of name1 to the file.


Appending records to a file

In the following example, we will append records to a file that we created using the file() command. Open the relevant script file and add the following lines of code:

set("V[gz_ordertype]",'&F[Order Type]');
set("V[gz_salesorg]",'&F[Sales Organization]');
set("V[gz_distchan]",'&F[Distribution Channel]');
set("V[gz_salesoff]",'&F[Sales Office]');
set("V[gz_salesgroup]",'&F[Sales Group]');

The records for Sales Organisation, Distribution Channel, Division, Sales Office, and Sales Group adds to the file 'VA01file.txt'.

Tips and Tricks

  • Increment counter using appendfile()

    To use appendfile command and increment counter in a file.


    Learn more about appendfile in practical.