Defining Logical File Names
Use
Multilevel definitions stored in tables control the conversion of a logical file name to a platform-specific physical file name.
Defining the Logical File Name
-
Logical file name
Platform-independent descriptive name of a file. The system creates it on a cross-client basis, but you can also define it client-specifically. Logical file names are used on the one hand to allow platform-independent programming, and on the other to allow validation of file names.
-
Physical file name
Platform-dependent name of a file. Precisely one physical file name is assigned to each logical file name for each syntax group of the operating system.
-
Data format
Describes the format of the data.
-
Work area
Describes the content associations of the affected file
-
Logical path
A logical path is a platform-independent descriptive name for a path. A logical file name usually has a logical path; only then can different physical paths be created for the logical file names, depending on the operating system platform.
Defining the Logical Path
-
Physical path
Platform-dependent name of a logical path for a particular syntax group. Platform-specific physical paths are specified for one or more syntax groups for a logical path.
-
Operating systems and syntax groups
All operating systems used in a system configuration are assigned to syntax groups. A syntax group is the collective term for a set of operating systems with the same file and path name syntax. The definition of a syntax group specifies, for instance, how long file names may be, and whether file name extensions are permitted or not.
The following graphic shows the relationships between the objects that determine the conversion of a logical file name into a physical file name:
Parameters in physical file names and paths
Physical file names and paths can contain the following reserved words, enclosed in angle brackets, as placeholders. The system replaces the placeholders with current values at runtime.
|
Reserved Word |
Replacement value |
|---|---|
|
<OPSYS> |
Operating system in function module parameter (see below) |
|
<INSTANCE> |
Application Instance |
|
<SYSID> |
Application name in accordance with system field SY-SYSID. |
|
<DBSYS> |
Database system in accordance with system field SY-DBSYS |
|
<SAPRL> |
Release in accordance with system field SY-SAPRL |
|
<HOST> |
Host name in accordance with system field SY-HOST |
|
<CLIENT> |
Client in accordance with system field SY-MANDT |
|
<LANGUAGE> |
Logon language in accordance with system field SY-LANGU |
|
<DATE> |
Date in accordance with system field SY-DATUM |
|
<YEAR> |
Year in accordance with system field SY-DATUM, four characters |
|
<SYEAR> |
Year in accordance with system field SY-DATUM, two characters |
|
<MONTH> |
Month in accordance with system field SY-DATUM |
|
<DAY> |
Day in accordance with system field SY-DATUM |
|
<WEEKDAY> |
Weekday in accordance with system field SY-FDAYW |
|
<TIME> |
Time in accordance with system field SY-UZEIT |
|
<STIME> |
Hour and minute in accordance with system field SY-UZEIT |
|
<HOUR> |
Hour in accordance with system field SY-UZEIT |
|
<MINUTE> |
Minute in accordance with system field SY-UZEIT |
|
<SECOND> |
Seconds in accordance with system field SY-UZEIT |
|
<PARAM_1> |
External parameter 1 passed in function call |
|
<PARAM_2> |
External parameter 2 passed in function call |
|
<PARAM_3> |
External parameter 3 passed in function call |
|
<P=name> |
Value of a profile parameter in the current system |
|
<V=name> |
Value of a variable in the variable table |
|
<F=name> |
Return value of a function module |
If you include parameters of this type in physical file or path names, you are supporting differentiated but standardized file names. For example, the parameter <TIME> can be useful if you save a logical file more than once in a short time. In addition to the system field values, you can assign names flexibly, especially if you use the last parameters listed:
-
You can use <PARAM_1> to <PARAM_3> to put values in file or path names that are passed explicitly when the application program calls the function module FILE_GET_NAME.
-
You can use <P=name> to include the values of profile parameters in the current system. If you execute the report RSPARAM, you receive a list of profile parameters and their values.
-
You can use <V=name> to include the values of variables that you defined in the control tables with transaction FILE.
-
You can use <F=name> to include return values from function modules. The name of a function module used here must have the prefix FILENAME_EXIT_. Note that the function module in the reserved word is only addressed with the part of its name after this prefix. For example, if you use the function module FILENAME_EXIT_EXAMPLE, the placeholder is <F=EXAMPLE>. The function module must have the export parameter OUTPUT, and you must not specify a reference type for it. Import parameters must have default values. Table parameters are not supported.