SAP FILE_GET_NAME_USING_PATH Function Module for Generate a complete file name with file name and logical path
FILE_GET_NAME_USING_PATH is a standard file get name using path SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Generate a complete file name with file name and logical path processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for file get name using path FM, simply by entering the name FILE_GET_NAME_USING_PATH into the relevant SAP transaction such as SE37 or SE38.
Function Group: SFIL
Program Name: SAPLSFIL
Main Program: SAPLSFIL
Appliation area: S
Release date: 23-Apr-1997
Mode(Normal, Remote etc): Normal Function Module
Update:
Function FILE_GET_NAME_USING_PATH pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'FILE_GET_NAME_USING_PATH'"Generate a complete file name with file name and logical path.
EXPORTING
* CLIENT = SY-MANDT "Client for reading the file name table
* ELEMINATE_BLANKS = 'X' "Eliminate blank characters = 'X'
LOGICAL_PATH = "Logical path
* OPERATING_SYSTEM = SY-OPSYS "Operating system
* PARAMETER_1 = ' ' "Parameter for variable
* PARAMETER_2 = ' ' "Parameter for variable
* PARAMETER_3 = ' ' "Parameter for variable
* USE_BUFFER = ' ' "Buffering flag
FILE_NAME = "File name
* USE_PRESENTATION_SERVER = ' ' "Use SAPtemu operating system
IMPORTING
FILE_NAME_WITH_PATH = "File name with path
EXCEPTIONS
PATH_NOT_FOUND = 1 MISSING_PARAMETER = 2 OPERATING_SYSTEM_NOT_FOUND = 3 FILE_SYSTEM_NOT_FOUND = 4
IMPORTING Parameters details for FILE_GET_NAME_USING_PATH
CLIENT - Client for reading the file name table
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
ELEMINATE_BLANKS - Eliminate blank characters = 'X'
Data type: SY-DATARDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOGICAL_PATH - Logical path
Data type: FILEPATH-PATHINTERNOptional: No
Call by Reference: No ( called with pass by value option)
OPERATING_SYSTEM - Operating system
Data type: SY-OPSYSDefault: SY-OPSYS
Optional: Yes
Call by Reference: No ( called with pass by value option)
PARAMETER_1 - Parameter for variable
Data type: Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PARAMETER_2 - Parameter for variable
Data type: Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PARAMETER_3 - Parameter for variable
Data type: Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USE_BUFFER - Buffering flag
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILE_NAME - File name
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USE_PRESENTATION_SERVER - Use SAPtemu operating system
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FILE_GET_NAME_USING_PATH
FILE_NAME_WITH_PATH - File name with path
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PATH_NOT_FOUND - Logical path unknown
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_PARAMETER - Parameter not passed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OPERATING_SYSTEM_NOT_FOUND - Operating system unknown
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FILE_SYSTEM_NOT_FOUND - File system unknown
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FILE_GET_NAME_USING_PATH Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_client | TYPE SY-MANDT, " SY-MANDT | |||
lv_path_not_found | TYPE SY, " | |||
lv_file_name_with_path | TYPE SY, " | |||
lv_eleminate_blanks | TYPE SY-DATAR, " 'X' | |||
lv_logical_path | TYPE FILEPATH-PATHINTERN, " | |||
lv_missing_parameter | TYPE FILEPATH, " | |||
lv_operating_system | TYPE SY-OPSYS, " SY-OPSYS | |||
lv_operating_system_not_found | TYPE SY, " | |||
lv_parameter_1 | TYPE SY, " SPACE | |||
lv_file_system_not_found | TYPE SY, " | |||
lv_parameter_2 | TYPE SY, " SPACE | |||
lv_parameter_3 | TYPE SY, " SPACE | |||
lv_use_buffer | TYPE SY, " SPACE | |||
lv_file_name | TYPE SY, " | |||
lv_use_presentation_server | TYPE SY. " SPACE |
  CALL FUNCTION 'FILE_GET_NAME_USING_PATH' "Generate a complete file name with file name and logical path |
EXPORTING | ||
CLIENT | = lv_client | |
ELEMINATE_BLANKS | = lv_eleminate_blanks | |
LOGICAL_PATH | = lv_logical_path | |
OPERATING_SYSTEM | = lv_operating_system | |
PARAMETER_1 | = lv_parameter_1 | |
PARAMETER_2 | = lv_parameter_2 | |
PARAMETER_3 | = lv_parameter_3 | |
USE_BUFFER | = lv_use_buffer | |
FILE_NAME | = lv_file_name | |
USE_PRESENTATION_SERVER | = lv_use_presentation_server | |
IMPORTING | ||
FILE_NAME_WITH_PATH | = lv_file_name_with_path | |
EXCEPTIONS | ||
PATH_NOT_FOUND = 1 | ||
MISSING_PARAMETER = 2 | ||
OPERATING_SYSTEM_NOT_FOUND = 3 | ||
FILE_SYSTEM_NOT_FOUND = 4 | ||
. " FILE_GET_NAME_USING_PATH |
ABAP code using 7.40 inline data declarations to call FM FILE_GET_NAME_USING_PATH
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single MANDT FROM SY INTO @DATA(ld_client). | ||||
DATA(ld_client) | = SY-MANDT. | |||
"SELECT single DATAR FROM SY INTO @DATA(ld_eleminate_blanks). | ||||
DATA(ld_eleminate_blanks) | = 'X'. | |||
"SELECT single PATHINTERN FROM FILEPATH INTO @DATA(ld_logical_path). | ||||
"SELECT single OPSYS FROM SY INTO @DATA(ld_operating_system). | ||||
DATA(ld_operating_system) | = SY-OPSYS. | |||
DATA(ld_parameter_1) | = ' '. | |||
DATA(ld_parameter_2) | = ' '. | |||
DATA(ld_parameter_3) | = ' '. | |||
DATA(ld_use_buffer) | = ' '. | |||
DATA(ld_use_presentation_server) | = ' '. | |||
Search for further information about these or an SAP related objects