Saving a File in FTP using DSN or FTPCOMMAND

Hi,
I'm trying to save a file to a remote location in the background using ABAP.
I tried DSN. This didnt work as it writes only to application server SAPUSERS directory.
I tried FTPCONNECT and FTPCOMMAND but getting an error connecting to FTP.  (connection failed)
Is it possible to write a file to a remote location in the background using ABAP.
I use a VPN gateway to connect to the remote server (location where file are to be saved) and SAP as well.
Appreciate your help.
Thanks,
Sri

Hi,
Please  use HTTP_SCRAMBLE' FM before 'FTP_connect" as follows :
*-- FTP_CONNECT requires an encrypted password to work
CALL FUNCTION 'HTTP_SCRAMBLE'
    EXPORTING
      SOURCE      = password
      sourcelen   = lv_len
      key         = lv_key
    IMPORTING
      destination = password.
CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user                   = ftp_user
      password               = password
  ACCOUNT                =
      host                   = host
      rfc_destination        = 'SAPFTP'
    IMPORTING
      handle                 = lv_handle
    EXCEPTIONS
      not_connected          = 1
      OTHERS                 = 2.
Also note that FTP_USER contains the user name of the FTP server, PASSWORD contains the scrambled password received from  'HTTP_SCRAMBLE'. HOST contains the name of server.
Thanks and Regards,
P.Bharadwaj

