Application Development and Automation 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: 
Read only

Function question.

Former Member
0 Likes
492

Hi people!

I need to take like eight files from the directory 'out' in the R/3 server. I need to create a program for this.

Exist a function that take me this eight files that beginning like example with 'Filetest*' ?

Thanks for the help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
466

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.

Thanks!

3 REPLIES 3
Read only

FredericGirod
Active Contributor
0 Likes
466

Search in the forum for the FTP solution propose by SAP.

Fred

Read only

Former Member
0 Likes
467

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.

Thanks!

Read only

0 Likes
466

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.

Regards,

Rich Heilman