Skip to Content
author's profile photo Former Member
Former Member

Function question.

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 02:52 PM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Oct 26, 2006 at 02:46 PM

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

    Fred

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

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.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.