Receive file by FTP (Server is restricted to get command only)

Dear all,
I would like to receive a file from a very special FTP server. And I am not sure if the File Adapter is able to handle this:
The FTP server I wand to connect to is a very special one. This server allows only to log in and to receive a specific file. This means that the only allowed command is
get file.dat
It is not possible to change directory or to get the directory listing. When the file was received it is not necessary (and not possible) to delete the catched file. The FTP server notices that the file was received and removes its content. This means that the file will not be removed. So it is always possible to get the file. But in most cases the file is empty (but that should not be a problem - the File Adapter can handle or ignore empty files.).
From my point of view it seems that SAP XI 3.0 SPS17 does not support to interact with this special kind of FTP Server. In RWB I can see the following error message:
"An error occurred while connecting to the FTP server 'XXX.XXX.XX.X:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 500 -3002 : command : invalid command'. For details, contact your FTP server vendor."
I connected to this FTP server manually. I get this error message when I try a command which is not allowd by the FTP server ("ls" for example). So I guess that SAP XI uses "ls" before catching the file.
Do you have an idea how I can configure the File Adpater to work with this FTP Server properly?
Many thanks
Michael

Hi Michael,
This is a tricky one. The set of required ftp commands that need to be supported to be RFC compliant is quite small (see RFC 959) but it seems that the file adapter assumes a certain minimum set (including CWD and LIST, both of which are optional).
There are several options, varying in complexity immensely:
1) Scripting the transfer process so that files are transferred to a local filesystem, from where they can be processed by XI
2) Adjusting the "special ftp server" so that it ignores commands it doesn't understand - I'm guessing this isn't possible?
3) Creating a "more relaxed" ftp JCA adapter, one that doesn't assume a certain minimum set of commands
4) Something else I'm not thinking of so early in the morning
Hope that helps a little...
Regards, MJ

