Application Development and Automation 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: 
Read only

Function for list files

Former Member
0 Likes
487

Hi everybody!

I'd like to list all files in a specific directory. Is there any function for that???

Regards,

Elton.

4 REPLIES 4
Read only

Former Member
0 Likes
453

Try to use:

- Fm (Application server) SUBST_GET_FILE_LIST

- Method (Presentation Server) CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

Max

Read only

Former Member
0 Likes
453

Please check this code

data:

lv_Command(254) type c,

lt_Result(255) type c occurs 100 with header line.

lv_Command = 'ls -al'.

CALL 'SYSTEM' ID 'COMMAND' FIELD lv_Command

ID 'TAB' FIELD lt_Result-SYS.

loop at lt_Result.

write: / lt_Result.

endloop.

Also check Fm

<b>EPS_GET_DIRECTORY_LISTING</b>

Message was edited by:

Dominic Pappaly

Read only

messier31
Active Contributor
0 Likes
453

Hi Elton,

You said you want to list all the file..but forgot to specify ..you want to list application server file or presentation server file.. andy use following are the function which will help you..

<b>To list application server file..</b>

RZL_READ_DIR_LOCAL

This can be used to read both application server / presentation file ..if

application server file is not specified it reads presentation files else app

server files

<b>To list presentation server file</b>

TMP_GUI_DIRECTORY_LIST_FILES

Only for presentation file..

Hope this helps you...

Enjoy SAP.

Pankaj Singh

Read only

Former Member
0 Likes
453

Thank you very much!

Elton.