‎2009 Jan 19 4:38 PM
Hi,
I've defined a logical path with transction FILE. I want to use it without the file. I just want to get the path name. Is it possible ?
Thanks
‎2009 Jan 19 5:06 PM
Hi,
Check the FM
CH_SPLIT_FILENAME
J_8A3_L_MB_SPLIT_PATH_AND_FILE
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Open ' "#EC NOTEXT
default_extension = 'XLS'
default_file_name = g_filename
CHANGING
filename = l_filename
path = l_path
fullpath = l_fullpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc EQ 0.
p_fullpath = l_fullpath.
ENDIF.Edited by: Avinash Kodarapu on Jan 19, 2009 10:41 PM
‎2009 Jan 19 5:09 PM
Retrieve the logical path(name) based on WHAT?
Look inside FM FILE_GET_NAME_USING_PATH for the coding and try to use it any way you want to.
‎2009 Jan 19 6:14 PM
Hi use this :
You got to use this after some FM which gives you the whole path... and the file name will be removed by this FM
DATA: lv_path TYPE rlgrap-filename.
lv_path = lv_output.
CALL FUNCTION 'LIST_SPLIT_PATH'
EXPORTING
filename = lv_path
IMPORTING
pathname = lv_path.
IF sy-subrc EQ 0.
p_path1 = lv_path.
ENDIF.
‎2009 Jan 19 6:16 PM
Hi
Please use FM
CALL FUNCTION '/SAPDMC/LSM_PATH_FILE_SPLIT'
EXPORTING
PATHFILE = p_file
IMPORTING
PATHNAME = PATHNAME
FILENAME = FILENAME
Best Regards,
Krishna
‎2009 Jan 19 6:23 PM
Hey Dorian,
I think you can use CALL FUNCTION 'FILE_GET_NAME'.
Example
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = 'Z_logical_name' " Your logical file name
IMPORTING
file_name = p_path. "the logical file path
You can then concatenate the physical file name at the end.
Regards,
C
‎2009 Feb 08 9:21 AM
Hi Cullen,
Iam using the FM 'FILE_GET_NAME' but ot is giving a runtime error that file_name parameter is not defined.
what is the data type used for file_name parameter.
Please help me.
‎2009 Feb 08 9:32 AM
Hello Sandhya,
U can use FILE_GET_NAME_USING_PAHT or FILE_GET_NAME fun modules to get the Physical path ofthe file.
You neededto give Logivcal path which u defined using FILE transaction and the File name tcreated within the Physicalpahth for which u already had the mappaing woith the Logical paht in FILE tcode.
Regards