Using Logical File Names in Programs
To use logical file names in one of your application programs, perform the following steps:
...
1. Use transaction FILE to check whether definitions are stored in the system for the logical file names. These definitions convert the logical file names to platform-specific file names. If necessary, create new definitions with transaction FILE.
For more information, see the Implementation Guide under SAP NetWeaver → Application Server → System Administration ® Platform-Independent File Names.
2. Ensure that the physical paths specified in these definitions exist in the runtime environment file system. If necessary, create the required directories, or contact your system administration.
3. Test the file name conversion by calling the function module in the individual test of transaction SE37.

When performing the individual test in transaction SE37, set the Uppercase/Lowercase indicator, since the field OPERATING_SYSTEM, in particular, is case-sensitive. Correspondingly, you need to specify the logical file name entirely in uppercase characters.
4. Add a call of the function module to your program. To do this, you can choose Edit → Pattern in the ABAP Editor.
For more information about saving files on the application and presentation servers, see Using Files in the ABAP User Guide.

Note that creating a syntactically correct logical file name does not in itself guarantee the successful saving of a file. The physical path must also actually exist in the file system at runtime.

Do not allow the user to enter any available
logical file name on the user interface during execution. Store the logical
file name in the program logic, or follow the instructions for using logical
file names in the user interface. For more information, see
Secure Programming - ABAP.