Application Development 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: 

logical file names in your application programs

Former Member
0 Kudos

hi all ,

how i used FILE_GET_NAME function module in my program ,to logical file name for platform-independent files.

thank you.

2 REPLIES 2

former_member223537
Active Contributor
0 Kudos


  CONCATENATE 'WALM' sy-datum sy-uzeit '.txt' INTO p_pfile.


 CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      logical_filename = p_phfile
      operating_system = sy-opsys
      parameter_1      = p_ctry
      parameter_2      = p_intf
      parameter_3      = p_pfile
    IMPORTING
      file_name        = p_fname
    EXCEPTIONS
      file_not_found   = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    p_flag = sy-subrc.
  ENDIF.

Former Member
0 Kudos

Hi Pawan,

you can use as below:

DATA: gv_physicalpath TYPE path-pathextern.

CONSTANTS: gc_logicalpath TYPE filepath-pathintern
                         VALUE 'MMIM_PHYSICAL_INVENTORY_DOCUMENTS'.


* Get corresponding physical path for the logical path
  PERFORM get_physical_path USING gc_logicalpath
                         CHANGING gv_physicalpath.

FORM get_physical_path  USING    p_gc_logicalpath
                        CHANGING p_gv_physicalpath.

  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      logical_filename = p_gc_logicalpath
      operating_system = sy-opsys
    IMPORTING
      file_name        = p_gv_physicalpath
    EXCEPTIONS
      file_not_found   = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

ENDFORM.                    " get_physical_path

<b>Reward for helpful answers</b>

Satish