Similar Messages

  • PI needs to obtain a zip file via FTP using the File adapter

    I have a scenario where PI needs to obtain a zip file via FTP using the File adapter, this zip file contains a number of txt files that I need to process, and the content of one of them send it to an ECC, now I'm using the PayloadZipBean Module in the Sender FIle Adapter, and I have two things if I use the Message Protocol as File, I get a Payload for each txt file in the zip file, but this payload has no structure, and if I use the File Content Conversion I get an XML strcuture with only one field and a strange string in it, and somewhere in this string the names of the files I assume all the content of the zip file, can anyone help on how could I achieve what I need that is to pull the zip file via SAP PI, then unzip it, and with the content of one of the txt files send it to an ECC via ABAP Proxy, thanks in advance for your answers.
    Regards,
    Raul Alvarado

    Hello Raul,
    you can do it in futher way ...
    pickup zip file and simply extract and dump it in another temp folder (can use scripts on OS level).
    @ then Use another sender communication channel to pickup all these text file .
    for further clarification you can use these links also. -
    Process txt files in zip file
    Accessing File using FTP from Java Mapping
    File Sender Adapter with FTP protocol
    BR
    Raj

  • How to get the owner name for the file in ftp using abap ?

    Hi folks ,
    How to get the owner name for the file in ftp using abap ? please help me very ugernt . I tried with all standard FTP commands
    but doest work out me . Helping in this regard highly appreciated ...
    Thanks and regards,
    Swarupa Vanarchi

    Hi
    dont you  have used the os user while calling the FTP_CONNECT FM?
    Hope you are not talking about the user executing the FTP program.
    Else If you are talking about the FTP file creator then its not related to abap as you can handle it by maintaining the user in file name itself.
    May be i am going too far with if and elses here as your question possesses no  clarity.
    Plz elaborate your requirement  before anybody can help.
    Regards
    sateesh

  • Problem in saving a file in FTP server

    Hi,
    I am trying to move one zip file from an FTP directory to another. I use the below code.
    OPEN DATASET gv_fname FOR INPUT IN BINARY MODE.
                    IF sy-subrc IS INITIAL.
                      DO.
                        READ DATASET gv_fname INTO gs_zip_bin.
                        IF sy-subrc IS INITIAL.
                          APPEND gs_zip_bin TO gt_zip_bin.
                          CLEAR gs_zip_bin.
                        ELSE.
                          EXIT.
                        ENDIF.
                      ENDDO.
                      CLOSE DATASET gv_fname.
                      endif.
    *Now for saving this file on the other folder,
    OPEN DATASET gv_arname FOR OUTPUT IN BINARY MODE.
                IF sy-subrc IS INITIAL.
                  LOOP AT gt_zip_bin INTO gs_zip_bin.
                    TRANSFER gs_zip_bin TO gv_arname.
                    CLEAR gs_zip_bin.
                  ENDLOOP.
                  CLOSE DATASET gv_arname.
               endif.
    The file get moved successfully. However, when I download the file on to my desktop and when I unzip it, it gives an error message "Cannot open the file; it does not appear to be a valid archive'.
    I also notice that there is a size difference between the original and the archived file as in the picture below.
    I tries using the SCMS_UPLOAD and SCMS_DOWNLOAD function modules to achieve this and it works perfectly.
    However, I did not find any documentation for these function modules and I am not sure if I can use them. I intend to run this program in the background mode.
    Any help will be greatly appreciated.
    Thanks,
    Ajith Cheruvally

    Fixed it: Delete preferences.
    First, I was wary about deleting preferences because I used EasyFind to search for "textedit" and found many files in different folders throughout the OS and user folders.  I feared deleting the wrong thing.
    So with the EasyFind window open with the search results sorted by date last changed, I opened TextEdit and then its preferences and made a minor change, saved it and then closed the app.
    I then ran EasyFind again sorting by date last changed and the top two items were the only preference files that were changed.  Deleted those two and now all is well.
    EasyFind is freeware found in the App store.  It's invaluable.  I use it often.

  • Unzip files from FTP using  ABAP

    Hi All,
    I have the a requirement to unzip certain files from ftp and transfer the extracted files to another directory in ftp.
    Searched  (Re: Unzip file;)  in SDN but didnt find the perfect solution
    Appreciate the help.
    Regards
    Siva

    You can use IndexOf function
    see this example
    http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Appending the Destination File through FTP using PL/SQL

    One of my requirement is I have to do the ftp using PL/SQL (My database is 10g on LINUX) ,
    What I know is i can do the FTP using the UTL_TCP and UTL_FILE packages that oracle provides, but inthis case requirent is ftp and append "APPEND" to the destination file.
    this is the command I use to FTP mannualy ....
    cd C:\Temp\Source\
    ftp
    open 999.99.99.99.99
    loginID
    ThePasWord
    ascii
    append CSOURCE.DAT M:\Temp\Destination\CDESTINATION.DAT
    close
    quit
    What I want to know is how to do this through PL/SQL
    I will appreciat this ...

    I got It...
    At
    http://www.oracle-base.com/articles/9i/FTPFromPLSQL9i.php
    Only Replace
    send_command(p_conn, 'STOR ' || p_file, TRUE);
    With
    send_command(p_conn, 'APPE ' || p_file, TRUE);

  • Urgent : Help me Upload a file via FTP using URL

    Hi
    I am having a problem with an error (The system cannot find the file specified)
    The files FTPPut.java and TESTING.txt are both in /src directory.
    import java.net.*;
    import java.io.*;
    public class FTPPut {
         public static void main(String[] argv)throws Exception{
         int BUFFER = 1024;
         URL url = new URL("ftp://ftp.scit.wlv.ac.uk/pub/");
         File filetoupload = new File("TESTING");
         URLConnection urlc = url.openConnection();
         byte data[] = new byte[BUFFER];
         FileInputStream fis = new FileInputStream(filetoupload);
         BufferedInputStream bis = new BufferedInputStream(fis, BUFFER);
         OutputStream os = urlc.getOutputStream();
         int count;
         while ((count = bis.read(data, 0, BUFFER)) != -1) {
         os.write(data, 0, count);
         System.out.println("uploaded sucessfully...");
         bis.close();
         os.close();
    Exception in thread "main" java.io.FileNotFoundException: TESTING (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at FTPPut.main(FTPPut.java:11)
    Edited by: AceV on Jan 10, 2008 7:28 AM

    import java.net.*;
    import java.io.*;
    public class FTPPut {
         public static void main(String[] argv)throws Exception{
         int BUFFER = 1024;
         URL url = new URL("ftp://ftp.scit.wlv.ac.uk/pub/");
         File filetoupload = new File("TESTING");
         URLConnection urlc = url.openConnection();
         byte data[] = new byte[BUFFER];
         FileInputStream fis = new FileInputStream(filetoupload);
         BufferedInputStream bis = new BufferedInputStream(fis, BUFFER);
         OutputStream os = urlc.getOutputStream();
         int count;
         while ((count = bis.read(data, 0, BUFFER)) != -1) {
         os.write(data, 0, count);
         System.out.println("uploaded sucessfully...");
         bis.close();
         os.close();
    }

  • Saving Excel File After Upload Using ADI

    Hi
    I would like to save the excel file into a shared location after uploading the data using Web ADI in General Ledger.
    Any help would be highly appreciated.
    Thanks,
    Pranab

    984226 wrote:
    Hi
    I would like to save the excel file into a shared location after uploading the data using Web ADI in General Ledger.
    Any help would be highly appreciated.
    Thanks,
    PranabPlease post the details of the application release, database version and OS.
    What do you mean by shared? Do you mean on the application tier node?
    Thanks,
    Hussein

  • FTP using GUI_UPLOAD file.Its showing error like 'FILE NOT AVAIABLE''.

    Hi Friends,
    I am calling a file by FTP using GUI_UPLOAD file.
    Its showing error like 'FILE NOT AVAIABLE''
    Below is my sample code.
    I_FILE = 'FTP://10.121.6.61/IPSM/FILE1.TXT'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = I_FILE
        FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = IT_TABLE.
    Pls suggest.

    Hi ,
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = '
    172.19.125.2\flat\G1\meeting.txt'
      FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = '#'
    TABLES
        DATA_TAB                      = itab
    Try this .
    With Regards ,
    M.Sreeram .
    Edited by: sreeram manoharan on Feb 11, 2010 12:47 PM

  • Save File as SVG using Illustrator

    Generous Helper,
    I am trying to save the file as .SVG format using illustrator..
    Openin in notepad the saved file shows the elements and attribute like:
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
      width="800px" height="600px" viewBox="0 0 800 600" enable-background="new 0 0 800 600" xml:space="preserve">
    <rect x="132.286" y="53" fill="none" width="161.429" height="17.857"/>
    <text transform="matrix(1 0 0 1 132.2856 61.52)" font-family="'MyriadPro-Regular'" font-size="12">Name</text>
    <rect x="137.286" y="87.286" fill="none" width="102.143" height="10.714"/>
    </svg>
    I like to see the elements and attributes like:
    <g transform="translate(100,100)">
    <text id="TextElement" x="0" y="0" style="font-family:Verdana;font-size:24"> Name !
    <animateMotion path="M 0 0 L 100 100" dur="5s" fill="freeze"/>
    </text>
    </g>
    The difference between both the files is
    text id="TextElement" , so that I can use this as pointer for data to enter.
    can someone tell me how I can achieve the code no# while saving the file as .SVG using Illustrator.  While writing of my own .SVG file like code # 2 , I can write it and it is very well valid.
    But I want illustrator write me the same style of code. I played around various options but every time I am getting the same style of code ( Code # one) using illustrator.
    Thanks,

    Hi —
    I'm a newbie to the forum reply system, but I try to check in for good info quite often.
    If you are going to work with SVG and text input-output, you should be using the Variables palette and a schema architecture for your data. Start with reading the Help PDF "Data-driven graphics". There are a lot of considerations, up-front decisions and setup to prepare, but the pay-off is worth it. Also see the "About data sets" and "About variable libraries". Since this is an "open standard" there are element and property rules that are out on the XML site (you probably are already aware of these) and can help when swapping one element's name for another if you need to transform the output on the fly. You can actually build database exchanges without paying for a proprietary conversion application by using XML — if both databases are XML-friendly.
    I'm sure if you go out to an XML forum, there are folks out there that can help with the output; once the file is saved as an SVG with the appropriate element names and setup. A helpful hint is not to save with Illustrator editing options. It saves two files then: one in SVG and the other in Illustrator, along with other errata. You can still edit the file without that option by simply opening it in Illustrator at any time, although you will see it has been "dumbed-down" a bit. SVG is cool, but not as mature as it should be and it does odd outputs when there are a lot of layers or clipping paths. If you are using an earlier version of Illustrator, the text can be fractured into individual letters and would need to be re-entered. The KISS method is the best route, although I have seen some awesome animations using SVG. Also, there are rumblings that CS3 and 4 cannot be opened in some other applications... I'm still researching that one.
    Whenever I plan XML text interchange, I approach it as a separate project from the actual graphic like an extension that can surround it. It doesn't matter which you do first, the graphic layout and then the text interchange or visa versa... as long as you see them both as equally time-consuming for the initial set-up. Just because it is easy to type in the text and see it output, doesn't mean it will bend to your needs without a well-thought-out plan.
    Hope this is of some help.
    You may want to check out http://www.svgopen.org and http://www.svgopen.org/2009/ and the latest http://twitter.com/svgopen/ and http://www.planetsvg.com - see who might be  represented from Adobe Illustrator (or not) since they are no longer supporting SVG (this year, anyway).

  • Cannot upload file to FTP

    I'm trying to upload a file via FTP (using Transmit) and keep receiving a message "make sure you have permission to modify". I have read  and write permission. I'm using my macbook and its a file I created. What do I need to adjust on my settings? I also tried using another outside service providing FTP and received a similar message so I'm sure its something with the macbook settings.

    use a reliable FTP client, such as Filezilla (free app) or likewise.
    re-verify

  • Using wildcards (*) in sender file adapter - FTP type

    Hi guys!
    Dooes it work using wildcards in sender file adapter (FTP type(!) (filesystem obviously work))? I tried it and it failed. it works only for exact name..
    I read some articles about FTP and the result is, that ftp work always only with 1 file, so I'm wondering, if this is possible.
    Thanks for info!
    Olian

    Thanks for all replies..
    I know of course, that * can be used, I use it in many scenarios too. But on a FileSystem. It is not working if the sender type is FTP.
    *, ., *.dat, ...  nothing like that works..  Just exact file name.
    I am able to pick up file, if I specify it's exact name, so there should be no problem with permissions..
    Please, I'd appreciate one reply with comfirmation: yes, we are using asterisk (*) , we access source files via FTP and they are processed.
    Is there anybody with this experience, that it works?
    Thank you!
    Olian

  • How to get file from FTP Server using File Control

    Hi,
    Any one did getting file from FTP Server?
    Please let me know any one help me.
    I would need to get file from FTP Server.
    Thanks,
    Madhu

    Yes I have done that. But In FTP Server I cannt read file, because no previliges. Only I need to copy file from FTP Server to local server then only I can read that file.
    I tried all options using FileConrol(getFiles(),read()).
    getFiles() - It wont copy the file, it give information about file.
    read() - I dont have previliges to read the file.
    Please tell me any other procedure would be there for getting file from FTPServer.
    Thanks,
    Madhu

  • How to send multiple files in parallel using ftp with single connection

    Hi.
    i have written code for file upload manager using ftp..
    it perfectly working with sequence file uploading in single connection..
    And i tried to upload multiple files with parallel processing in a single connection.... but it is not working properly.. i also used thread concept
    but single file only transfered and connection refused...
    my code here...
    //////////////////// main class //////////////////////////////////////////
    ftp.connect();
    ftp.login();
    String [] archivos = new  String[100];
                                      File dir = new File("C:\\Files Uploading\\");
                                       archivos = dir.list();
                                       for (int s=0; s<archivos.length;s++)
         //Start Data Transfer Here
         new DataTransfer(archivos[s]).start();
                                       Thread.sleep(1000);
    /////////////////////// thread class ////////////////////////////////
    class DataTransfer extends Thread
          String FileName="";
          String LocalPath="",RemotePath="";
           public DataTransfer(String fname)
         FileName = fname;
         LocalPath = "C:\\Files Uploading\\" + FileName;
         RemotePath = FileName;
         System.out.println(LocalPath);          
            public void run()
                        System.out.println("DataTransfer Started");
         /File Transfer Here
         try
               FileInputStream input = new FileInputStream(LocalPath);
                               Ftp_Client.storeFile(RemotePath,input);
         System.out.println("Successfully sent : " + RemotePath);
         catch (Exception exc)
              System.out.println(exc.getMessage());
              System.out.println("DataTransfer Ended");
         }otherwise tell me any other alternate way

    And i tried to upload multiple files with
    parallel processing in a single connection....
    but it is not working properly.FTP isn't a multiplexing protocol. How could it work at all?

  • Unable to save PDF's from Internet Explorer. Error "The document could not be saved. The disk you were saving to or the disk used for temporary files is full. Free some space on this disk and try again, or save to a different disk."

    We are currently in a published desktop environment in Citrix XenApp 6.5.  Server is running on Windows 2008 R2.  Users are not able to save PDF's into the redirected folders (ie Desktop or My Documents).  Exactly same issue described in "The disk you were saving to or the disk used for temporary file is full...."  Anyone has any suggestion??

    Same problem here. Any ideas?
    Saving with Shortcut "CRTL+SHIFT+S" works just fine.
    Using IE 11.0.9600.17728 and Adobe Reader 11.0.10

Maybe you are looking for