How to archive files in another ftp server?

Hi,gurus:
   My scenario is file to file and my sender adapter is ftp adapter.
   Now I want to archive the send file in another ftp server,how can I  implement it?
   There is a parameter "Archive files on FTP server" when I choose the processing mode "archive".What's  it's use?Thanks in advance.

Hi,Santhosh:
  Thanks for your reply.
  I have checked your blog before,and it is very useful for me.
  I still have a problem about command line.
  In an sap note,I found the principle of the execution of the command line is like below code:
import java.util.*;
import java.io.*;
public class test {
public static void main(String args[]) {
try {
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("C:/data/test.bat <param1> <param2>");
} catch (Exception e) {
e.printStackTrace();
But you know this method has restriction.If my bat file has many commands,it only execute a part of commands(sometimes 8,sometimes 9 ).
My bat file is like below:
echo open 192.168.67.149 >c:
data
copyResult.txt
echo <username> >>c:
data
copyResult.txt
echo <password> >>c:
data
copyResult.txt
echo cd /receive>>c:
data
copyResult.txt
echo get %2>>c:
data
copyResult.txt
echo cd /ok>>c:
data
copyResult.txt
echo put %2>>c:
data
copyResult.txt
echo cd /archive>>c:
data
copyResult.txt
echo delete send.txt>>c:
data
copyResult.txt
echo quit >>c:
data
copyResult.txt
ftp -s:c:
data
copyResult.txt
del %2
I wanna merge all the "echo" in one command,so it may execute successfully,but I don't know the method.Any ideas?

Similar Messages

  • How to Archive files present in application server?

    Hi all,
    We have one report which will be run as batch job for every 5 min. and creates files in application server. Our requirement is when ever this report is run the files present in the application server folder(Which are created during previous execution) should be moved to an Archive folder and new files will be created in the original folder. So at any point of time the original folder have the files created during latest execution of the report only. Can any one tell me how to achieve this requirement. <REMOVED BY MODERATOR>
    Thanks,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:19 PM

    HI,
    Use this forms.
    FORM archive_file .
      DATA: obj_typ   TYPE tdxloadp-objecttype,
             filename  TYPE dxfile-filename,
             filename1 TYPE dxfile-filename,
             filetyp   TYPE dxfile-filetype,
             v_strlen  TYPE i.                                  "#EC NEEDED
      obj_typ = 'BUS6035'.
      filename1 = v_file_path.
      filetyp   = 'P'.
    --Assigning Physical path in "filename"--
      CONCATENATE '/sapdata//Dev/Archive/' p_ipfile sy-datum sy-uzeit INTO filename.
    ---Function to Copy the File--
      CALL FUNCTION 'DX_FILE_COPY'
        EXPORTING
          objecttype                     = obj_typ
          progtype                       = 'REPO'
          progname                       = sy-cprog
          v_ds_name                      = filename1
          v_ds_type                      = filetyp
          n_ds_name                      = filename
          n_ds_type                      = 'P'
        EXCEPTIONS
          canceled_by_user               = 1
          problems_with_logical_filename = 2
          file_is_used                   = 3
          unknown_object_loadprg         = 4
          error_with_copy                = 5
          db_error                       = 6
          no_authority_to_read_file      = 7
          no_authority_to_write_file     = 8
          no_authority                   = 9
          OTHERS                         = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      DATA file_name TYPE epsf-epsfilnam.
      file_name = p_ipfile .
    ---Function to Delete the File--
      CALL FUNCTION 'EPS_DELETE_FILE'
        EXPORTING
          file_name              = file_name
          dir_name               = '/sapdata//Dev/inbound/'
        EXCEPTIONS
          invalid_eps_subdir     = 1
          sapgparam_failed       = 2
          build_directory_failed = 3
          no_authorization       = 4
          build_path_failed      = 5
          delete_failed          = 6
          OTHERS                 = 7.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        MESSAGE s025(zfi).   "File Processed For creation Of Invoice
      ENDIF.
    ENDFORM.                    " ARCHIVE_FILE

  • How to copy file to another server from database using FTP in oracle

    How to copy file to another server from database using FTP in oracle.
    Please do the needfaul.

    Billy  Verreynne  wrote:
    BluShadow wrote:
    Not to mention that some FTP servers can return more than one return message per operation whereas others may return one message for the same operation.I had the problem using the LIST command to determine if a file exists on the server. Cannot be determined via the FTP server's return code. Which means parsing and checking the text response from the server to the command. And this vary from server to server.
    But the basics were quite easy to code. The entire package is 500 lines, includes comments and blank lines for formatting, and supports the basic FTP client command set. Not really a complex piece of software to write - but I found that many developers seem to think that writing network socket software is complex. Not really the case...Mine's a big larger, but incorporates functionality similar to what Chris provided in his, such as being able to use SQL to query a remote file using pipelined functions, or functionality to write the results of a query directly to a remove file.
    :)

  • Polling of the current file from multiple files in the FTP Server

    Hello Experts
    I am working on a file to file scenario.We have to poll the file from the FTP server which may contain multiple files with different creation dates.The requirement is to poll only the file created in the current date.Could anyone throw some light on this.
    Thanks & Regards
    Sabyasachi

    Hi Sabyasachi,
        You can archive the files that you do not need into another folder manually for the first time.
    Later you can schedule the file adapter to poll the folder only once in a day (Poll INterval = 86400 secs)
    Do not forget to set the option to archive/delete the file that are already processed.
    Regards,
    Ravi Kanth Talagana

  • Help Fetching files from an FTP server into a DBase or local folder

    Hello Gurus!
    I need help to automate or design/write an app capable of (replace a manual process) reading log files in an ftp server folder, this log files are called CDR (Call Detail Record) and named as follow cdr.txt.20020221010000 meaning that this log file was created on 2002/02/21 at 01:00:00.
    This CDR log files are generated every hour by a Lucent telephone switch using a software/program called EXS ExchangePlus in ASCII format (fixed length delaminated, Char data type). EXS ExchangePlus writes a record in this CDR/log files after the call is completed, i.e. Calling_Number, Called_Number, Date_connect (yyyymmdd), Time_connect (hhmmss), Charged_time (hhmmss, duration of the call), and so on.
    The manual process I am using now is:
    1. Log in the ftp server into the folder where the CDRs log files are, located the latest generated CDRs log files and downloaded them into a local folder/directory. Normally I download the CDR for full day or 24 CDRs log files.
    1a. Optionally sometimes I used a program called VEdit compiled/gather all 24 CDRs into a single file.
    2. Once I have downloaded the CDRs I want to process (normally I process a full day 24 CDRs) I imported then into a Data Base temp table, where then I do the conversion of data types (i.e. Dates and times fields from char type -> to ->Date type) and calculations for billing purposes.
    So if somebody can help with this, I would really appreciated ideas or any kind of information on how to automated this process.
    I�m familiar with Java2 platform (using JDeveloper ) so if somebody has done something like this before using java, this would very helpful. Or Maybe using Visual Basic 6.0 would help too.
    Thanks Gurus, and I look forward to hear from you soon!
    Alf Pathros!

    Thanks for the idea, even though an example would help me more.
    I already found the FTPClient class.
    I also would like to knwo if there is a away Ican append/merged various files CDRs into a single/one to then dump/import it into the database

  • Posting an Excel file to a FTP Server

    Hi,
    I have a requirement, where I have to convert the contents of an internal table to an excel file, along with header details and put that file to a FTP Server.
    I am able to create an excel file in FTP server, using function module FTP_R3_TO_SERVER and transfer contents of my internal table. But the contents of my internal table are getting copied to one column. How do I get the contents in different columns?
    Also how do I get the header details?

    Hi,
    you can simply create a comma-separated text file on your SAP application server, line by line, each column separated by a semicolon (;). That file can later easily be opened with Excel. Afther the file has been created you can send it to the remote FTP server.
    HTH!

  • Sender File Adapter - remote FTP server program execution

    Hi all,
    I have a scenario
    X12 -> XI -> File
    where sender File adapter is used. The input file is X12 txt document which needs to be converted into X12 xml format. I have created astylus studio XSLT mapping which uses Convertor to convert this txt file to X12 XML.
    I don't know how to configure sender file adpater to run this mapping on the source file before picking it up. have created a windows batch file on the FTP server which runs tis XSLT mapping on the txt file and replaces it with X12 format xml. This batch file uses command line parameters of stylus studio to run XSLT mapping on input txt file and generates an xml.
    I am not sure how to run this mapping on the input file before processing starts in PI file adapater.
    I tried running command line parameters of Sender file adapter but that didn't worked.
    Please help.
    Thanks
    -Kulwant

    Hi, Kulwant:
    Looks like you would like to execute your mapping program before file adapter pick it up.
    Right ? for one interface, it seems out of the XI scope, however if this is your requirement, you can separate into two interfaces:
    The first interface is file to file scenario, it is used to execute your mapping program:
    The file sender just pick up the txt file, send to integration engine.
    Your Message Mapping program need to specify your XSLT mapping, after the mapping, the message is XML format,
    then you will use file receiver to send it to certain directory.
    Now the XML format file is your input of your second interface.
    Regards.
    Liang

  • File reading in FTP server

    Hai,
    I want to read the files present in FTP server without downloading.
    Using (org.apache.commons.net.ftp.*); this package I can view the files and directories present in particular host and can even download.
    But I want to read the files in directories without downloading them for displaying the file contents in my JApplet.
    How can I achieve this?
    Waiting for reply...
    Dhurai

    DHURAI wrote:
    How I have to specify the path (user name,password) for reading?If you are using the Apache Commons FTP package, as you said, then you don't specify a path. And the path you don't specify wouldn't contain a user name and password because you use those when you make the connection to the server. All of this is covered in the documentation.

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • Regarding receiver FILE adapter,  REMOTE FTP server

    Hi All,
    The scenario was to get XML file from a local FTP server and to place that XML file in REMOTE FTP server, which we dont have any control over that REMOTE FTP,
    While executing the scenario it is successfully picked the file and processed and it was success in SXMB_MONI, but when we see the Communication Chaneel of the receiver adapter it is generating the following error..
    Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: ConnectException: Connection timed out: connect
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: ConnectException: Connection timed out: connect
    clarifications needed ASAP
    regards,
    Kishore.

    Hi,
    Verify the Host details of the Remote FTP.
    Try to ping the Remote host as below
    Goto > start>Run --->type cmd and give the command as below
    c:\>ping <host details or IP address> press enter and see if you get the successful communication response.
    If its not it indicates that the connection is not setup.
    Ask you FTP administrators to look into connectivity issue for it.
    Thanks
    Swarup

  • How to schedule Adapter to Pickup File on external FTP Server

    Any solution is very much appreciated for the following Problem.
    My Scenarios are  File to XI to FIle
    My problem is XI is picking up file on FTP Server while file is being written by Webservice ( This Webservice can not write .tmp file or movie file from one directory to another. So these options are ruled out )
    These are proposed steps:
    1. Job Scheduler creates Dummy File on XI File System
    2. XI Picks up File on XI File System and Invokes External Webservice and receives Response that a File "MadFile" has been written to external FTP Server.
    3. After XI receives response from webservice, XI should get "MadFile" from FTP Server
    How Can I implement step 3 above.
    ( Please do not suggest executing scripts as the the application where webservice running do not want to write it )

    ST,
    At times one has to take a stand and using a BPM like this is actually complicating things. Using the script option is the best solution!
    Menahwile, even BPM solution doesn't make sense to me as like you correctly told, your Second Receive Step can poll over the file and pick up the temporary file! Even if you can handle this using Adapter Scheduling, you would need Correlation and I am pretty sure that as you are using a dummy file, this also cannot be achieved!
    Would suggest that another option would be to ask the webservice to send a call directly to XI after writing the file. The moment XI receives the Webservice request,  XI can invoke a java proxy to collect the file ( polling using File adapter is not going to help ) and then pass this file to the integration engien and so on.
    Even my solution is not a very good one, but, if nothing works out, it is something atleast. But, I would ask you to push for the tmp folder plus script.
    Regards
    Bhavesh

  • How do I automatically upload files to an FTP server with Compressor 4?

    So I've been using Compressor 4 in order to compress some videos into a manageable size for streaming. However, I've been trying to figure out how to set up an automatic FTP upload to the program Transmit through Compressor 4, but have been running into roadblocks. When choosing a destination by using the plus icon in the destinations tab, the choice of local or remote no longer appears. Also, when going to the actions tab in the Inspector box, the option to "Execute Applescript" is also gone.
    Has anyone found a way around this yet? I have no experience with Automator, so I am hesitatnt in spending the time to learn a new program just to make the process of compressing and uploading more efficient.

    Hi Nick.
    I'm afraid it went missing in the 4.0.3 update for whatever reason. Unless you have a way of rolling C back one version, you'll either have to write a work-around or see whether it re-appears in a future version.
    Also, http://www.apple.com/feedback/compressor.html
    Russ

  • How to set Lion built-in FTP Server auto run off

    Hello all.
    I set FTP Server by using Rumpus Server application.
    But Lion's built-in FTP Server is running on the front.
    So if I try to connect my FTP Server out of my LAN, I can only connect to the built-in FTP Server despite I wanted to connect Rumpus FTP Server.
    It can be solved by unload the built-in FTP Server(using sudo -s launchctl unload...) but every after rebooting I should set it because it is set to run automatically in every booting.
    How can I set the auto run off?

    well, the ftp server (=ftpd) takes account info from the user list for your mac. so, go to the system settings on your mac, then to users, and then just add another user with a password of your choice (tap on the little plus-sign to add a user!). this will then be a valid user for your ftp server after you restart your ftp server.
    the other thing you want to do, about the home directory, is called chroot. you can set the home directory of a specific ftp-user to be another directory then the standard. for this, there are configuration directives in the configuration file in /private/etc/ftpd.conf which you have to edit by hand. so make sure what you do there.
    you should read this before editing the file, this will give you a better understanding of what to put there: https://developer.apple.com/library/mac/documentation/darwin/reference/manpages/ man8/tnftpd.8.html

  • Need Help to locate a file on a FTP server using MediaLocator class

    Hi Friends,
    This is Venkat. Iam currently working on a Multimedia J2EE web project. Iam working on a requirement to
    show Thumbnail view for uploaded media. For this i have downloaded a standalone code from the following site.
    http://www.exactfutures.com/index02.htm.
    This code converts frames of a media files to jpg images which i can use them to show as Thumbnails.
    The code takes file name which is present in project folder as parameter. But in my web project iam using a FTP server to store my media files.
    The above code uses Java Media Framework along with another API Fobs4JMF. The media file name is passed to MediaLocator class constructor which is located in the project folder. Iam talking about a standalone application here.
    But my project is a J2EE web application.
    Now my problem is that, how can i refer a file which is located on a external FTP server and pass it to MediaLocator or some other class.
    Say the ftp file URL is mms://wm.testuser.net/12365741/testvideo.wmv
    Guys hope you are clear abt my problem. Please help me ASAP.
    Below is the part of code
         * Constructor
         public vid2jpg(String path) {
              MediaLocator ml;
              String args = path;
              if ((ml = new MediaLocator(args)) == null) {
                   System.out.println("Cannot build media locator from: " + args);
              if (!open(ml)) {
                   System.out.println("Failed to open media source");
         * Given a MediaLocator, create a processor and start
         private boolean open(MediaLocator ml) {
              System.out.println("Create processor for: " + ml);
              try {
                   p = Manager.createProcessor(ml);
              } catch (Exception e) {
                   System.out.println("Failed to create a processor from the given media source: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(p.Configured)) {
                   System.out.println("Failed to configure the processor.");
                   return false;
              // Get the raw output from the Processor.
              p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
    Thanks in Advance for your time.
    Venkat
    Edited by: VenkataGuru on Jul 23, 2008 5:30 PM

    Hi Mani,
    Below is code that ran successfully on a cRIO-9002.  It looks much the same as yours, please double-check the formatting of your string controls.  If things still do not work, let's look at the cRIO more closely.
    Message Edited by Pie56694 on 06-30-2008 09:45 AM
    Attachments:
    FTPDELE3.jpg ‏28 KB
    FTPDELE.jpg ‏24 KB
    FTPDELE2.jpg ‏18 KB

  • TS2167 how do i upload to another ftp site

    my iweb site on is down and I've been told that I have to upload my site to another sever or host... how do I do that?

    In order to upload your existing site in iWeb '09 and above:
    Click on the name of the site in the sidebar: the publishing settings pane will open. Set 'Publish to' to 'FTP'. Enter the name of the site and a contact address (if desired).
    In the 'FTP Server Settings' section you will need to know the server address (your hosting service can tell you that), and your username and password for that service. Your site will be published in a folder with its name at root level of the server, with an index.html file at root level (which will overwrite any index.html file which may be there already). The 'Directory/Path' field may need to include a path such as '/webspace/' or 'ht_docs/' - this is dependent on your hosting service and they should tell you this. If you want to publish within a folder you can add that to the path.
    You can then click the 'Test connection' button so that iWeb can check that it can get access to your server space. You should enter the URL of the site in the 'URL' field so that rss feeds and internal links have the correct address.
    To publish using an earlier version of iWeb:
    From the File menu choose 'Publish to a folder'. You should create a folder somewhere convenient specifically for this and choose it when publishing to a folder: this folder should not contain anything else.
    You now need an FTP program (FTP is the 'protocol' used for uploading) to upload the contents of the folder to your server.Cyberduck is free (donation requested): Transmit is $34 but I think better. You will need the server address (your hosting service can tell you that), and your username and password for that service. You can drag the contents of your folder to your webspace, or create a folder there and drag the contents to that if you prefer.
    Some facilities that iWeb provided when hosted on MobileMe will not work on other servers: comments on weblogs and photos, password-protecting your site (some hosts may provide this), searching in the weblog, and a hits counter (again, some hosts can provide code for this). Slideshows in iWeb will work on other hosts than MobileMe (they use different code when FTPing which doesn't depend on scripts hosted on MobileMe as the MobileMe version does); however there is an issue with the 'buttons' which control the slideshow which are images hosted on me.com - these depend on images which used to be hosted on MobileMe. The poster 'Old Toad' has provided a workaround, described at http://oldtoadstutorials.net/No.26.html.

Maybe you are looking for