Yes, I know that I can use a FTP to do that but the company don't want use a FTP or FTPS connection to do that. This is the reason because I check if exist other way like a function to do that.
Hi Carlos, please check the following progam. It will delete any file that starts with "TEST" in the OUT directory of your application server. Of course you can modify for you needs.
report zrich_0001 .
data: localfile type localfile.
data: filepathname type string.
data: ifile type table of salfldir with header line.
parameters: p_path type salfile-longname
default '/usr/sap/out/'.
select-options: s_file for localfile no intervals no-extension.
initialization.
s_file-sign = 'I'.
s_file-option = 'CP'.
s_file-low = 'TEST*'.
append s_file.
start-of-selection.
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 where name in s_file.
concatenate p_path ifile-name into filepathname.
delete dataset filepathname.
endloop.
You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
Add a comment