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: 

command to read a file from a specific directory

Former Member
0 Kudos

whats the command to read a file from a specific directory?

10 REPLIES 10

Former Member
0 Kudos

be specific

former_member194669
Active Contributor
0 Kudos

if the file is in Presentation server then use fm GUI_UPLOAD or in Appl server then use OPEN DATASET & READ DATASET

P561888
Active Contributor
0 Kudos

Hi ,

Could you please mention the qustion clear....

Former Member
0 Kudos

hi,

if ur requirement is to select a file from the local directory ,in ur selection screen then do the following:

parameters p_file type rlgrap-filename.

at selection-screen on value-request for p_file.

call function 'KD_GET_FILENAME_ON_F4'

EXPORTING

field_name = p_file

CHANGING

file_name = p_file.

0 Kudos

its a local directory and the program has to check if there are files in that directory

I dont want to use the AT SELECTION-SCREEN on VALUE-REQUEST on p_file

Is there a way to retrieve the specific file from a specified local directory??

0 Kudos

Hi,

check out the class

"CL_GUI_FRONTEND_SERVICES"

and the methods in the class :

"DIRECTORY_EXIST"

"DIRECTORY_LIST_FILES"

"FILE_EXIST"

Thanks & Regards,

Navneeth K.

0 Kudos

Call the "FILE_EXIST" method of the class and validate the given file name.

0 Kudos

hi,

check rich reply in this thread.

[https://forums.sdn.sap.com/click.jspa?searchID=17707428&messageID=6032229]

0 Kudos

its not working

im checking if any files exist in a directory in the application server without using the popup for the open file screen

Former Member
0 Kudos

hi,

if solution found,then mark it as answered....