Purpose With OpenFile you can open a file and then read the file with ReadFile or write records to file with AppendFile.
Examples

Further examples
OpenFile "X:\GuiXTFiles\MatDes.txt"

The file is opened in read-only mode.

OpenFile "X:\GuiXTFiles\MatDes.txt" -Output delimiter=";"

Format OpenFile "filename"

Additional options:

-Output The file content is deleted, if it exists, and you can now insert new records into the file with AppendFile.

-append The file content is not deleted and you can append new records with AppendFile.

-utf8   In conjunction with -Output: generates a UTF8-header before the first record is written

-noCache Bypasses the GuiXT file cache when the file is read. Otherwise files from the SAP MIME Repository and files with UNC notation "\\server\..." are read from GuiXT cache if the cache option is ticked in GuiXT profile.

delimiter="x" The delimiter that you specify here, e.g. ";", will be used in ReadFile and AppendFile in order to separate the fields from each other in a record. Default delimiter is the tab.

-noDelimiter No delimiter is used, i.e.  ReadFile puts the whole record into the first variable specified

Hints
  • Opening and closing a file is valid for each SAP mode separately
  • It is not necessary to open a file explicitly with OpenFile, since ReadFile or AppendFile contain an implicit open. But it is good practice to do it explicitly, since otherwise a missing CloseFile means that a ReadFile will read nothing at all the next time.
  • With OpenFile and option  -output  you can delete the file content without deleting the directory entry. RemoveFile deletes the directory entry as well.
Tips & Tricks
Components GuiXT + InputAssistant