SAP FILE INTERFACE NAMING



Get Example source ABAP code based on a different SAP table
  



Physical and Logical File Names
ITOC

Physical File Names
Files are addressed directly in all the statements of the file interface by using the platform-dependent physical file name by which they are known on the specific host computer. Therefore, a file cannot be opened more than once in the same program. The physical name of a file is usually made up of a path description and the file name itself. File names with blank spaces are allowed where the blanks are part of the file name. The actual notation depends on the operating system of the host computer of the current ABAP_ASINSTANCE . Any file names that do not contain an absolute path refer to the directory defined using the profile parameter DIR_HOME.
If an AS ABAP is distributed across multiple ABAP_ASINSTANCES , which themselves exist as instances on different host computers, the file interface generally accesses the individual file systems of these host computers. A shared file system can be configured for the host computers, to enable multiple ABAP_ASINSTANCES to access the same files.
If different ABAP_ASINSTANCES of an AS ABAP exist as instances on a single host computer, the profile parameter DIR_HOME has a different instance number for each ABAP_ASINSTANCES by default. To enable shared access to files, the profile parameter must be modified, or separate paths must be specified.



Latest notes:

When using physical file names, relative paths should be avoided, and only absolute paths should be specified. If used, relative paths are not resolved to absolute paths using the authorization object S_DATASET and the authorization object S_PATH (together with the database table SPTH) in automatic authorization checks and the literal character strings are compared instead.
ABAP_HINT_END

Logical File Names and Logical Paths
Logical file names and logical paths support both platform-independent programs and secure programs. Logical file names and logical paths can be created as follows and linked with the actual physical file names for each platform:
Client-independent logical file names with transaction FILE.
Client-dependent logical file names with customizing activity SF01.
The following function modules and methods are available for the use of logical file names in programs:
The FILE_GET_NAME function module can be used to determine the physical file name or directory valid for the current platform for a logical file name and use it in statements of the file interface.
Input fields for logical file names in SAP GUI are supported by the function modules FILE_LOGFILE_ALIAS_PBO, FILE_LOGFILE_ALIAS_PAI, and FILE_LOGFILE_ALIAS_F4. These modules create an appropriate list box, check the value entered, and produce a suitable input help.



Latest notes:

Logical file names are one way of validating file names and securing a program against attack by directory traversal.
For more information about logical file names and logical paths, see documentation Logical File Names in SAP Help Portal.
The class CL_FS_PATH contains methods to analyze, transform, or create file names and path entries.
ABAP_HINT_END