Skip to Content

Files available in a Directory on application server

Hi,

I have used the FM 'RZL_READ_DIR_LOCAL' to download the list of files in a particular directory. This was fine until now. The filename is truncated since the name field in the returning table can hold only 32 characters. Is there any FM for the same functionality where the returning table will not truncate the names.?

Thank you.

-Niranchan.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Aug 06, 2010 at 06:17 AM

    Hi,

    Have you checked the Function Module "EPS_GET_DIRECTORY_LISTING"?

    Regards

    Vinod

    Add a comment
    10|10000 characters needed characters exceeded

    • The available FMs do not cater to longer app server filenames. They'll get truncated.

      You can use the External OS commands 'LIST_DB2DUMP' (check in SM69) & use it in conjunction with 'SXPG_CALL_SYSTEM' (or 'SXPG_COMMAND_EXECUTE')funtion module.

      Search the forum you'll find details on how to implement the solution.

      BR,

      Suhas

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2010 at 08:57 AM

    Hi,

    Check this FM

    SUBST_GET_FILE_LIST

    Give FILENAME as *

    This file name default length is 75 char. I think this will help you.

    Regards,

    Selva

    Edited by: Selva M on Aug 6, 2010 2:30 PM

    Edited by: Selva M on Aug 6, 2010 2:34 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 01, 2010 at 06:04 PM

    If you are on 6.0 you can use EPS2_GET_DIRECTORY_LISTING which has 200 char file names. It is not available on 5.0 or before though. Good luck.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 01, 2010 at 06:09 PM

    Hi ,

    Use EPS_GET_DIRECTORY_LISTING

    Refer the below code I have used in one of my assignment.

    
    DATA:   l_check_msg(50)  TYPE c,
              l_filemask       LIKE epsf-epsfilnam.
    
      CONCATENATE p_sysid '*' INTO l_filemask.
    
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
           EXPORTING
                dir_name               = wa_ztsifregi-pathname
                file_mask              = l_filemask
           TABLES
                dir_list               = i_files
           EXCEPTIONS
                invalid_eps_subdir     = 1
                sapgparam_failed       = 2
                build_directory_failed = 3
                no_authorization       = 4
                read_directory_failed  = 5
                too_many_read_errors   = 6
                empty_directory_list   = 7
                OTHERS                 = 8.
      IF sy-subrc NE 0.
        CASE sy-subrc.
          WHEN 1.
            l_check_msg = 'Invalid subdirectory'(005).
          WHEN 2.
            l_check_msg = 'EPS_GET_DIRECTORY_LISTING failed'(006).
          WHEN 3.
            l_check_msg = 'Build directory failed'(007).
          WHEN 4.
            l_check_msg = 'No authorization'(008).
          WHEN 5.
            l_check_msg = 'Read directory failed'(009).
          WHEN 6.
            l_check_msg = 'Too many read error'(010).
    *      WHEN 7.
    *        l_check_msg = 'Empty directory'(011).
          WHEN OTHERS.
            l_check_msg = 'Unexpected error from function module'(012).
        ENDCASE.
    

    Hope this solves your query.

    Regards

    Abhii

    Regards

    Abhii

    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.