‎2007 Sep 27 3:00 PM
Any Professional plz ans this query :
how can we read all the files from a specific directory on application server
say for example :
"c:\usr\sap\id3\dvebmgs00\data" under this directory there 3 files
1. file1.txt
2. file2.txt
3. file3.txt
Now i have to read all the file names into my program how can i do that.
Plzzzz give me the best answer.
Thanks in Advance .
‎2007 Sep 27 3:03 PM
‎2007 Sep 27 3:03 PM
‎2007 Sep 27 3:04 PM
Use
Transfer statement to transfer data from appl server to internal table.
reward if helpful.
‎2007 Sep 27 3:05 PM
Try something like this.
report zrich_0001 .
data: begin of itab occurs 0,
rec(1000) type c,
end of itab.
data: wa(1000) type c.
data: p_file type localfile.
data: ifile type table of salfldir with header line.
parameters: p_path type salfile-longname
default '/usr/sap/TST/DVEBMGS01/data/'.
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_path
tables
file_tbl = ifile
exceptions
argument_error = 1
not_found = 2
others = 3.
loop at ifile.
perform read_file.
endloop.
*---------------------------------------------------------------------*
* FORM read_file *
*---------------------------------------------------------------------*
form read_file.
concatenate p_path ifile-name into p_file.
clear itab. refresh itab.
open dataset p_file for input in text mode.
if sy-subrc = 0.
do.
read dataset p_file into wa.
if sy-subrc <> 0.
exit.
endif.
itab-rec = wa.
append itab.
enddo.
endif.
close dataset p_file.
loop at itab.
write:/ itab.
endloop.
endform.
Regards,
RIch Heilman
‎2007 Sep 27 3:06 PM
Hi
Use<b> AL11</b> Transaction to see the files on Application server.
or use the
OPENDATASET...
READ DATASET...
CLOSE DATASET...
to move the files to an internal table and to display
or use
<b>CG3Y</b> Transaction to downlaod all the fiels to presentation server from application server
Regards
Anji