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: 

FM that return a list of subdirectories given a directory path.

Former Member
0 Kudos

Exist? Thanks for answers.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

if you want the list of subdirectories inside a Application server then check this Fm <b>'F4_DXFILENAME_TOPRECURSION'</b>

    DATA: L_PATH  LIKE DXFIELDS-LONGPATH ,
          L_ABEND_FLAG LIKE DXFIELDS-ABENDFLAG .
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
      EXPORTING
        I_LOCATION_FLAG       = 'A'
        I_SERVER              = ' '
        I_PATH                = '/usr/users/'
      IMPORTING
        O_PATH                = L_PATH
        ABEND_FLAG            = L_ABEND_FLAG
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        RFC_ERROR             = 3.
    IF SY-SUBRC EQ 0.
      P_FILE = L_PATH.
    ENDIF.
    IF L_ABEND_FLAG = 'X'.
      EXIT.
    ENDIF.

Regards

vijay

9 REPLIES 9

Former Member
0 Kudos

hi Avaltor,

I guess there is no such FM..

but then have a look in these

http://www.geocities.com/victorav15/sapr3/abapfun.html

http://www.sap-img.com/abap-function.htm

Former Member
0 Kudos

chk this

EPS_GET_DIRECTORY_LISTING

former_member181962
Active Contributor
0 Kudos

SUBST_GET_FILE_LIST

LucianoBentiveg
Active Contributor
0 Kudos

Try with methods:

DIRECTORY_GET_CURRENT

DIRECTORY_LIST_FILES

From class CL_GUI_FRONTEND_SERVICES.

Regards.

former_member188685
Active Contributor
0 Kudos

Hi,

if you want the list of subdirectories inside a Application server then check this Fm <b>'F4_DXFILENAME_TOPRECURSION'</b>

    DATA: L_PATH  LIKE DXFIELDS-LONGPATH ,
          L_ABEND_FLAG LIKE DXFIELDS-ABENDFLAG .
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
      EXPORTING
        I_LOCATION_FLAG       = 'A'
        I_SERVER              = ' '
        I_PATH                = '/usr/users/'
      IMPORTING
        O_PATH                = L_PATH
        ABEND_FLAG            = L_ABEND_FLAG
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        RFC_ERROR             = 3.
    IF SY-SUBRC EQ 0.
      P_FILE = L_PATH.
    ENDIF.
    IF L_ABEND_FLAG = 'X'.
      EXIT.
    ENDIF.

Regards

vijay

0 Kudos

The FM must run on the directories of a presentation server (local).

0 Kudos

Avalor,

Use TMP_GUI_DIRECTORY_LIST_FILES

And please reward points for helpful answers.

0 Kudos

Try with:

CALL METHOD cl_gui_frontend_services=>directory_browse

CHANGING

selected_folder = folder

Former Member
0 Kudos

hi avalor,

check this fm <b>EPS_GET_DIRECTORY_LISTING</b> or

CALL METHOD cl_gui_frontend_services=>file_open_dialog