Receiver File/FTP, SFTP, binary, endSeparator for CRLF ?

We are planning an interface using the Receiver File/FTP Adapter, using SFTP in binary mode.
The SAP PI runs on Unix, the other applications runs on Windows.
Can NameA.endSeparator be used to ensure that every line in this file ends on CRLF?
(As you know, Windows has the habit of ending lines in text files with CRLF - carriagereturn-linefeed, whereas Unix uses a singe LF - linefeed, also known as newline or nl).

Yes it can be done with '0x0D''0x0A' value which represents the CR and LF respectively...
which has been implemented succesfully in our interface...
HTH
Rajesh

Similar Messages

  • Sending/receiving files using SFTP

    Hi,
    Is there a way to use the Secure File Transfer Protocol (SFTP) in ABAP to send/receive files?
    I already used the FTP functionality from the function group SFTP, but I'm honestly not sure whether ABAP also handles the secure version of FTP.
    If there is this functionality, please provide me the necessary function modules, ...
    Thanks in advance
    Bye,
    Timo

    FTP functionality woks fine in ABAP. Below is some code which can be used for FTP access to send/receive files.
    Initially, get values for the below fields
      DATA: l_user(30) TYPE c VALUE <userid>,
            l_pwd(30)  TYPE c VALUE <password>,
            l_host(64) TYPE c VALUE <host string>,
      DATA: l_slen     TYPE i,
            l_error,
            l_pwd(30)  TYPE c.
      CONSTANTS: c_dest TYPE rfcdes-rfcdest VALUE 'SAPFTP',
                 c_key  TYPE i              VALUE 26101957.
    connect to ftp server
      l_pwd = p_pwd.
      l_slen = STRLEN( l_pwd ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = l_pwd
          sourcelen   = l_slen
          key         = c_key
        IMPORTING
          destination = l_pwd.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'Connect to FTP Server'.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = l_user
          password        = l_pwd
          host            = l_host
          rfc_destination = c_dest
        IMPORTING
          handle          = w_hdl
        EXCEPTIONS
          OTHERS          = 1.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR : w_outfile, w_file_count.
    concatenate <directory> <filename> to field.
    MOVE field to w_outfile.
    PERFORM download_to_ftp TABLES <int'table>
                            USING w_outfile.
    FORM download_to_ftp TABLES it_tab
                         USING l_string TYPE char64.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          handle         = w_hdl
          fname          = l_string
          character_mode = 'X'
        TABLES
          text           = it_tab[]
        EXCEPTIONS
          tcpip_error    = 1
          command_error  = 2
          data_error     = 3
          OTHERS         = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING invalid_output_file.
      ENDIF.
    Above is used to send.
    For receiving use
      CALL FUNCTION 'FTP_SERVER_TO_R3'
        EXPORTING
          handle         = w_hdl
          fname          = l_string
          character_mode = 'X'
        TABLES
          text           = it_tab[]
        EXCEPTIONS
          tcpip_error    = 1
          command_error  = 2
          data_error     = 3
          OTHERS         = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING invalid_output_file.
      ENDIF.
    Hope this will help U.
    Pl. award appropriate points.

  • Quality of service in Receiver file/ftp adapter (SAP PI 7.1)?

    Hi,
        We are building an IDoc to File scenario in SAP PI 7.1, where a single incoming idoc will create three different output files. Also files must be created in target server in a specific order.
        Our first idea to ensure that files would be created following a specific order was that Message mapping (in Java) build target payload with all three files following expected sequence.
        In addition, receiver file/ftp adapter is setup with a dynamic variable to create each file with a different filename adding also timestamp.
        Testing the scenario, we see that three files are created in target server but when we sort them by creation date, it seems they don't follow always same sequence.
        Sometimes adapter creates File1, File2, File3; next time it created File2, File1, File3 and so on.
        Our problem is that files must be created always with a specific order and we cannot use BPM. Does anyone know if a receiver file/ftp adapter can be setup to create files following specific sequence (EOIO)?
        I know that sender file/ftp adapter can be setup with a quality of service, but I didn't find anything similar for Receiver file/ftp adapter.
        Suggestions will be welcome.
    Kind Regards,
    Aitor

    Hi,
         First, thanks all of you for your quick answers. They were helpful because we learnt a new configuration setting.
         We tried your suggestions but they didn't really fix our problem.
         Finally interface has been re-designed and we will not have to apply this logic, so no issue from our side.
         However, let me continue with this topic in case that somebody else will have the same issue, then it will be able to review this thread.
         When adapter created the files in the target directory (windows server), files had the expected timestamp in each filename. However, if we sorted windows directory contents by "Date Creation", files were sorted different that timestamp shows in the filename.
         For example, adapter created following files:
    File1_20090325-115117-169
    File2_20090325-115117-174
    File3_20090325-115117-180
         But when we sorted windows folder contents, files were sorted as follows:
    File2_20090325-115117-174
    File1_20090325-115117-169
    File3_20090325-115117-180
         It seems that timestamp was pre-assigned by the adapter, but when adapter created the files, it did it with a temporary name and finally assigns the filename. If a file size was bigger than other, maybe it takes more time and windows creation date is higher.
         If so, it means that adapter is not following same instructions as itu2019s indicated in "maintain order at runtime" checkbox.
         Do you know if there is any way where we can push also the order in the adapter as we did in interface determination?
    Regards,
    Aitor

  • New-line Character for a file opened in BINARY mode for O/P

    Can anybody please tell me how to put a new-line charcter for each record in a file opened in Binary mode for O/p. I cant use text mode  for other reasons in my scenario.
    DATA: l_outdata TYPE xstring.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    Application logic to populate l_outdata
    TRANSFER l_outdata TO file.
    Any help, or attempt towards it will be duely rewarded,
    Thanks in advance,
    Sujit.

    hi sujit,
    1. how to put a new-line charcter for each record
    but how will you decide, at which POSITION,
    to put the new line character, if u have opened the file in binary  mode.
    2. However, if u know the exact positions(s),
      u can use  CL_ABAP_CHAR_UTILITIES=>CR_LF
      to insert the new line character,
    regards,
    amit m.

  • Configuring the Receiver File/FTP Adapter !!

    Hi
    I am trying to configure the Receiver file adapter using the J2SE adapter engine(Please note , NOT the J2EE adapter engine).I see a prerequisite for configuring as below
    "The address (HTTP port and URL) where the adapter can be contacted from the Integration Engine".
    What values are to be specified and how can they be validated ?
    I could see an example given in the Docs saying below,
    If i specify , say for example,
    "XI.httpPort=1234 and
    XI.httpService=/file/Receiver, the end point address of the file/FTP adapter in the Integration Engine must be specified as follows:
    http://<fileadapterhost>:1234/file/Receiver"
    Can anyone explain what exactly is this endpoint address and where should it be specified/referred to ?
    Thanks
    Saravana

    Hi,
    "http://<fileadapterhost>:1234/file/Receiver"
    this adress refers to an end point with the end point type "xi-connectivity" in the integration directory (ID)which refers to the settings in the file adapter (httpPort=1234 and XI.httpService=/file/Receiver)
    1. you specify these adress in the file adapter (outbound)
    2. you refer to these adress in the ID (Receiver System End points)
    every file adapter should have an own port, because you can not specify two identical ports in two fileadapters.
    hope I could help you,
    michele
    Message was edited by: Michele Mangieri
    Message was edited by: Michele Mangieri

  • How to give a dynamic File Name for Receiver File/FTP Adapter.

    Hi Experts,
        I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out"  & in File Consturction mode i have given as "Add Time Stamp".
        therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
    where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
        How to do this ?
        for your info we are using ABAP Mapping.
        Pl help me
    Regards,
    Umesh

    Hi Umesh,
          Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
    And refer the below weblogs for Variable Subtiutuion File Name Scheme
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
    Hope this way would be solve u r problem.
    Cheers
    Veera
    >>>Reward points, if it is needful

  • Host Throttling on receiving files using SFTP

    Hello,
    We have this problem in BTS2006 and now we migrated to BTS2013 and we still have the problem.
    Problem: We are using nSoftware SFTP adapter. Sometimes the host handler gets into idle state on some receive locations. It will not pickup the file until I restart the host instance. We have several RLs running on that particular host instance and they
    all are getting bounced when we restart the host instance. This is happening only on SFTPs. There is no guarantee that the file is delivered successfully. Most of the times business calls us stating the file is not received. The host create 64/32 bit if that
    matters. We have almost 200 interfaces running on each host instances not sure if that matters. I can create more hosts if needed but that would cost some system resources  and thinking of not to do.
    Any help will be greatly appreciated.
    Thanks in advance.

    Since it might be inherited with the software/or volume you migrated from 2006 to 2013, it won't solve automatically just migrating BizTalk version. 
    Did you find out the throttling condition? I would suggest to have a look in to the link http://msdn.microsoft.com/en-au/library/aa559893.aspx which could be the starting point to look into for detecting the catch. 
    I have personally not used nSoftware SFTP adapter but I would suggest using separate host handler for suspected (victim) SFTP send ports and check the figures as per the conditions you identified. Since you already have 2013, it has very nice dashboard (right
    click on the host and go to setting) for you to play with figure. 
    If you share your volume/size of message and what the core process is, probably you would get better suggestion.
    Also worth looking into Host
    Throttling Performance Counters.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • Receiver File/FTP Adapter

    Hi,
    I want to take in a message packet and output it to a file.
    You can dump the XML out by simply choosing the "File" message prototcol. However, I don't want the XML. I want the data. For example if the inbound interface message type is: 
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_BalanceExtractHAPS_ForFTP xmlns:ns0="http://gcc.access.com/360ToHaps">
      - <Body>
           <Reference>PCN123456</Reference>
           <Balance>65.50</Balance>
           <BalanceSign>+</BalanceSign>
        </Body>
    </ns0:MT_BalanceExtractHAPS_ForFTP>
    I want an output file with 1 record as follows:
    PCN123456,65.50,+
    Fairly sure you have to use the FIle Content Conversion message protocol but I have a couple of questions:
    1. What do you put in File Name Scheme ?
    2. Would the following Content Conversion paramaters be used to give me comma separated output ?
    Body.fieldSeparator has a value of ","
    Body.fieldName has a value of "Reference,Balance,BalanceSign"
    Any help would be much appreciated.
    Cheers,
    PaulC.

    For File Naming Scheme, put *
    For parameters:
    .fieldSeparator = ','
    .endSeparator = u2018nlu2019
    .fieldNames     =  list of field names in each record
    All values are including quotes.

  • Unzip file using operating system command in file/ftp receiver adapter

    Hi,
    I'm wonderdering how to unzip a zip-file in the receiver file/ftp adapter. I know it is possible to do it using the 'Operating system command' feature, but somehow the command I use seems to be ignored! (I'm using SP14, unix).
    The command I entered is quite simple: unzip %F (also tried the %f, but i guess it doesn't really matter wich on I use).
    Is it possible that I'm unzipping to another directory than the one i expect? the unzip should be performed to/in the current directory, and assumingly current directory is the one stated in the 'Target Directory', right?
    Hope someone can clearify this issue for me.
    Best regards,
    Daniel

    Hi Daniel,
    It seems to me also, that the files are being unzipped to a different location than what you are expecting. The OS command might getting executed in some default location(i am trying to fnd that out)on the server and not in the target directory of the channel(It seems logical to me)....
    If you have time...pls try this out & see whether this would help...
    Have a shell script written with the following commands in them
    cd <path to target directory>
    unzip $1(filename from the channel)
    and in the OS command in the Channel give....
    <absolute path to the .sh file> %F
    Thanks,
    Renjith.

  • Add counter in FTP receiver file adapter

    Hello,
    I have sen that in a File System (NFS) you can add a counter to the filename, but I don't found this possibility when I put File Transfer Protocol (FTP), I only see to add timestamp or message id.
    There is some possibility to add the counter in the FTP like in NFS?
    Regards,
    Xavier.

    Hi,
    Unfortunately, the functionality to add a counter is available only with NFS and not with FTP. If you want to achieve this, you will probably have to use variable substitution to dynamically get the counter from a field in the payload. The counter can be incremented in the mappings.
    For info on variable substitution: <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm">Configuring the Receiver File/FTP Adapter</a>
    Regards
    MAnish

  • File/FTP adapter, outbound channel, content conversion, UTF-8 (Unicode)?

    We would like to send "delimited" files to another application (tab-delimited, CSV, ... - the other application does not support XML-based interfaces). Obviously we will have an outbound channel that uses the file/FTP adapter and the data will be subjected to "content conversion".
    The data contains names in many languages; not all of this can be represented in ISO Latin-1, much less in US-ASCII. I suppose UTF-8 would work. The question is: how is this handled by the FTP protocol? (considering that the FTP client is part of the SAP PI file/FTP adapter and the FTP server is something on the "other" machine)

    Hi Peter,
    you can maintain the file encoding in the outbound adapter. See [Configuring the Receiver File/FTP Adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm]
    For your requirements "utf-8" sounds pretty fitting.
    Regards,
    Udo

  • Script Component WebService Binary code for the script is not found

    I am using SSIS 2012 to access a Public Web Service
     http://marketinformation.natgrid.co.uk/MIPIws-public/public/publicwebservice.asmx
    However, when adding reference to WebService (not Service Reference),
    I receive the dreaded msg "Binary code for the script is not found"
    I have spent an age ploughing through the forums.
    Many replies seem to suggest not using Script Component to acces WebService.
    Should I write a .NET app  ?
    Any thoughts how I should proceed would be most welcome.
    thanks JohnJames

    Hi JohnJames,
    If I understand correctly, you already add this public web service via Add Service Reference option in the Script Component. Then you receive the error message when you trying to call the bindings and Contract settings stored in app.config file to access
    the web service.
    Please note that we cannot all the web service normal way as SSIS Script Component task doesn’t recongnise the app.config file. To fix this issue, we should define the BINDINGS via code rather than depending on the App.config file. For more details, please
    see the following blog:
    http://social.technet.microsoft.com/wiki/contents/articles/22587.consume-webservice-via-ssis-script-component.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Problem with Receiver File adapter

    Hi
    I have a problem with receiver file FTP adapter, while writting file in target folder, connection is failing, after retries, it writting file again. How to avoid this situation, is there any way to write the leftout part in the file.
    VS

    Hi
    Thank u all,  Problem is solved, i changed write mode to Over write existing file. It is working fine.
    VS

  • FTP Receiver File adapter  -- CRLF In output File in Windows environment.

    Hi All,
    Idoc to File : Receiver File adapter.
    I use the endseparator 'nl' and the output file is coming correctly with NFS and It is not working when we are doing with with FTP.
    Tested with NFS (Unix environment)
    I used the endseparator 'nl' and the output file is coming with CRLF.
    Tested with FTP (Windows environment)
    When I tested the same the output file is coming with LF.
    I tried by using the module "SAP XI Sample/ConvertCRLFfromToLF" which will convert from LFToCRLF.But it is serving my purpose.
    Can anyone please suggest how I can get the CRLF in the file while putting in the output directory which is in windows environment.
    Thanks
    Seema

    Do not mention endSeparator in content conversion parameters...by default XI puts newline as endSeparator
    It should work for NFS and FTP on Windows

  • Filename for flat file using J2EE FILE FTP Receiver adapter

    Hi there,
    I am struggling to do the following:
    I have a J2EE File receiver that sends a file with a specific name to a FTP destination. I define the target filename in my graphical mapping using certain criteria and a incremental number. In my adapter I use variable substitution to select that value in the payload as the filename. Up to this point everything works fine.
    The problem is that I convert the payload to a flat structure using xslt before writing it out and because of that the adapter cannot find my value as defined in the variable I use for the name.
    Now, obviously if I move the xslt module after the CallAdapter module, the file won't be converted to a flat structure.
    Can anyone give me advice on how I can do the flat conversion <u>and</u> the specific filename from the payload?
    Thanks in advance,
    Johan

    Hi,
    Instead of using variable substitution, use adapter specific identifiers to set the file name in mapping.
    Ref:/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Jai Shankar

Maybe you are looking for