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

Similar Messages

  • FTP Receiver Adapter.

    Hi All,
    From XI I need to FTP file to outer system using
    FTP Receiver Adapter
    Now due to security reason my client wants to use FTPS
    I checked in FTP Receiver Adapter -- there is an option
    Connection Security -- FTPS (FTP Using SSL/TLS) for Control Connection.
    Can I select this option and use like simple FTP Receiver Adapter?
    Please tell the process/docs for it.
    Regards
    <Moderator note: Subject edited. Please do not use 'Urgent'. See the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for further info.>
    Edited by: Mike Pokraka on Jul 25, 2008 8:47 AM

    Hi,
    check some links on FTPS.
    FTPS Sender and FTPS Receiver adapter. Pls help
    SFTP vs. FTPS in SAP PI
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/964f67ec-0701-0010-bd88-f995abf4e1fc
    Regards,
    Phani

  • Use temporary file in FTP receiver adapter

    Hi guys,
    I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
    What is the location of this temporary file?
    Is it deleted after "normal" file is created?
    Thanks a lot,
    Olian

    > I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
    Some times when you create the file on your target dir then if there is another application looking for same file is quite faster to pick the file before it is complety written on target dir then in this situation using temporary file option is very helpful. What it does, it simply creates the file first by using temporary name once all bytes or bits has been transfered then it creates the original name and the temp file get deleted.
    > What is the location of this temporary file?
    Same location, where your original file is suppose to be written.
    > Is it deleted after "normal" file is created?
    Yes.
    Regards,
    Sarvesh

  • How to get the filename in mapping when using sender File adapter?

    hi Experts,
       I have scenario where XI reads the input file using Sender file adapter.
       The file name is configured in the communication channel.
       In my message mapping it is possible to read this file name?
    Thanks
    gopal

    Hi Gpoal,
    Use Dynamic Configuration - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Geetha

  • FTP  receiver adapter does not transfer (STORE) file

    Hello gurus,
    In my scenario I want to transfer files from server X to server Y using FTP.
    To get the files from server-X I use the FTP sender adapter, to put the files on server-Y I user the FTP receiver adapter.
    Getting the file (QoS = EOIO) is not a problem; I see the result is SXM_MONI.
    Putting the file doesn't seem to work; I don't have an error message in SXMB_MONI but the file is not physical stored on server-Y.
    When I monitor server-Y I see that XI connects with the configured user/pwd and even creates the directory when it doesn't exist but the file is not STORED.
    I'm not using the BPE, this is a very simple and basic scenario: what comes in, goes out.
    Can you please advice what might be the cause of the strange behavior?
    Many thanks - Danny

    Hello Michal, thanks for your (very) quick reply.
    this is the result:
    1) adapter monitoring
    <b>Status to be delivered:</b>
    - Message successfully received by messaging system. Profile: XI URL: http://xdsci.cie.etat.lu:53100/MessagingSystem/receive/AFW/XI Credential (User): XIISUSER
    - Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
    - Message successfully put into the queue.
    2) sxmb_moni
    - no error
    3) communication channel monitor
    - Message successfully received by messaging system. Profile: XI URL: http://xdsci.cie.etat.lu:53100/MessagingSystem/receive/AFW/XI Credential (User): XIISUSER
    - Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
    - Message successfully put into the queue.
    - The message was successfully retrieved from the receive queue.
    - The message status set to DLNG.
    - Delivering to channel: FTP_receiver
    - MP: entering
    - MP: processing local module localejbs/CallSapAdapter
    - File adapter receiver: processing started; QoS required: ExactlyOnce
    - File adapter receiver channel FTP_receiver: start processing: party " ", service "xyz"
    Any idea?

  • Filename from payload - FTP receiver adapter

    Hello everyone!
    I have a scenario wherein I need to get the value from a field coming from an IDOC and then give that value as the "filename" of the file that is saved in the FTP folder.
    IDOC > XI > FILE
    For example, if /ORDERS05/IDOC/E1EDK02/BELNR = 620000123
    then I want the name of the file to be saved in the FTP folder to be 620000123.xml
    I understand you may use the 'variable substitution' property in the FTP receiver adapter, but subsequent attempts at trying to configure that property have resulted in errors. Can anyone help me out?
    Warm regards,
    Glenn

    do u have recordset name (root message)
    For Ex: If you want to refer to the field which is bold
    below is your variable substuition:
    payload:root,1,e1,1,e2,2
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
           <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
       </e1>
    </root>
    Similarly
    for your strucutre:
    <MS_MT>
    <order>
          <number>
    the variable substuition would be
    payload:MS_MT,1,order,1,number,1
    you have to give complete XML to arrive to this value.

  • Wrong port in FTP receiver adapter - no errors in message monitoring?

    Hello all
    We're on XI 3.0 SP16 and have created / configured a HTTP XML -> XI -> FTP Server scenario. In the receiver comm. channel (ftp) we had specified a wrong port number and always wondered, why we never got errors in message monitoring. Everything seemed to be processed correctly... but no file arrived on the FTP server (receiver) side!
    After correcting the wrong FTP port number in the receiver FTP comm. channel everything went fine.
    We now encountered a similar problem with a RFC receiver adapter. We're using it in another scenario HTTP XML -> XI -> RFC to SAP R/3 (4.7).
    For some reason it died (red status in adapter monitor) and it was no more possible to do RFC calls from XI to SAP R/3 (normal RFC adapter, NO proxies).
    In XI message monitor everything seemed to be ok but no message arrived till SAP R/3. Nothing in any queue...
    After deactivating and reactivation the RFC receiver comm. channel it worked again BUT ALL PREVIOUSLY SENT messages seem to be lost.
    Is it really the way it works? Does XI integration engine at runtime NOT catch whether or not a RFC or FTP receiver adapter died, thus is not able to tell somewhere in message monitor that a message could not be delivered at all?
    I'm really confused here but hopefully I simply don't understand some easy principles to take into account...
    Our SAP R/3 is on rel. 4.70 with Web AS 6.20. The XI 3.0 plugin is not installed. Do we need to go with server proxies there and use QOS = best effort?!?
    Thanks for some suggestions.
    Best regards,
    Renaud

    Hi Michal
    Thanks... works great for normal XML based messages!
    Now, what if I wanted to pass binary files from one ftp server via BPM to another ftp server in order to enable the transport acknowledgment?
    The files polled from ftp server using the ftp sender adapter are all in binary format (ARJ). No xml data in there. How should the message format look like in BPM for the receiving step? Or: how to make sure not to loose the binary content when passing through BPMs?
    I need this sort of scenario because of the tansport acknowledgment and because I need to have some sort of message splitting (send the binary file over to a second ftp server and additionally send some kind of info message to SAP R/3 regarding thin binary file).
    BTW: in the MessagingSystem/monitor/monitor.jsp I do not see sender / receiver information. Is this normal? It's quite of a bad thing to look inside each message in order to find out what message I'm having in front of me...
    Thanks a lot for your support and patience!
    Kind regards,
    Renaud

  • Can I control  filenaming when archiving  files using the file adapter?

    Hi folks,
    Is there anyway to control the filename used when the File Adapter writes out to an archive?
    Second question, I also need to be able to pass a "filename" to the adapter from an "input file." Is there a way to do this in the file adapter?
    Sincerely,
    lpac

    Hi,
    I have done that with the ftp adapter. In the .xsl file I wrote the following after the <xsl:stylesheet version="1.0" ....> tag:
    <xsl:variable name="INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
    <xsl:template match="/">
    <xsl:variable name="OUTFILENAME"
    select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr:fileName', $INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>
    <opaque:opaqueElement>
    <xsl:value-of select="/opaque:opaqueElement"/>
    </opaque:opaqueElement>
    </xsl:template>
    </xsl:stylesheet>
    To use this with the file adapter, you would have to wirte file where is written ftp.
    Hope this helps,
    Zaloa

  • How to write non-XML data to a file using an OSB FTP Routing?

    Hi --
    Situation ... I need to write non-XML data to a file using FTP. A proxy service retrieves XML and transforms it with XSLT to CSV format, then gives it to a Biz service to file it out, using FTP. Simple.
    Problem ... OSB sends the contents of $body to any service it calls. Because $body is a SOAP document, it has to contain XML. So therefore I have to put my CSV data into an XML element, in order to put it into $body; and this inner element then gets written to the file, which I don’t want. But if I don't enclose my CSV content in a tag, I get "Unexpected CDATA encountered" trying to assign it to a variable.
    There has to be away around this!
    Thanks for your help.
    John Taylor

    Solved. Steps:
    -- Transform the XML to CSV using an XSL transform. Put the CSV data inside enclosing XML elements, and use a Replace action to put the XML element + CSV contents back into *$body*.
    -- Define an MFL transform that only knows about the enclosing XML elements. Use a delimiter of "\n" (hard return).
    -- Route from the proxy service to a Biz service that has Service Type = Messaging Service and Request Message Type = MFL; specify the MFL transform, which will receive the incoming *$body* variable, strip off the enclosing XML element within it, and pass the CSV contents to the FTP service.
    Edited by: DunedainRanger on Nov 29, 2011 9:03 AM

  • How to rename a XML file using the file/FTP adapter

    Dear All,
    I am trying to rename a file using VARIABLE NAME SUBSTITUTION.
    My structure:
    <ns1:MSg xmlns:ns1="http://www.mycomp.inf.br/msr">
      <ns1:MSgVal type="A" Id="188549">
        <ns1:cab>
          <ns1:PO>4500000000</ns1:cPO>
          <ns1:BI>90000000011</ns1:cBI>
        </ns1:cab>
      </ns1:MSgVal>
    </ns1:MSg>
    How do I do to get the value 188549 from the field Id that is into the tag MSgVal?
    I created a variable var1 and my reference is:
    var1 --> payload:ns1:MSg,1,ns1:MSgVal,1,Id@,1
    I am getting the error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Regards,
    Fernando

    Hi,
    Like pinted by Michal, use Adapter Specific Identifers.
    In your mapping set the file name using the code in this link and then in your Receivr File Adapter select the Adapter Specific Identifiers --> FileName .
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Regards
    Bhavesh

  • Unable to Attach file for list item using SP.File CopyTo Method

    Requirement: I have a document library and list, the requirement is i need to take a document from document library and attach to list item in the list using CSOM only.
    Followed technique: to achieve this requirement i followed below methodology
    clientContext = SP.ClientContext.get_current();            
                    webSite = clientContext.get_web();
                    webSite.AllowUnsafeUpdates =true;
                    var list = webSite.get_lists().getByTitle('Documents');
                    item = list.getItemById(3);
                    file = item.get_file();
                    file.checkOut('Comments',1);
                    file.copyTo("xxxxxxx/Lists/Student/Attachments/4/mahesh.docx","1"); 
    file.checkIn('Comments',1);
                    clientContext.load(file );
                    clientContext.executeQueryAsync(Function.createDelegate(this, this.OnLoadSuccess), Function.createDelegate(this, this.OnLoadFailed));      
    Issue: This functionality is absolutely working fine when list item contains at least one attachment, if list item doesn't have any attachments the code is failing. i tried web.AllowUnsafeUpdates also but not working.
    Could anyone please help me on this.... :(
    Thanks in Advance!
    Regards,
    Mahesh Yamana
    Mahesh@SharepointSolutions

    Hi SK,
    Thank you for your reply!
    We are not allowed to use Visual Studio and the same thing we can use in JavaScript, but file stream takes path as one parameter which is physical location of your file system. When you use it some times users might not have access to the file system then
    our code fails.
    Regards,
    Mahesh Yamana
    Mahesh@SharepointSolutions

  • FTP Receiver Adapter is completly ignoring the file content conversionurn..

    Hi,
    i'm picking up a flat file using the NFS adapter, the payload in the message monitoring looks like this:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:MT_FILE xmlns:ns="urn:......">
    <Record>
    <Line>100221120100000000000000</Line>
    <Line>100221120100000000000000</Line>
    </Record>
    </ns:MT_FILE>
    I'm now writing this to an ftp server, message protovol is set to File Content Conversion and the conversion parameters are set to this:
    Line.addHeaderLine     1
    Line.fieldSeparator     #
    Record.fieldContentFormatting     nothing
    Line.fieldContentFormatting     nothing
    Record.fieldSeparator     *
    looks realy weired and is not really what is needed but i changed the parameters dramatically, but none of those conversion parameters are taken in effect.
    The resulting files always looks the same, nor do i get a header line nor do i get the "weired" newline characters. i'm alway getten nl/0X0A as line separator.
    What do i miss?

    > You need to do content conversion for the nodes, not for the recordset.Remove Record conversion parameters and try.
    This is wrong. It is the other way:
    Use parameter
    Record.addHeaderLine     1
    When you want to have a different end-of-line cjaracter, you have to use the correct parameter
    Record.endSeparator
    Sometimes it really helps to look in online help.

  • Vaildating File name with the data in the file using sender file adapter

    Hi,
    Below is the scenario
    1)       Pick up files from a FTP server, the file name is dynamic, how do I put dynamic name in sender file adapter?
    2)       Determine if the user correctly named the file based on data in the file.
    a.       File naming structure that we will be concerned with is <company_code><accounting_time_period>.<extension>
    b.      The company code and the time period in the file name have to match the data in the file.
    i.      For example.  If the file name is 1001_200712.csv and the data in the file is for company code 1005, time period 200712, the file is incorrectly named.  Both values must be correct.
    How do we do this?

    Hi Sachin,
                    As Rightly said by Krishna, You can not put Dynamic name in sender File Adapter .You have to provide the name of the file like "*.txt" in Sender Adapter and at runtime you can access this file name by using following UDF:
    DynamicConfiguration conf  = (DynamicConfiguration) container
      .getTransformationParameters()
      .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    return (valueOld);
    As now you have picked up the file name at runtime.
    Now concatenate source file fields Company_code and Accounting_timeperiod using "_" as delimiter in properties.Also concat the extension .Now you have required file name.
    So using EQUALS standard function ,compare it with File Name fetched at runtime using above given UDF, and pass result as you desire to process further or not or to raise Alert to resend the file.
    Thanks & Regards,
    Anurag Garg
    You can validate this file name in Mapping itself.

  • Reading .MHT Files using Sender File Adapter

    Hi Gurus,
    I have a requirement to read a .MHT file extension with following format .
    File extension is : C:\TEST\DGFAKTFRI.MHT
    File content opens in HTML explorer as follows ...
    ;2333097;800;0;237546;3912875;"2008-09-11";"A";"E";" ";0;"8715  ";0;"8715  ";" ";"0001-01-01";"46994051       ";"DO";0;0;0;,00000;"0597656             ";2333097;"Jette               ";"61922434  ";1;1;348,00;348,00;348,00;25,00;25,00;25,00;25,00;"K";1,0000000;261,00;65,25;261,00;65,25;"Nordjyllands Erhvervsakademi  ";"Boghandel                     ";"Leder: Kim Lemvig Hagerup     ";"Sofiendalsvej 60              ";"Aalborg SV          ";"9200     ";"DANMARK                       ";"72 50 59 80         ";"72 50 59 89         ";"01";"173";"000";"481";"000";"655";"RSRAPPORT OG VIRKSOMHEDSANALYSE THOMSON";"ELKJu2019R & HJULSAGER                      ";" ";" ";" ";" ";" ";" ";" ";,52600;,52600;228;155;21;"9788761922434       ";" ";
    This is just a single record for sample purpose and my file contains line entries with these content .
    Now my question is how do we handle such file extensions ? Do we have to use Module processor ?
    Or any other option is left as i am yet to check directly calling .MHT files using File Adapter.
    Thanks in advance for help.

    Hi Sitaraman
    As per the description given it looks like a flat file with separator as ";". You can do an FCC using file adapter and give it a try. if complete file is uniform as look above then it will work fine and you can read this file else adapter module is the option to read such unstructured file.
    Thanks
    Gaurav

  • Cannot process a Fixed Field Length file using the File Adapter (Sender)

    Hi -
    I have checked throughout these posts and blogs but I still have not been able to find a solution to my issue.  When using the File Adapter (Sender) I get a Conversion initialization failed with "xml.keyfieldName", no value found.  Why would I require a key field when I am using fixed field lenghts?  The file is comprised of 2 structures - 1 header and multiple details (see below).  There are no key fields in the flat file that I would be able to use.  Any suggestions?
    011000390      Customer Americas        20080605164317 000000000000000800000008000000000016000000                              
    12345678          100500       100500       Supplier 1                         0000000000030000002008040400                    
    12345678          100501       100501       Supplier 2                         0000000000052000002008042100 
    The File Adapter is configured as follows:
    Document Name = Rfchke00
    Document Namespace = 'my namespace'
    Recordset Name = Rfchke00
    Recordset Structure = Dtachkh,1,Dtachkp,*
    Recordset Sequence = Ascending
    Recordsets per Message = 1
    Key Field Type = String (Case-Sensitive)
    Dtachkh.fieldFixedLengths = 15,25,8,6,1,8,8,8,15,3,31
    Dtachkh.fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11
    Dtachkh.processFieldNames = fromConfiguration
    Dtachkp,fieldFixedLengths = 18,13,13,35,15,3,8,2,21
    Dtachkp,fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9
    Dtachkp,processFieldNames = fromConfiguration
    Thanks,
    Dave

    Hi,
    you can use the module from which u can convert your structure to
    H011000390 Customer Americas 20080605164317 000000000000000800000008000000000016000000
    D12345678 100500 100500 Supplier 1 0000000000030000002008040400
    D12345678 100501 100501 Supplier 2 0000000000052000002008042100
    Please note the extra H,D in the struture added by the module.
    You can then use them as your key fieldValues.. The module should be deployed in Visual Admin and then can be used in the Module tab of your adapter CC
    While writing the content conversion after that please dont forget about the added new characters
    Please note also that i can find that the word supplier kept repeating in all the Dtachkp records
    Please use that
    Also if you feel that the field is of 13 characters and that would cause a problem dont worry... create a dummy field eg split tht 13 to two fields and use the common one as key field Value and identifier... as i see in ure case its like 500 Supplier , 502 Supplier . u can split the first 4 char and the remaing 9 char are key field value.
    try this out
    Rgds
    Aditya

Maybe you are looking for

  • Tv @nywhere Master w/ Vista Ultimate Driver help

    I have Tv @nywhere Master and when i try to install the 'certified for windows vista drivers', it wont let me. I open up the rar file and then i click on setup and click next and then next and then an error pops up and it says 'system cannot detect t

  • I have problem to update iPhoto

    today I recive a new application for iPhoto so when I want to make a update appear a maybe old ID e-mail addrese and pasword I buy this Mac by second hand store in Tokyo Japan I need how I have to do to install a new update of iPhoto. if some body kn

  • Need to make swap device out of disk slice

    Hello, I have inhereted a problem with one of our Solaris 9 machines. When it was set up, we did a custom filesystem layout (always have). The tradition is to put / on slice 0, and swap on slice 1 with a space roughly 2 times the physical memory spac

  • HT4972 How to add a personal hotspot

    How can i have the personal hotspot back on my phone? It has vanished by the time I was updating my software using pc

  • Forms not showing

    I have a subscription to creative clous and, according to the adobe site it comes with 5 basic websites. The basic sites include forms. I have built a trial site and uploaded it to the cloud. I want to put a form into it bust I can't seem to find "Si