SAP Function Modules

Share |

FILE_GET_NAME_AND_LOGICAL_PATH SAP Function module - Assign physical file names and get logical path

Pattern for FM FILE_GET_NAME_AND_LOGICAL_PATH - FILE GET NAME AND LOGICAL PATH
Associated Function Group: SFIL
Released Date: 23.04.1997
CALL FUNCTION 'FILE_GET_NAME_AND_LOGICAL_PATH' "Assign physical file names and get logical path
  EXPORTING
*   client = SY-MANDT           " sy-mandt      Client for reading the file name table
    logical_filename =          " filename-fileintern  Logical file name
*   operating_system = SY-OPSYS  " sy-opsys     Operating system
*   parameter_1 = SPACE         "               Parameter for variable 
*   parameter_2 = SPACE         "               Parameter for variable 
*   parameter_3 = SPACE         "               Parameter for variable 
*   use_presentation_server = SPACE  "          Use SAPtemu operating system
*   with_file_extension = SPACE  "              Append file format to file names
*   use_buffer = SPACE          "               Buffering flag
    eleminate_blanks = 'X'      " sy-datar      Eliminate blank characters = 'X'
  IMPORTING
    file_format =               " filename-fileformat  File format
    file_name =                 "               Physical file name
    logical_path =              " filepath-pathintern  Logical path
  EXCEPTIONS
    FILE_NOT_FOUND = 1          "               Logical file name is unknown
    OPERATING_SYSTEM_NOT_FOUND = 2  "           Operating system unknown
    FILE_SYSTEM_NOT_FOUND = 3   "               File system unknown
    .  "  FILE_GET_NAME_AND_LOGICAL_PATH

SAP Documentation for FM FILE_GET_NAME_AND_LOGICAL_PATH


Functionality

R/3 applications run on various hardware platforms with various file systems. This function module allows you to use platform-independent logical file names in application programs.
It returns the physical file name, the logical path and possibly the UPLOAD and DOWNLOAD file format for a logical file name.
A logical file path must also be assigned to the logical file name to
make this possible for various platforms. The file name returned by the
function module is then derived from the physical file name for the current operating system. Place holders in the physical file name are replaced by current values at runtime.

Example

logical file name:,,MONTHLY_SALES_FILE
physical file name:,,VALUES
logical path:,,SALES_DATA_PATH

CALL FUNCTION 'FILE_GET_NAME_AND_LOGICAL_PATH'
EXPORTING
LOGICAL_FILENAME = 'MONTHLY_SALES_FILE'
PARAMETER_1      = '0796'
IMPORTING
FILE_NAME = FILE
LOGICAL_PATH = PATH.

Result:

  • FILE = VALUES0796

  • PATH = SALES_DATA_PATH



  • Notes
    The definitions required for assigning platform-independent file names are maintained client-independently with the transaction FILE. This data can be listed with the transaction SF07. Transaction SF01 defines logical file names for the current client.
    For detailed information on maintaining file names and paths, see the function module FILE_GET_NAME.
    Documentation extract taken from SAP system, Copyright (c) SAP AG






    Share |