Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get logical path

Former Member
0 Likes
1,031

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

7 REPLIES 7
Read only

Former Member
0 Likes
925

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

Read only

Sm1tje
Active Contributor
0 Likes
925

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.

Read only

former_member156446
Active Contributor
0 Likes
925

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.

Read only

nkr1shna
Contributor
0 Likes
925

Hi

Please use FM

CALL FUNCTION '/SAPDMC/LSM_PATH_FILE_SPLIT'

EXPORTING

PATHFILE = p_file

IMPORTING

PATHNAME = PATHNAME

FILENAME = FILENAME

Best Regards,

Krishna

Read only

Former Member
0 Likes
925

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

Read only

0 Likes
925

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.

Read only

0 Likes
925

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