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: 

getting a list of files from the application server

former_member215563
Active Participant
0 Kudos

Hi All,

I want to get a list of files from the application server without using open datasets.

How can we achieve this. Pls help

thanks,

Faiz

5 REPLIES 5

Former Member
0 Kudos

https://forums.sdn.sap.com/click.jspa?searchID=8786023&messageID=4856627

Check the below FM.

Retrieving the list of files in the given directory

CALL FUNCTION 'RZL_READ_DIR_LOCAL'

EXPORTING

NAME = PA_AFILE " Directory Path

TABLES

FILE_TBL = T_AFILES " All files...

EXCEPTIONS

ARGUMENT_ERROR = 1

NOT_FOUND = 2

OTHERS = 3.

IF SY-SUBRC 0.

    * If it is run in background

IF SY-BATCH EQ C_TRUE.

WRITE: /5 'Directory cannot be opened'(039).

FL_FALSE = C_TRUE.

ELSE.

MESSAGE S000(ZZ_PA) WITH 'Directory cannot be opened'(039).

FL_FALSE = C_TRUE.

ENDIF.

Former Member
0 Kudos

This message was moderated.

former_member386202
Active Contributor
0 Kudos

Hi,

Use following FM

Regards,

Prashant

Subhankar
Active Contributor
0 Kudos

Hi,

I am little bit confused with your question.

You can use the FM RZL_READ_DIR_LOCAL to get all the files (name and path) are in a directory.

To read the content of each file you have to use OPEN DATASET.

Thanks

Subhankar

Former Member
0 Kudos

This message was moderated.