Similar Messages

  • Urzent: Delete files in FTP server using FTP receiver adapter

    Hi Experts,
    We are doing 2 asyncronous scenarios. frst scenario should delete existing file and place the request file. Second scenario should pick(delete) response file and delete request file it placed also.
    Scenario 1 : File(NFS) to FTP  (Asynchronous)
    Scenario 2: FTP to NFS  (Asynchronous)
    Scenario 1: (Receiver FTP Adapter )
    step-1: PI has to delete all existing files in FTP server
    step-2: PI has to place Request file in FTP
    Scenario-2: ( Sender FTP Adapter)
    step-1: PI has to Delete request file i FTP server
    Step-2: PI has to pick and delete response file in FTP server
    Doubts:
    How can we do above steps in PI
    Thanks,
    Murali

    Hi Krish - For scenario -1 You have to make use of the OS commands to delete the files on FTP server before placing the request file.
              -> write some script which wil connect to the FTP server and delete the files.
              -> call that script from the file adapter "using execute OS commands" option
    For scenario -2 :
    pick both the files(request and response) and set the processing mode to delete..
    during the receiver determination, process only request files(based on filename/content)

  • Receiver-File-Adatper creates empty files on FTP-Server

    Hi experts,
    I have a problem with my IDOC-to-File-scenario. My Mapping converts IDOCs to XML-files. Then the xml-files should be send to a ftp-server in New York. but only the filename is created on the ftp-server in New York. but without any content.
    At first I tested the scenario with a ftp-server in our company. and it works. the files and the right content were created. so the scenario and the mapping are working correctly.
    Have you any idea what the problem is?
    Thanks and best regrads
    Christopher

    Dont use anonymous login. Please provide user name and password.
    Also go to adapter engine queue. There see the details description of your message. There it will specify which file got created, on which FTP server, in which folder and also how many bytes XI has transferred. If possible let me know these details.
    Also try uploading any other file to FTP.
    For this got to Command prompt.
    1. open (o) IP ADDRESS
    2. User name
    3. Password
    4. go to specified folder
    5. Use PUT command to save the file on FTP server.
    If after all these empty files is getting created then contact your system administrator and tell him to check firewall settings. Because there are few parameters which allows data transfer.
    Because if firewall problem is there then u wont be able to put a file manually on that FTP server.
    Let me know the output.
    Warm Regards,
    Gouri

  • How to read XL file from FTP server

    Hi all,
    I have a requirement like to read file from FTP server using path
    ftp:
    10.212......\DTR\DTR_ Accounted_Out
    and again save  other file in same location ,
    to doing this RFC connection is required?
    give a  procedure or program to do this requirement ..
    To create rfc for FTP which connection type can i use ?
    Give complete settings to create rfc destination

    Hi Rakhi,
    Use the below code to check if you have received the proper data.
    call function 'FTP_SERVER_TO_R3' "Get data as character instead of BLOB
        exporting
          handle         = hdl
          fname          = docid
          character_mode = 'X'
        tables
          text           = chardata.
    If the data is incorrect, it is possible that you are in the wrong directory.
    Use
    call function 'FTP_COMMAND'
        exporting
          handle        = hdl
          command       = 'cd mydir\mysubdir' "cd <space> your path
        tables
          data          = result
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3.
    Regards,
    Jovito.

  • Windows 8.1 Pro - FTP.exe not able to put file to FTP Server

    Hi
    We have replaced our Windows XP environment to Windows 8.1 Pro. Now I have problem with sending files through FTP to very old devices. Devices are runninng FTP Servers. Each time I try to "PUT" file on Windows 8.1 I receive message after some time:
    "Connection closed by remote host"
    If I make the same on Windows XP file is stored on FTP successfully. 
    From Windows 8.1 I am able to upload software only via Filezilla, but I need command line solution like FTP.exe or ncFTP.exe (non of them are able to stor file)
    I have observed in Wireshark, that ftp.exe sends about 80kB of data, waits for some time and then it stops.
    Summary of my problem:
    Source Appl      
    Destination
      Status
    Win XP ftp.exe  
    FTP Server upload ok
    Win 8.1 ftp.exe  
    FTP Server upload failed
    Win 8.1 ncFTP.exe
    FTP Server upload failed
    Win 8.1 filezilla  
    FTP Server upload ok (but no command line solution)
    Win 8.1 environment:
    - standard installation of Windows 8.1 with newest Microsoft patches
    - firewall ports - opened for inbound and outbound traffic
    - no antivirus
    FTP Server on problematic devices:
    - old FTP Server, transfer in passive mode
    I need command line solution tu upload files. Now I am not able to upload 1500 devices as we don't have Windows XP anymore.
    What I have observed, when I type "PUT file" it takes about 20-30 seconds to start transfer on Windows XP or through filezilla.
    Is there any problem with timeout in Windows 8.1 when it transfer files to old FTP server (working in passive mode)?
    Thanks and regards,
    Marcin

    Hi Marcin,
    Here is a thread talking about Windows 8.1 and FTP, see:
    Windows 8.1 and FTP problems
    https://social.technet.microsoft.com/Forums/windows/en-US/db3793a6-2810-464c-af9a-522b05f51ba9/windows-81-and-ftp-problems?forum=w8itprogeneral
    Further, I am currently checking on the issue, if more things found out, I will update here.
    Thank you for your understanding.
    Best regards
    Michael Shao
    TechNet Community Support

  • Receiver file channel-FTP

    Hello All,
    Scenario is Outbound(ECC to FTP).
    Below is the steps in audit log of Receiver file adapter:
    12.07.2011 03:30:07 Information Write to ftp server "AAAA", directory "'DEV'",   file "DEV.OUTPUT>XML".
    12.07.2011 03:30:07 Information Transfer: "TXT" mode, size 55 bytes, encoding ISO8859-1.
    12.07.2011 03:30:07 Information 200 SITE command was accepted
    12.07.2011 03:30:07 Information File processing finished.
    12.07.2011 03:30:07 Information MP: leaving
    12.07.2011 03:30:07 Information The message was successfully transmitted to endpoint <local> using connection File_http://sap.com/xi/XI/System.
    12.07.2011 03:30:07 Information The message status was set to DLVD.
    In step3, It is saying 200 SITE command was accetped. But I didnt mention any UNIX command in my receiver file channel(FTP
    transport protocol).
    Can someone tell me from where is this coming or is it a default one?
    Thanks,
    Regards,
    Moorthy

    Hi
    Please see the DOC for SITE Command:
    SITE command is used by the server to provide services specific to the system. Most of the SITE commands can be used by the admin only. You can get all the available SITE commands by "SITE HELP".
    http://incubator.terra-intl.com/projects/ftpserver/site_cmd.html

  • No Data in PDF file in FTP server

    Hi All,
    I am trying to place a PDF file in FTP server.
    Used
    CONVERT_OTFSPOOLJOB_2_PDF to convert spool to PDF
    SCMS_TEXT_TO_XSTRING
    FTP_R3_TO_SERVER to transfer data to FTP.
    I am able to see PDF file in FTP and no of pages matches with that of R/3 but there is no data in PDF file.

    To get pdf file , you need to set the itcpo-tdgetotf = 'X' and need to pass in the exporting parameter (options in open_form  function module ).Then in close_form function module take all the data of otfdata table into an internal table . Then use SX_OBJECT_CONVERT_OTF_PDF function module to convert it to pdf.
    I will show with an  example.
    tables itcpo.
    DATA: ch_otf  TYPE  STANDARD  TABLE OF  itcoo.
    DATA: w_otf TYPE itcoo.
    DATA: w_pdf TYPE solisti1. "For PDF
    DATA: i_content_txt TYPE soli_tab.   
    DATA: temp1 TYPE sx_format VALUE 'OTF',
            temp2 TYPE sx_format VALUE 'PDF'.
      DATA: c_printer TYPE sx_devtype VALUE 'PRINTER'.
      DATA: w_transfer_bin TYPE sx_boolean. "Content
      DATA: i_content_bin TYPE solix_tab, "Content
            wa_content_bin TYPE solix,
            i_objhead TYPE soli_tab.
    itcpo-tdnoprint  = 'X'.
      itcpo-tdpreview = 'X'.
      itcpo-tdgetotf = 'X'.
    These three parameters need to be passed along with other required parameters
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING form = xformular
                     language = ekko-spras
                     OPTIONS = itcpo
                     archive_index  = toa_dara
                     archive_params = arc_params
                     device = xdevice
                     dialog = xdialog
                     mail_sender        = sender
                     mail_recipient     = recipient
           EXCEPTIONS canceled = 01.
      CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT  = RESULT
        tables
          otfdata = ch_otf.
    LOOP AT ch_otf INTO w_otf.
        CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
        INTO w_pdf.
        APPEND w_pdf TO i_content_txt.
      ENDLOOP.
    converting otf file to pdf file
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
        EXPORTING
          format_src      = temp1        "'OTF'
          format_dst      = temp2        "'PDF'
          devtype         = c_printer
        CHANGING
          transfer_bin    = w_transfer_bin
          content_txt     = i_content_txt
          content_bin     = i_content_bin
          objhead         = i_objhead
          len             = v_len_in
        EXCEPTIONS
          err_conv_failed = 1
          OTHERS          = 2.
    Then open dataset and transfer to ftp of the content of table content_bin(i_content_bin) as shown in above example.
    I think this will be helpful for you

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • How to read .xls file from FTP server t oInternal table

    Hi
    am using the FTP_SERVER_TO_R3 to read xls file from FTP server to internal table
    but the data i get in LT_TEXT is special characters.
    CALL FUNCTION 'FTP_SERVER_TO_R3'
    EXPORTING
    handle = hdl
    fname = f_name "ProdDataFromCRM.xls.
    * CHARACTER_MODE = 'X'
    * IMPORTING
    * BLOB_LENGTH =
    TABLES
    BLOB = lt_text
    * TEXT = lt_text
    EXCEPTIONS
    TCPIP_ERROR = 1
    COMMAND_ERROR = 2
    DATA_ERROR = 3
    OTHERS = 4
    can any one help me out to get the exact data..
    Really appreciate your quick response..
    Thank You

    Hi, if you really retrieve an excel file, you can not see the data in ABAP. You may see them in Excel. For this you may use
    CALL METHOD document->open_document_from_table
    of the interface i_oi_document_proxy for OLE objects. You can access the data with reference to the interface i_oi_spreadsheet.
    Please check [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf] for details.
    But, who knows, perhaps you want "And Now For Something Completely Different".
    Regards
    Clemens

  • Need to copy .txt file from FTP server and downloaded on local server directory.

    I need to figure out a way to copy .txt file from ftp server in local server directory using sql jobs.

    Below links will help achieving it:
    https://www.virtualobjectives.com.au/sqlserver/ftp_scripts.htm
    http://www.mssqltips.com/sqlservertip/2884/sql-server-integration-services-ssis-ftp-task-for-data-exchange/

  • Problem in download file from FTP server

    Hi
    I want to download a file from FTP server for that i am using the apache FTP module but i am not getting how to download a file with that api i can dispaly the list of files and folders but not able to download the file or folder can any one help me in this
    Thanks
    Ninad

    Hi
    I think you miss understood something I am writing a program to download the file in Java where i have used the jakarta.apache api for that and getting problem in that bellow is the code where I have written to print the directory & file names but I don't know how to download the file
    FTPClient ftpConnection = new FTPClient();
    ftpConnection.connect(host);
    ftpConnection.login(FTPConnection.userName,FTPConnection.password);
    FTPFile fileList[] = ftpConnection.listFiles();
    for(int i=0;i<fileList.length;i++)
         System.out.println(fileList.getName());
    thanks
    Ninad

  • 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

  • Reading a file from ftp server

    Hi
    I am able to put file on ftp server using ftp adapter.But same settings are not working while polling file on ftp.
    Do i need to do some settings for get operation??

    Hi,
    Check the file permissions and for testing give all read/write/execute permissions to the file to be read from FTP. Also check the file modification date of the file.
    Check for the logs at 2 places for any error messages:
    - SOA server diagnostics logs
    - FTP server logs
    You can also enable the FINEST level of Adapter logs for adapters and see for the detailed errors in the diagnostic logs.
    FMW Console > right click soa-infra > Logs > Log Configuration > expand oracle.soa > set Trace32 : FINEST for oracle.soa.adapter
    Regards,
    Neeraj Sehgal

  • [HELP] Download file from FTP server

    hi,
    I want to write a java program that can download and upload files from ftp server. Currently I only manage to upload a file to ftp server but i cant download file from ftp server. Here is the source code that only allow user to upload file. Anyone can give me some guidelines so that my program can download and also upload file? thx.
    import java.io.*;
    import java.net.*;
    public class FTPUpload {
    private static final int CTRLPORT = 21;
    private static Socket ctrlSocket;
    private static PrintWriter ctrlOutput;
    private static BufferedReader ctrlInput;
    private static byte[] localHostAddress;
    public final static String DIR = "C:\\zip\\";
    public static void main(String[] args) {
    try {
    String host = "192.168.1.1";
    String loginName = "testuser";
    String password = "password";
    String dirName = "/home/testuser";
    String fileName = "hello.zip";
    ctrlSocket = new Socket(host, CTRLPORT);
    localHostAddress = ctrlSocket.getLocalAddress().getAddress();
    ctrlOutput = new PrintWriter(ctrlSocket.getOutputStream());
    ctrlInput = new BufferedReader(new InputStreamReader(ctrlSocket.getInputStream()));
    ctrlOutput.println("USER " + loginName);
    ctrlOutput.flush();
    ctrlOutput.println("PASS " + password);
    ctrlOutput.flush();
    ctrlOutput.println("CWD " + dirName);
    ctrlOutput.flush();
    ctrlOutput.println("TYPE I");
    ctrlOutput.flush();
    FileInputStream fis = new FileInputStream(DIR + fileName);
    Socket dataSocket = dataConnection("STOR " + fileName);
    OutputStream outstr = dataSocket.getOutputStream();
    int n;
    byte[] buff = new byte[1024];
    while ((n = fis.read(buff)) > 0) {
    outstr.write(buff,0,n);
    dataSocket.close();
    fis.close();
    ctrlOutput.close();
    ctrlInput.close();
    ctrlSocket.close();
    }catch (Exception e) {
    e.printStackTrace();
    private static Socket dataConnection(String ctrlcmd)
    throws IOException,UnknownHostException {
    String cmd = "PORT ";
    ServerSocket serverDataSocket = new ServerSocket(0,1);
    for (int i=0;i<4;i++) {
    cmd = cmd + (localHostAddress[i] & 0xff) + ",";
    cmd = cmd + (((serverDataSocket.getLocalPort())/256) & 0xff)
    + ","
    + (serverDataSocket.getLocalPort() & 0xff);
    ctrlOutput.println(cmd);
    ctrlOutput.flush();
    ctrlOutput.println(ctrlcmd);
    ctrlOutput.flush();
    Socket dataSocket = serverDataSocket.accept();
    serverDataSocket.close();
    return dataSocket;
    }

    Or just use a java.net.URL("ftp://...) ..., get its input stream, and away you go ...

  • Upload XL file from FTP server

    Hi All,
    Can anybady help me, how to upload Excel file from FTP server.
    Thanks
    Sri
    Edited by: srikanthn on Apr 14, 2010 6:31 PM

    Hello
    How about using SAPFTP?
    I hope SAP note 130106 will guide you on this.
    Thanks
    koju

Maybe you are looking for