2010 Apr 20 2:27 PM
Hi all
I've to obtain the file list of a directory from application server, I can use a FM too but It's possible the lenght of file name is upper then 40 characters so I can't use FM EPS_GET_DIRECTORY_LISTING.
Thanks
Edited by: Aristoteles92 on Apr 20, 2010 3:27 PM
2010 Apr 20 2:38 PM
Hello,
A few days back we had a discussion the same issue. You can use an external system command to get the "xxtra-long" file names from the app server w/o getting the sames truncated.
Both EPS_GET_DIRECTORY_LISTING & RZL_READ_DIR_LOCAL have limitations on the maximum length of the filename.
Cheers,
Suhas
Edited by: Suhas Saha on Apr 20, 2010 7:09 PM
Hi all
I've to obtain the file list of a directory from application server, I can use a FM too but It's possible the lenght of file name is upper then 40 characters so I can't use FM EPS_GET_DIRECTORY_LISTING.
Thanks
Edited by: Aristoteles92 on Apr 20, 2010 3:27 PM
2010 Apr 20 2:31 PM
Try using the function RZL_READ_DIR_LOCAL. Here is an example program using this function.
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.
format hotspot on.
write:/ ifile-name.
hide ifile-name.
format hotspot off.
endloop.
at line-selection.
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.Regards,
Rich Heilman
2010 Apr 20 2:38 PM
Hello,
A few days back we had a discussion the same issue. You can use an external system command to get the "xxtra-long" file names from the app server w/o getting the sames truncated.
Both EPS_GET_DIRECTORY_LISTING & RZL_READ_DIR_LOCAL have limitations on the maximum length of the filename.
Cheers,
Suhas
Edited by: Suhas Saha on Apr 20, 2010 7:09 PM