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: 

use of EPS_GET_DIRECTORY_LISTING

Former Member
0 Kudos

Hi all ,

Can any one tell me<b> what</b> is the use of function module :

<b>EPS_GET_DIRECTORY_LISTING</b>

and <b>how</b> to use it ?

Plz explain with an example ...

3 REPLIES 3

Former Member
0 Kudos

Hi Dipankar,

this FM is used to get the list of files in the directory.

you can use as below

  DATA: lit_dir_list      TYPE STANDARD TABLE OF epsfili INITIAL SIZE 0.  "Files Table
  DATA: lv_dir_name       TYPE epsf-epsdirnam. "Directory Name

   lv_dir_name = <source directory>.

*** Fetch all the files stored in the directory.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
      EXPORTING
        dir_name                     = lv_dir_name
*   FILE_MASK                    = ' '
* IMPORTING
*   DIR_NAME                     =
*   FILE_COUNTER                 =
*   ERROR_COUNTER                =
      TABLES
        dir_list                     = lit_dir_list[]
     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 <> 0.
    ENDIF.

<b>Reward for helpful answers</b>

Satish

0 Kudos

How about if I want to use the same but from external server using FTP

What shoud i do before this ?

Former Member
0 Kudos

Dipankar,

Please reward points if my input is useful for you.

Satish