Dynamic file name from messsage payload

Hi Friends,
My requirement is to read one .xml file , which has  Purchase Order deatails and place .html file on receiver side, we are using XSLT for mapping.
The file name should be "POnumber.html " , i've gone through below but couldn't get much
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Can any one send the that code , and steps to add that code in side XSLT.
Thanks
John

Hi,
With above links
/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
See in the below Michal blog , how to conver the file as html , take that part only.
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
Regards
Chilla

Similar Messages

  • Dynamic file name from input payload (RFC 2 flat file)

    Hi,
    I have an RFC to flat file scenario. The output flat file has not an XML structure, it's just a plain text file generated with abap mapping.
    In my source interface (RFC), I have a field called <FILENAME>, I want to use the value of that field to create the target file using dynamic file name. But if  in variable substitution I use payload:ZRFC_NAME,1,FILENAME,1 It doesn't work because the dynamic variable substitution try to access to output payload, not the source one...
    What can I do?

    Hi Marshal,
           You can add a extra node to your target strucutre like
    FileName- Node
    --FileName - Element.
    do the mapping from the field filename of RFC to FileName field in u r target strucure. And use this  field path at Refrence in variable subtituion.
    In the Content converison add the Name & Values as below
    FileName.fileldNames -- FileName
    FileName.fieldFixedLengths -- 0
    FileName.fixedLengthTooShortHandling -- Cut
    So the extra field in u r target structure would not populate in u r target text file.
    Cheers
    Veera

  • Flat file name from Sender Side Dynamically into subject of Receiver Mail

    Hi All,
             I am Using a file to Mail Scenario, My requirement is to get dynamically the file name from flat file of the Sender Side into Subject of Receiver Mail Adapter and attachment of file from the Sender Side. Can anyone help me out.
    Thanks in Advance

    Hi....
              You can write udf in the message mapping to get the Dynamic file name and map that to the subject of the receiver mail.
      DynamicConfiguration conf = (DynamicConfiguration) param.get(
              StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
          // read value
          String Filename = conf.get(KEY_FILENAME);
    Regards,
    Leela

  • File name from an attribute of an element of the payload

    Dear Experts,
    Could you suggest the syntax for specifying the file name from a variable in the file receiver communication channel? I need to grab the file name from an ATTRIBUTE of an element of the payload.
    Thanks a lot.
    Example: Need to pass the attribute "descReceipt" of the element "promotionEvent" to the variable in the following payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <promotionExport>
    <promotionEvent eventIdentifier="30" status="A" descReceipt="FILE1">

    The scenario is IDOC to FILE. I need to get the value of the receiving partner.
    The message header has the node "DynamicConfiguration". Please see the xml below. I need to grab the key RCVPRN (0000002104) from this and pass as the file name in the receiver file adapter.
    How do I setup my receiver file adapter for this? I tried changing the values for the variable, and also enabling the adapter specific message attributes. No solution yet.
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPOR">LXDCLNT250</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRT">LS</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRN">0000002104</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPOR">SAPLCD</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRN">LCDCLNT220</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="CIMTYP" />
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="IDOCTYP">WPDBBY01</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="MESTYP">WPDBBY</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRT">KU</SAP:Record>
      </SAP:DynamicConfiguration>

  • Receiver File Name Variable Substitution :payload: Fatal Error

    Hi all
             i have a scenario of  idoc to file.., i need to create a dynamic file name taking 1 field variable from the payload.  The idoc -xml structure in XI is :
                       <b><INVOICE03></b>
                          <b> <IDOC BEGIN="1"</b>>
                              <b><EDI_DC40 SEGMENT="1"></b>
                                          <field1> ashu </field1>
                             <b> </EDI_DC40>
                               <ENEDL20></b>
                                           <field2> rawat</field1>
                              <b> <ENEDL20>
                           </IDOC>
                        <INVOICE03></b>
    i need to pick th value of field2 , for the target file name..
    In variable substitution i had given  var = INVOICE03,1,IDOC,1,E1EDL40,1,E1EDL20,1,VBELN,1
    <i>
    STILL I AM GETTING THE ERROR </i> :varsubst.VariableDataSourceException: Caught SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) .
    NOTE : my target variable is getting populated properly.
    i tried a lot of combinations in REFERENCE VARIABLE , even  giving ( payload: xxx)
    but for all  changes it is giving the same error....
    i referred the following blogs also :
    Re: Variable substitution
    Regards
    AR

    HI
    the target payload is :
      <?xml version="1.0" encoding="UTF-8" ?>
    - <DELVRY03>
    - <IDOC BEGIN="1">
    + <EDI_DC40 SEGMENT="1">
      <TABNAM>EDI_DC40</TABNAM>
      <MANDT>900</MANDT>
      <DOCNUM>0000000002093240</DOCNUM>
      <DOCREL>46C</DOCREL>
      <STATUS>30</STATUS>
      <DIRECT>1</DIRECT>
      <OUTMOD>2</OUTMOD>
      <IDOCTYP>DELVRY03</IDOCTYP>
      <MESTYP>DESADV</MESTYP>
      <STDMES>DESADV</STDMES>
      <SNDPOR>SAPQA1</SNDPOR>
      <SNDPRT>LS</SNDPRT>
      <SNDPRN>ZLOG900</SNDPRN>
      <RCVPOR>XIDEV</RCVPOR>
      <RCVPRT>KU</RCVPRT>
      <RCVPFC>WE</RCVPFC>
      <RCVPRN>8300000717</RCVPRN>
      <CREDAT>20070820</CREDAT>
      <CRETIM>143341</CRETIM>
      <SERIAL>20070703104747</SERIAL>
      </EDI_DC40>
    - <E1EDL20 SEGMENT="1">
    <b> <VBELN>0083030974</VBELN> </b>
      <VSTEL>5000</VSTEL>
      <VKORG>STK</VKORG>
      <INCO1>C&F</INCO1>
      <INCO2>Melsele</INCO2>
      <VSBED>03</VSBED>
      <BTGEW>12000.000</BTGEW>
      <NTGEW>0.000</NTGEW>
      <GEWEI>GRM</GEWEI>
      <VOLUM>0.000</VOLUM>
      <ANZPK>00000</ANZPK>
      <PODAT>20070703</PODAT>
      <POTIM>104747</POTIM>
    + <E1EDL22 SEGMENT="1">
      <VSTEL_BEZ>ID Warehouse</VSTEL_BEZ>
      <VKORG_BEZ>Stock Transfer</VKORG_BEZ>
      <INCO1_BEZ>Cost & Freight</INCO1_BEZ>
      <VSBED_BEZ>Road</VSBED_BEZ>
      </E1EDL22>
    + <E1EDL21 SEGMENT="1">
      <LFART>ZRUS</LFART>
      <EXPKZ>X</EXPKZ>
      <LPRIO>03</LPRIO>
      <TRAGR>0001</TRAGR>
    - <E1EDL23 SEGMENT="1">
      <LFART_BEZ>Delivery:Russian Exp</LFART_BEZ>
      <LPRIO_BEZ>High</LPRIO_BEZ>
      <TRAGR_BEZ>On pallets</TRAGR_BEZ>
      </E1EDL23>
      </E1EDL21>
    + <E1EDL18 SEGMENT="1">
      <QUALF>ORI</QUALF>
      </E1EDL18>
    + <E1ADRM1 SEGMENT="1">
      <PARTNER_Q>WE</PARTNER_Q>
      <PARTNER_ID>8300000717</PARTNER_ID>
      <LANGUAGE>EN</LANGUAGE>
      <FORMOFADDR>M/s.</FORMOFADDR>
      <NAME1>NYK Logistics</NAME1>
      <STREET1>Keetberglaan 2</STREET1>
      <POSTL_COD1>B-9120</POSTL_COD1>
      <CITY1>Melsele</CITY1>
      <COUNTRY1>BE</COUNTRY1>
      <REGION>RII</REGION>
      </E1ADRM1>
    + <E1ADRM1 SEGMENT="1">
      <PARTNER_Q>OSP</PARTNER_Q>
      <PARTNER_ID>5000</PARTNER_ID>
      <LANGUAGE>EN</LANGUAGE>
      <NAME1>I/D WAREHOUSE : DELHI</NAME1>
      <NAME2>B-84/1, Okhla Phase II, New Delhi</NAME2>
      <CITY1>New Delhi</CITY1>
      <TELEFAX>CST:LC/87/051655/05/61</TELEFAX>
      <COUNTRY1>IN</COUNTRY1>
      <REGION>DEL</REGION>
      </E1ADRM1>
    + <E1ADRM1 SEGMENT="1">
      <PARTNER_Q>OSO</PARTNER_Q>
      <PARTNER_ID>STK</PARTNER_ID>
      </E1ADRM1>
    + <E1EDT13 SEGMENT="1">
      <QUALF>006</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDT13 SEGMENT="1">
      <QUALF>007</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDT13 SEGMENT="1">
      <QUALF>010</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDT13 SEGMENT="1">
      <QUALF>015</QUALF>
      <NTANF>20070703</NTANF>
      <NTANZ>000000</NTANZ>
      <NTEND>20070703</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    + <E1EDL33 SEGMENT="1">
      <ALAND>IN</ALAND>
      <EXPVZ>4</EXPVZ>
      <ZOLLA>0001</ZOLLA>
      <IEVER>3</IEVER>
    - <E1EDL34 SEGMENT="1">
      <EXPVZ_BEZ>Air</EXPVZ_BEZ>
      <ZOLLA_BEZ>New Delhi</ZOLLA_BEZ>
      <IEVER_BEZ>Road</IEVER_BEZ>
      </E1EDL34>
      </E1EDL33>
    + <E1EDL24 SEGMENT="1">
      <POSNR>000010</POSNR>
      <MATNR>000000000001005372</MATNR>
      <ARKTX>ALPRAZOMED TAB 0.5MG 5X10B BE</ARKTX>
      <MATKL>S5202</MATKL>
      <WERKS>5000</WERKS>
      <LFIMG>2.000</LFIMG>
      <VRKME>15S</VRKME>
      <LGMNG>10.000</LGMNG>
      <MEINS>S10</MEINS>
      <NTGEW>0.000</NTGEW>
      <BRGEW>12000.000</BRGEW>
      <GEWEI>GRM</GEWEI>
      <VOLUM>0.000</VOLUM>
      <VOLEH>CMQ</VOLEH>
      <LADGR>Z002</LADGR>
      <TRAGR>0001</TRAGR>
      <VTWEG>ST</VTWEG>
      <SPART>20</SPART>
      <GRKOR>000</GRKOR>
      <POSEX>000000</POSEX>
    - <E1EDL25 SEGMENT="1">
      <LADGR_BEZ>Injectibles- for MP</LADGR_BEZ>
      <TRAGR_BEZ>On pallets</TRAGR_BEZ>
      <VTWEG_BEZ>Stock Transfer</VTWEG_BEZ>
      <SPART_BEZ>Formulations</SPART_BEZ>
      </E1EDL25>
    - <E1EDL26 SEGMENT="1">
      <PSTYV>NLN</PSTYV>
      <MATKL>S5202</MATKL>
      <PRODH>010080010010100102</PRODH>
      <UMVKZ>5</UMVKZ>
      <UMVKN>1</UMVKN>
      <UEBTO>0.0</UEBTO>
      <UNTTO>0.0</UNTTO>
      <XCHBW>1</XCHBW>
      <MVGR1>U</MVGR1>
      <MVGR2>U</MVGR2>
      <MVGR3>U</MVGR3>
      <MVGR4>U</MVGR4>
      <MVGR5>U</MVGR5>
    - <E1EDL27 SEGMENT="1">
      <PSTYV_BEZ>StandStockTransItem</PSTYV_BEZ>
      <MATKL_BEZ>Belgium</MATKL_BEZ>
      <PRODH_BEZ>Tablets</PRODH_BEZ>
      <WERKS_BEZ>Export Warehouse</WERKS_BEZ>
      <MVGR1_BEZ>Unasigned</MVGR1_BEZ>
      <MVGR2_BEZ>Unassigned</MVGR2_BEZ>
      <MVGR3_BEZ>Unassigned</MVGR3_BEZ>
      <MVGR4_BEZ>Unasigned</MVGR4_BEZ>
      <MVGR5_BEZ>Unassigned</MVGR5_BEZ>
      </E1EDL27>
      </E1EDL26>
    - <E1EDL35 SEGMENT="1">
      <GRWRT>0.00</GRWRT>
      </E1EDL35>
    - <E1EDL43 SEGMENT="1">
      <QUALF>V</QUALF>
      <BELNR>7200000025</BELNR>
      <POSNR>000010</POSNR>
      </E1EDL43>
      </E1EDL24>
      </E1EDL20>
      </IDOC>
      </DELVRY03>
    i need <VBELN>0083030974</VBELN>  in file name
    Regards
    AR

  • Problem in dynamic file name in File reciever adapater

    I have given my file name as
    %abc%.txt
    and in the advanced mode
    i have given
    Additional parameters as
    abc=
    payload:file_reciever_mt,1,FileNameNode,1,FileName,1
    while my file reciver structure is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:file_receiver_mt xmlns:ns="urn:filetofiledemo"><recordset><data><name></name><age></age></data></recordset><FileNameNode><FileName>Amit123</FileName></FileNameNode></ns:file_receiver_mt>
    My file is getting store as %abc%.txt
    not as Amit123.txt
    I am using SP 14 .
    Any pointers wld be very helpful
    Thanks
    Amit

    Hi Amit,
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    Apart from my previous post, you can also use Adapter Specific Identifiers in your Sender and Receiver File Adapters to copy the same file name from the source to the target.
    take a look at this blog for the same,
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    -- Bhavesh
    cheers,
    Prashanth

  • 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

  • Dynamic file name in communication channel

    hello
    is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
    to get it out of a table or something?
    Thanks
    Kfir

    Hi,
    Yes its bit possible to use the dynamic file name at File access paramters
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Refer below links for more in depth details about it
    Re: Dynamic file name in Receiver File Adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check out this URL
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check these weblogs as well...
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    Thanks
    Swarup

  • Dynamic file name in receiver channal

    Hi, All,
    I would like to set dynamic file name in receiver channal. My xml payload will be like this:
    <file_name>file1.txt</file_name>
    <text_content>balabala......</text_content>
    I would like to output an text file which text content will be the value of <text_content>, file name will be the value of <file_name> in the xml payload.
    Is there anyone could help me?
    Helpful answer will be surely awarded. Thanks
    Yang

    Please look at the below description from help.sap.com. You can use the below steps to name the file from a value in the payload. You would have to use File Content Conversion to insert the value of the <text_content> in the file.
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    ●      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    ○       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    ○       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
    <?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>
    Thanks
    Praveen M

  • File name from a path

    hi ,
    there is a path "c:\abc\abc\abc\abc\abc.doc", i have to get file name from it.
    but i had to write a dynamic code which can get the file name from any given path.

    Smoke me a kipper, I'll be back before breakfast.
    SQL> var extended_filepath varchar2(128)
    SQL> exec :extended_filepath := '/this/is/a/path/to/a/file.txt'
    PL/SQL procedure successfully completed.
    SQL> select instr(:extended_filepath, '/', -1)
      2  from dual
      3  /
    INSTR(:EXTENDED_FILEPATH,'/',-1)
                                  21
    SQL> select substr(:extended_filepath, instr(:extended_filepath, '/', -1) +1)
      2  from dual
      3  /
    SUBSTR(:EXTENDED_FILEPATH,INSTR(:EXTENDED_FILEPATH,'/',-1)+1)
    file.txt
    SQL> Cheers, APC

  • Dynamic file name ?

    Hi,
    I am following this blog to name the target file/directory dynamically at the runtime :
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    But I am getting this error in the CC monitoring :
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'interface_name ' for variable 'var1'.

    Hi,
    Try following this weblog for dynamic file name.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Dynamic filename come under the Dynamic configuration in moni, for your messages.
    This is the code used inside.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return ourSourceFileName;
    That is why Dynamic configuration is coming in output.. It is a class to generate dynamic configuration file at runtime provided by SAP XI.
    Hope this will help you.
    regards
    Aashish Sinha
    PS : reward points if helpful

  • Dynamic File name in File Adapter

    Hi,
    I have a requirement to pass dynamic file name in File Adapter.
    Is there any way to pass a variable for the file name attribut in file adapter.
    I am looking for some options apart from %yyMMddHHmmss%,%SEQ%...etc
    Please suggest if any of you have information on how to put values from a variable to file name attribute in file adapter
    regards
    Saiju

    Hi Saiju,
    Yes there is.
    Assign your file name to a variable, let's say 'fileName'.
    Now go to your invoke activity(for the specific fileadapter) -> Property tab-> find a property call jca.file.FileName -> in the value field assign 'fileName' variable.
    That's it... (assuming you are using 11g)
    Arik
    Edited by: Arik on Jun 27, 2012 3:12 PM

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Dynamic File Name - UDF

    Hi Master,
    I written the UDF for Getting the Dynamic File name.
    DynamicConfiguration conf = (DynamicConfiguration) container.getParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Retrieve the filename
    String FileName = conf.get(key);
    This is working ok - but I want to return these values so I can be used in mapping.
    when I try to add the statement return FileName; , the compiler then complains with the following error:
    cannot return a value from method whose result type is void return FileName;
    Please help me,
    Thanks,
    Anu

    Thanks Nithiyanandam,
    I am using the Same code. But i am getting the Syntax error:
    Source code has syntax error:  E:/usr/sap/DX1/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapaf708c00d6bb11dd83ee00101816a382/source/com/sap/xi/tf/_MM_I_FF_O_RFC_.java:13: cannot resolve symbol symbol : class variable location: class com.sap.xi.tf._MM_I_FF_O_RFC_ variable a; ^ 1 error
    UDF Name: FileName
    while creating the UDF, I select the first radio button(Value). not  Context and Queue.
    I written the below code.
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "FileName");
    String FileName = conf.put(key, a);
    return FileName;
    Thanks,
    ANU

  • Dynamic File Name depending on the Source File name

    Hi Experts,
    I have a problem like Dynamic File name depending on the Source File Name. I will explain with example as follwos
    Source File name                 Targer Folder/Filename
    NK01.VR59.L2007030         VR59/Rec.l200
    NK01.VR71.L2017030         VR71/Rec.l201
    NK01.VR77.L2027030         VR77/Rec.l202
    See above the exaple, Depending on the Source file name, I am deciding where i need to place my file and what name i need to name it.
    So please suggest me the solution and How can i do this with a single communication channel ? Do i need to create multiple CC for each folder??
    Points will be rewarded for Valuable anwer.
    Thanks in Advance,
    Best Regads,
    Vijay

    Hi VIjay,
    Thanks for quick reply. But i am getting error in End to End Scenarios only. If i remove the Return " "  statement from the UDF, while activating it is showing the error saying like missing return statement. I also mapped to the top most node to this UDF.
    I am getting the following error in End to End error Scenarios:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

Maybe you are looking for