Skip to Content
author's profile photo Former Member
Former Member

FM for selecting file path from apps server dynamically

Hi all,

Is there any FM for selecting a file path from apps server directily in the selection-screen.

waiting for reply.

thanks & regards,

J.prakash.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2007 at 06:46 AM

    Hi Prakash,

    You need to use logical file name concept and after that ise Fm FILE_GET_NAME.

    Reward points if useful.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2007 at 06:45 AM

    Hi,

    can anybody of u will tell how to use the FM 'TMP_GUI_DIRECTORY_LIST_FILES', i.e., a bit of code i need.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Prakash,

      try this.

      CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'

      EXPORTING

      DIRECTORY = T_DIREC

      TABLES

      FILE_TABLE = FILE_TABLE

      DIR_TABLE = DIR_TABLE .

      IF DIR_TABLE[] IS INITIAL.

      CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

      EXPORTING

      TEXTLINE1 = 'Please Enter Valid Directory'

      TEXTLINE2 = 'Ex: d:\temp'.

      MESSAGE e013(zmamin) WITH ''.

      V_FLAG = ''.

      Reward if useful.

      Thanks

      Aneesh.

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2007 at 08:53 AM

    hi Prakash,

    Here is d solution.

    call FM : RZL_READ_DIR

    pass the path in NAME(export parameter)

    like C:\ - U will get all the files and folders in table parameter FILE_TBL

    and size having 0000000000 are folders .

    display these files and folders in any formate - i suggest - list display in popup window .

    let user select any file /folder

    if folder is selected call this FM once again - ohterwise if file is selected - get it in some variable

    and do anything with it according to your requirement

    Njoy..

    Reward if it helps..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2007 at 09:00 AM
    PARAMETERS: f_app(128).
     
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
      PERFORM get_fname_app.
     
     
    FORM get_fname_app.
     
      DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
      search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
      file_path LIKE dxfields-longpath.
     
      CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
        EXPORTING
          i_location_flag = 'A'
          i_server        = ' '
          i_path          = search_dir
          filemask        = c_fnh_mask
          fileoperation   = 'R'
        IMPORTING
          o_path          = file_path
        EXCEPTIONS
          rfc_error       = 1
          OTHERS          = 2.
      IF sy-subrc EQ 0.
        f_app = file_path.
      ENDIF.
    ENDFORM.                    "get_fname_app
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2007 at 09:03 AM

    Hi Prakash,

    try using this fn module .. '/SAPDMC/LSM_F4_SERVER_FILE'.

    Regards,

    Vidya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 03:51 AM

    Hi Prakash,

    Check out this :

    PARAMETERS : p_f2 LIKE rlgrap-filename.

    CONSTANTS : c_mask TYPE char9 VALUE ',*.*,*.*.'.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f2.

    *-- Browse Application Server

    PERFORM f1001_browse_appl_file.

    &----


    *& Form f1001_browse_appl_file

    &----


    • text

    ----


    FORM f1001_browse_appl_file .

    DATA: lcl_directory TYPE char128.

    lcl_directory = '/local'.

    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

    EXPORTING

    directory = lcl_directory

    filemask = c_mask

    IMPORTING

    serverfile = p_f2

    EXCEPTIONS

    canceled_by_user = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    • MESSAGE e000(zmm) WITH text-039.

    • flg_app = 'X'.

    ENDIF.

    ENDFORM. " f1001_browse_appl_file

    -SatyaPriya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:22 PM

    Hi Prakash,

    You can use the class CL_GUI_FRONTEND_SERVICES also for this, instead of using Function module..

    Regards

    Indrajit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2007 at 06:05 AM
    "ABAP code for retrieving list of files contained within specific Application server
      " directory(SAP).
    
    
    REPORT  ZDIRFILES    .
    
    
    PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.
    
    data: begin of it_filedir occurs 10.
            include structure salfldir.
    data: end of it_filedir.
    
    
    ************************************************************************
    *START-OF-SELECTION
    START-OF-SELECTION.
    * Get Current Directory Listing for OUT Dir
      call function 'RZL_READ_DIR_LOCAL'
           exporting
                name     = p_fdir
           tables
                file_tbl = it_filedir.
    
    * List of files are contained within table it_filedir
      loop at it_filedir.
        write: / it_filedir-NAME.
      endloop.

    Reward points if it is usefull....

    Girish

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.