XSLT mapping sorting against an output field

Hi, all
I am testing my XSLT mapping. Here is the output message type defintion:
I want to sort f2 in my xslt mapping. Here is my mapping:
<?xml version="1.0" encoding="UTF-8" ?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://fileconversion" xmlns:ns1="http://fileconversion">
    <xsl:template match="/">
      <ns1:TESTOUTPUT_MT>
        <Msg>
        <xsl:for-each select="ns0:TESTDATA_MT/Trans/Detail">
        <xsl:sort select="Transaction/Data/f2" />
          <Transaction>
            <Data>
              <f1>
                <xsl:value-of select="PERNR" />
              </f1>
              <f2>
                <xsl:value-of select="POSITION" />
              </f2>
              <f3>
                <xsl:value-of select="TEL" />
              </f3>
              <f4>
                <xsl:value-of select="concat(concat(STREET,' '),CITY)" />
              </f4>
            </Data>
          </Transaction>
            </xsl:for-each>
        </Msg>
      </ns1:TESTOUTPUT_MT>
    </xsl:template>
  </xsl:stylesheet>
The sorting did not execute on field "f2" and the data is in the same order as the input.
Note that I can do <xsl:sort select="POSITION " /> instead and it will work. But I am trying to test on sorting against output field as this is the requirement in the real interface.
What did I do wrong? Please advise.
Thanks,
Jonathan.

Hi Jon - You can sort the source values. If you use "sort select="Transaction/Data/f2" i don't think it has got some effect.
You can use <xsl:sort select="POSITION " /> Any issues with that?
Just to add - when you map Position with F2... how does the sorting will be different when you execute it on F2 or Position?
If you are doing some calculation for F2 then should handle the Sort function accordingly..

Similar Messages

  • XSLT mapping to change the DOCREL field value.

    Dear All,
    There is an IDOC to IDOC scenario where both the inbound IDOC and the outbound IDOC is the same. There is no change in any values of any field except the DOCREL field. The version number should change from 6.02 to 7.3.
    I need to write a XSLT mapping program to meet the criteria. As I am new to XSLT mapping, any suggestion is welcome.
    Thanks and Regards,
    Rana Brata De

    Hi,
    Try putting the desired DOCREL value in the "Seg. release in IDoc type" field in the partner profile of the sender system. This should help you avoid the costly XSLT preparation and the transformation being executed for each message.
    Hope this helps,
    Greg

  • XSLT Mapping: URI appearing in each field entry in the output

    Hi there,
    I am mapping a custome build Invoice to xCBL structure in Stylus Studio. The output look ok, but in each field URI value appear as well, as shown below.
    --Start
    <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">
    <p:sender xmlns:p="http://localhost/webs/msgDetails.xsd"><p:senderId xmlns:p="http://localhost/webs/msgDetails.xsd">SCA HA</p:senderId><p:senderName xmlns:p="http://localhost/webs/msgDetails.xsd">SCA HA</p:senderName></p:sender><p:receiver xmlns:p="http://localhost/webs/msgDetails.xsd"><p:receiverId xmlns:p="http://localhost/webs/msgDetails.xsd">PEL</p:receiverId><p:receiverName xmlns:p="http://localhost/webs/msgDetails.xsd">Progressive Enterprise</p:receiverName></p:receiver><p:docType xmlns:p="http://localhost/webs/msgDetails.xsd">invoice</p:docType><p:docFormat xmlns:p="http://localhost/webs/msgDetails.xsd">xcbl40</p:docFormat><p:transmissionDetails xmlns:p="http://localhost/webs/msgDetails.xsd"><p:testMsg xmlns:p="http://localhost/webs/msgDetails.xsd">true</p:testMsg><p:transmissionDate xmlns:p="http://localhost/webs/msgDetails.xsd">2005-05-23 14:20:20</p:transmissionDate><p:messageId xmlns:p="http://localhost/webs/msgDetails.xsd">2005-05-23 14:20:20</p:messageId><p:username xmlns:p="http://localhost/webs/msgDetails.xsd"/><p:password xmlns:p="http://localhost/webs/msgDetails.xsd"/></p:transmissionDetails></p:msgDetails>
    ---End
    The expected output is,
    - Start
    <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">
      <p:sender>
        <p:senderId>SCA HA</p:senderId>
        <p:senderName>SCA HA</p:senderName>
      </p:sender>
      <p:receiver>
        <p:receiverId>PEL</p:receiverId>
        <p:receiverName>Progressive Enterprises</p:receiverName>
      </p:receiver>
      <p:docType>invoice</p:docType>
      <p:docFormat>xcbl40</p:docFormat>
      <p:transmissionDetails>
        <p:environmentFrom>dev</p:environmentFrom>
        <p:testMsg>true</p:testMsg>
        <p:transmissionDate>2005-05-18T11:14:06</p:transmissionDate>
        <p:messageId>104435_2005-05-18T11:14:06</p:messageId>
        <p:username></p:username>
        <p:password></p:password>
      </p:transmissionDetails>
    </p:msgDetails>
    --end
    Its happening in the body area as well. Can somebody please suggest.
    Thank you.
    Warm Regards,
    Ranjan

    Hi Ranjan,
    You can resolve this in this way.
    In ur xsl, delete the namespaces appearing. Then hardcode with ur hand the namespace like <p:msgDetails xmlns:p="http://localhost/webs/msgDetails.xsd">.
    Make sure that the template match is coming before the
    <p:msgDetails ..
    Hope this helps out.
    Rgds,
    Deno

  • Removing specific XML tag in XSLT mapping

    Hi there,
    I've asked before about a XML to string XSLT mapping and the answers provided here helped me to successfully do that mapping! Thanks a lot!
    I'm using the following mapping to convert a string back to XML.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://my.namespace.com">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//m:my_tag">
                   <xsl:value-of select="." disable-output-escaping="yes"/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    But now, I'm having a problem converting back from string to XML. The response tag "m:mytag" has a string like this:
    "<?xml version="1.0" encoding="UTF-8"?><tag1><tag2>Data</tag2></tag1>".
    And  when I use the XSLT mapping shown above, the output file comes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml version="1.0" encoding="UTF-8"?>
    <tag1>
    <tag2>Data</tag2>
    </tag1>
    As you can see, the initial <?xml ...> tag is duplicated, and it generates a parsing error in XI.
    How can I eliminate one of the "<?xml version="1.0" encoding="UTF-8"?>" strings in the mapping?
    Thanks a lot.

    Wow!!!
    The output="html" actually worked on XML Spy!
    Removing the XSLT file initial tag didn't work.
    I had already resolved this problem using the replace-string method that I found here: http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426
    But your method is way more elegant and efficient. :o)
    I'll test the html method on XI, but I'm almost sure it'll work too.

  • Alerts in case of XSLT Mapping failure without BPM

    Dear All,
    We are working on IDOC - SOAP Scenario and mapping is through XSLT Mapping.
    when the Vendor number field in IDOC is coming blank/invalid, the mapping should fail and an email alert should go to business.
    This IDOC-SOAP is Asynchronous and not using any BPM. So can we raise a alerts withut using BPM.
    I have gone through some blogs but I can see the alerts in Inbox but where as I want the alert through EMAIL.
    Any pointers are highly appreciated.
    Regards,
    Srini

    Dear Srinivas,
    When you want the Alert to be send through email,then you need to configure the required mentioned below.
    1.In SU01 ,Assign the corresponding Email ID for the Recipient of the ALERT.
    2. In , RWB>ALERT INBOX> PERSONALIZATION--> Go to Time Independent Delivery and  check the Email option.
    3. Go to the transaction  code SCOT,INT->SMTP and mention the corresponding  Mail Host and Port in SMTP Address.Then select the set in the Internet of supported Address Types and give mail address in the Address area.
    Note: Check whether Node is use is checked.
    You can find the mails which are pending/failed/success in the SOST Transaction code.
    Check if you have access for this configuration.Otherwise get help from Basis team.
    Regards
    B.Dheepa

  • Dynamic File Name on Receiver Side using XSLT mapping

    Hi,
      My scenario is a Proxy to File scenario.The File on the receiving side is a TEXT file generated due to XSLT mapping. The file name has to be dynamic like- TEST<DDMMYYHHMMSS>File.DAT.
    If somebody knows how to do the same please help.
    Regards
    Ritu

    Hi Ritu,
    I agree to Krishna.With your XSLT mapping create a XML output which can be converted to a text file with content conversion.
    And for the dynamic file name, i guess its the date that matters which needs to be in DDMMYYHHMMSS format. the same can be accomplished by a Java function and calling it in your XSLT .
    Do refer this weblog it will help you accomplish the same.
    >>> /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    Regards,
    Shabarish

  • Attn: Prashant (XSLT Mapping)

    Hi Prashant,
                I am applying xslt mapping in my scenario.
    The required format is:
    <BatchReceiptPw <b>xmlns="http://AltInn.no/webservices/"</b> >
          <enterpriseSystemId>int</enterpriseSystemId>
          <batchId>string</batchId>
          <password>string</password>
          <version>int</version>
        </BatchReceiptPw>
    The output I am getting is:
      <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:BatchReceiptPw <b>xmlns:ns1="http://AltInn.no/webservices/"</b> >
      <ns1:enterpriseSystemId>826</ns1:enterpriseSystemId>
      <ns1:batchId>8e8d6e34-60b3-4c42-89f8-dce662913d2f</ns1:batchId>
      <ns1:password>altinn1</ns1:password>
      <ns1:version>1.0</ns1:version>
      </ns1:BatchReceiptPw>
    The i apply your XSLT code to remove the name sapce.
    The code you gave me is : <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="no"/>
    <xsl:template match="/|comment()|processing-instruction()">
    <xsl:copy>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*">
    <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
    <xsl:attribute name="{local-name()}">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </xsl:template>
    </xsl:stylesheet>
      The output i am getting after applying your code is
    <?xml version="1.0" encoding="utf-8" ?>
      <BatchReceiptPw>
      <enterpriseSystemId>826</enterpriseSystemId>
      <batchId>8e8d6e34-60b3-4c42-89f8-dce662913d2f</batchId>
      <password>altinn1</password>
      <version>1.0</version>
      </BatchReceiptPw>
    How do i retain the highlighted part (xmlns="http://AltInn.no/webservices/")in the final output as in the required structure.
    Pls advice
    Regards,
    Raj

    Hi Ashish,
    Can you please post us how are you getting the output
    The output I am getting is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:BatchReceiptPw xmlns:ns1="http://AltInn.no/webservices/" >
    <ns1:enterpriseSystemId>826</ns1:enterpriseSystemId>
    <ns1:batchId>8e8d6e34-60b3-4c42-89f8-dce662913d2f</ns1:batchId>
    <ns1:password>altinn1</ns1:password>
    <ns1:version>1.0</ns1:version>
    </ns1:BatchReceiptPw>
    is it by using a XSLT mapping. If so then lets try to modify that XSLT mapping achieve the required output.
    The XSLT mapping which you used to remove namespace will remove all the namespaces. You can also use the following XSLT mapping instead of the the remove namespace XSLT.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="no"/>
    <xsl:template match="/">
    <BatchReceiptPw xmlns:ns1="http://AltInn.no/webservices/" >
    <enterpriseSystemId><xsl:value-of select="ns1:BatchReceiptPw/enterpriseSystemId"/>
    </enterpriseSystemId>
    <batchId><xsl:value-of select="ns1:BatchReceiptPw/batchId"/>
    </batchId>
    <password><xsl:value-of select="ns1:BatchReceiptPw/password"/>
    </password>
    <version><xsl:value-of select="ns1:BatchReceiptPw/version"/>
    </version>
    </BatchReceiptPw>
    </xsl:template>
    </xsl:stylesheet>
    But the advisable way si to change thefirst mapping instead of doing this workaround.
    Thanks,
    Prakash

  • Sort according to another field order

    say there are 2 input and 2 output fields
    The first input field is mapped to the first output field , after grouping similar values together
    e.g:
    input field1          output field1
    a                            a
    d                            a
    e                            d
    c                            d
    d                            c
    e                            e
    a                            e
    Now the 2 nd input field has to be mapped to 2nd output field according to the order in which the 1st field has been mapped.
    We can not use sortByKey here as the first field is not mapped in lexographical nor numerical order.
    How then can we map the 2nd field according to order of first?
    Thanks in advance
    Pratichi

    Hi Pratichi,
    The UDF that you are writting to group similar values together for the input field1.
    try chaging that  UDF with two arguments
    1. inputField1
    2. inputField2
    use the concept of Edit Java section(Declaring Global variable .To Know more about it refer
    http://wiki.sdn.sap.com/wiki/display/stage/UsingEditJavaSectioninMessageMapping)
    Declare a Global variable in the Global Variable section as
    String[] format = new String[30];
    while you are gouping inputField1 ,group inputField2 also and store in the global variable format.
    Write one more UDF to read values from the global variable and map it to OutputFiled2.
    (you can use same java code as you normally use to store and read values from the string array).
    Thanks and Regards,
    Kubra fatima.

  • Sorting on specific  field using XSLT Mapping

    Hi All,
    I am trying to sort the records on specific field using XSLT mapping.But I'm unable get the proper output for the following code.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://xxxxxxxx">
    <xsl:output method="xml" indent="yes" />
         <xsl:template match="/">
              <a:T1>
                   <Row>
                             <xsl:for-each select="a:S1/Record">
                             <xsl:sort select="EmpID" />
                             <EMPID>
                                  <xsl:value-of select="EmpID"/>
                             </EMPID>
                             <ENAME>
                                  <xsl:value-of select="EmpName"/>
                             </ENAME>
                        </xsl:for-each>
                        </Row>
              </a:T1>
         </xsl:template>
    </xsl:stylesheet>>
    Currently getting following output :
    http://www.flickr.com/photos/21390012@N04/2074799747/
    Expected output should be like below :
    http://www.flickr.com/photos/21390012@N04/2074807393/
    Kindly send me suggestion to achieve this.
    Regards
    Pullarao

    Hi ,
    I donno much about srting in XSLT but i can give you one example on that.
    Example :
    This is how to sort numbers in xslt.
    Try this :
    <xsl:for-each select="learn[@kind='done']">
         <xsl:sort select="number(@rank)" data-type="number"/>
         <table border="00" cellpadding="3" width="100%">
                   <tr>
                        <td width="100" valign="top" align="right"><input type="checkbox" checked="checked" readonly="readonly"/></td>
                        <td width="10" valign="top" align="right"><xsl:value-of select="position()"/>. </td>
                        <td valign="top">
                             [<xsl:value-of select="@rank"/>] <xsl:value-of select="@title"/>
                        </td>
                   </tr>
         </table>
         <table border="00" cellpadding="3" width="100%">
                   <tr>
                        <td width="100"> </td>
                        <td valign="top">
                             <xsl:apply-templates/>
                        </td>
                   </tr>
         </table>
    </xsl:for-each>
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Java Mapping, XSLT Mapping, ABAP Mapping

    Hi Experts,
                     Could any one explain what is the main features of the following Mapping. How to pick the mapping?
    Java Mapping - When to use and what is the advantage.
    ABAP Mapping - When to use and what is the advantage.
    XSLT Mapping - When to use and what is the advantage.
    Graphical Mapping - When to use and what is the advantage.
    cheers,
    Sunee

    There are 4 types of mapping in XI
    1. Graphical Mapping
    2. XSLT Mapping
    3. JAVA Mapping
    4. ABAP Mapping
    When to use Message mapping
    1 When the logic for your mapping is simple and straight forward, you can use
    Advantages of message mapping
    1)Easy to use.
    2) has GUI drag and drop.
    3) used for simple mapping cases
    4) it does not involve any complex logic
    Disadvantages of message mapping
    1)has limitation in terms of complex hierarchy
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Disadvantages of Java mapping
    1)SAX parser is not easy to develop
    2)DOM parser is intensive
    3) Java knowledge is required
    4) bit complexer
    XSLT Mapping - When to use
    1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    3)When data is to be filtered based on certain fields (considering File as source)
    4)When data is to be sorted based on certain field (considering File as source)
    5)When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    1)XSLT program itself defines its own target structure.
    2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    4)File content conversion at receiver side can be avoided in case of text or html output.
    5)Multiple occurrences of node within tree (source XML) can be handled easily.
    6)XSLT can be used in combination with graphical mapping.
    7)Multi-mapping is also possible using xslt.
    8)XSLT can be used with ABAP and JAVA Extensions
    Disadvantages of using XSLT mapping
    1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    2)Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    3)XSLT mapping requires more memory than mapping classes generated in Java.
    4)XSLT program become lengthier as source structure fields grows in numbers.
    5)XSLT program sometimes become complex to meet desired functionality.
    6)Some XSL functions are dependent on version of browser.
    Advantages of Abap Mapping
    1) A person comfortable with OOABAP can go for ABAP mapping instead.
    Disadvantages of Abap Mapping
    1) Abap knowledge is required
    2) bit compexer
    For further info on each of the mapping, refer to these links,
    Graphical Mapping,
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    XSLT Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    http://www.w3.org/TR/xslt20/
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    Check this blog on Mapping:
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    Also, check this thread for more info,
    Different types of Mapping in XI

  • Error with XSLT mapping .. code included

    I am using XSLT to map my input legacy message into the CATS_INSERT02 IDoc. I am getting a wierd error ....
    =====================================================
    <Trace level="1" type="T">TransfromerException during XSLT processing:</Trace>
      <Trace level="1" type="T">javax.xml.transform.TransformerException: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:245) at com.sap.aii.ibrun.server.mapping.MappingTransformer.transform(MappingTransformer.java:153) at com.sap.aii.ibrun.server.mapping.XSLTMapping.executeStep(XSLTMapping.java:67) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:91) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:77) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:88) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:63) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:80) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0.processFunction(MappingServiceObjectImpl0.java:131) at sun.reflect.GeneratedMethodAccessor20721.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187) at $Proxy26.processFunction(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:95) at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequestInternal(RFCJCOServer.java:113) at com.sap.engine.services.rfcengine.RFCJCOServer$ApplicationRunnable.run(RFCJCOServer.java:171) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162) Caused by: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8) at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:1988) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2632) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2688) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:126) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:136) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:209) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:341) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:234) ... 24 more -
    com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8) at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:1988) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2632) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2688) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:126) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:136) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:209) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:341) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:234) at
    I am able to test the transform fine in XMLSpy. Any ideas will be really appreciated.
    =====================================================
    XSL code:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:attribute-set name="idoc_begin">
              <xsl:attribute name="BEGIN">catsdb_test</xsl:attribute>
         </xsl:attribute-set>
         <xsl:attribute-set name="EDIDC">
              <xsl:attribute name="SEGMENT">EDI_DC40</xsl:attribute>
         </xsl:attribute-set>
         <xsl:attribute-set name="E1CATS_INSERT">
              <xsl:attribute name="SEGMENT">E1CATS_INSERT</xsl:attribute>
         </xsl:attribute-set>
         <xsl:attribute-set name="E1BPCATS1">
              <xsl:attribute name="SEGMENT">E1BPCATS1</xsl:attribute>
         </xsl:attribute-set>
         <!-- Groupby each UNIQUE SSN in EMPDETL -->
         <xsl:key name="employees-by-ssn" match="EMPDETL" use="ssn"/>
         <xsl:template match="EMPDET">
              <!-- Insert the ROOT element -->
              <xsl:element name="CATS_INSERT02">
                   <!-- loop through all the employee detail nodes using the SSN as the key -->
                   <!-- <xsl:for-each select="EMPDETL"> -->
                   <xsl:for-each select="EMPDETL[count(. | key('employees-by-ssn', ssn)[1]) = 1]">
                        <!-- sort using the SSN after grouping the data based on SSN in the step earlier -->
                        <xsl:sort data-type="text" select="ssn"/>
                        <!-- create an IDOC and EDI_DC40 per SSN grouping  -->
                        <xsl:element name="IDOC" use-attribute-sets="idoc_begin">
                             <xsl:element name="EDI_DC40" use-attribute-sets="EDIDC">
                                  <xsl:element name="TABNAM">EDIDC</xsl:element>
                                  <xsl:element name="DIRECT">2</xsl:element>
                                  <xsl:element name="IDOCTYP">cats_insert02</xsl:element>
                                  <xsl:element name="MESTYP">cats_insert</xsl:element>
                                  <xsl:element name="SNDPOR">T90CLNT090</xsl:element>
                                  <xsl:element name="SNDPRT">LS</xsl:element>
                                  <xsl:element name="SNDPRN">T90CLNT090</xsl:element>
                                  <xsl:element name="RCVPOR">SAPBAS</xsl:element>
                                  <xsl:element name="RCVPRN">ERPCLT800</xsl:element>
                             </xsl:element>
                             <!-- EDI_DC40 element -->
                             <xsl:element name="E1CATS_INSERT" use-attribute-sets="E1CATS_INSERT">
                                  <xsl:for-each select="key('employees-by-ssn', ssn)">
                                       <!-- Create as many E1BPCATS1 segments as the number of times each SSN is repeated -->
                                       <xsl:element name="E1BPCATS1" use-attribute-sets="E1BPCATS1">
                                            <xsl:element name="WORKDATE">xsl:value-of select="workdate"</xsl:element>
                                            <xsl:element name="EMPLOYEENUMBER">xsl:value-of select="ssn"</xsl:element>
                                            <xsl:element name="ABS_ATT_TYPE">xsl:value-of select="abstype"</xsl:element>
                                            <xsl:element name="WAGETYPE">xsl:value-of select="wagetype"</xsl:element>
                                            <xsl:element name="CATSHOURS">xsl:value-of select="catshours"</xsl:element>
                                       </xsl:element>
                                       <!-- E1BPCATS1 element -->
                                  </xsl:for-each>
                                  <!-- End of loop for E1BPCATS1 -->
                             </xsl:element>
                             <!-- E1CATS_INSERT element -->
                        </xsl:element>
                        <!-- IDOC element -->
                   </xsl:for-each>
                   <!-- End of loop for all the employee detail nodes -->
              </xsl:element>
         </xsl:template>
    </xsl:stylesheet>

    what is correlation here?
    I have three messages coming into BPM....now all the three messages should have a field (any field) whose value will be the same in all the messages.
    Ex:
    <Message1>
    <Name>SAP</Name>
    <ID>40</ID>
    </Message1>
    <Message2>
    <Name>SDN</Name>
    <ID>40</ID>
    </Message2>
    <Message3>
    <Name>FORUM</Name>
    <ID>40</ID>
    </Message3>
    Now to correlate the above messages, the field ID would be used as it has the same value in all the messages.
    How does message mapping looks for the following messages
    In your BPM you will have a Transformation step....the mapping included here will have three source messages (File1, File2, File3) and there will be a single target message which will have the below structure:
    <ROOT>
    <OUTPUT> ...... 0..unbounded
    </ROOT>
    OUTPUT node of the target should be duplicated (right-click --> duplicate ... in message mapping).....do it twice so that you will have three OUTPUT nodes.
    Now each target-OUTPUT node should be mapped to the source OUTPUT node, respectively.
    Regards,
    Abhishek.

  • UDF's and XSLT Mapping

    Hi,
         I am very much confused when to use UDF's and when to use XSLT etc. Please make me to understand with good examples.

    HI,
    UDF's are user defined functions are of two types,simple UDF which takes in one input and gives out one output and the second one is advanced UDF where in u can access more than one fields,and the result is passed on to ResultList.
    UDF can be used in graphical mapping depends upon the requirement.
    1) If u wanted to do manuplication in data which can not be done by using the standared XI function that time we go for UDF.
    2) For doing Lookup we write the code in UDF and pass the value to R3 system.
    3) If u need to compare the input value and pass the other value based on comparision that time can go for UDF.
    There are many different requirement for which we can go ahead with UDF.
    What is XSLT:
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    It can be used to transform
    •     XML to XML - From one XML data format to another
    •     XML to Text
    •     XML to HTML/XHTML
    •     XML to PDF
    A few example cases in which an XSLT mapping can be used:-
    &#61692;     When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    &#61692;     When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    &#61692;     When data is to be filtered based on certain fields (considering File as source)
    &#61692;     When data is to be sorted based on certain field (considering File as source)
    &#61692;     When data is to be grouped based on certain field (considering File as source).
    Advantages of using XSLT mapping
    &#61692;     XSLT program itself defines its own target structure.
    &#61692;     XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    &#61692;     XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    &#61692;     File content conversion at receiver side can be avoided in case of text or html output.
    &#61692;     Multiple occurrences of node within tree (source XML) can be handled easily.
    &#61692;     XSLT can be used in combination with graphical mapping.
    &#61692;     Multi-mapping is also possible using xslt.
    &#61692;     XSLT can be used with ABAP and JAVA Extensions.
    But at the same XSLT has the disadvantages also.
    Thnx
    Chirag

  • XSLT  Mapping  scenario

    Hi
         we have graphical mapping in Xi.. but most of them going for XSLT mapping.. i did't understood  in what situation we need to go for  XSLT mapping... is there any  special features  which are not possible in Graphical Mapping.. can you please suggest what are  those.. and  exactly  when can go for XSLT mapping.. 
    Thanks
    Babu

    Hi Babu,
    1) What is XSLT
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    It can be used to transform
    •     XML to XML - From one XML data format to another
    •     XML to Text
    •     XML to HTML/XHTML
    •     XML to PDF
    How is XSLT mapping different from Graphical, Java and ABAP mapping?
    Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception – User defined functions).   But sometimes with graphical mapping it is difficult to produce required output. For example … text/html output, namespace change, sorting or grouping of records etc. A person comfortable with Object Oriented ABAP can go for ABAP mapping instead. One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.
    A few example cases in which an XSLT mapping can be used:-
    &#61692;     When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    &#61692;     When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    &#61692;     When data is to be filtered based on certain fields (considering File as source)
    &#61692;     When data is to be sorted based on certain field (considering File as source)
    &#61692;     When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    &#61692;     XSLT program itself defines its own target structure.
    &#61692;     XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    &#61692;     XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    &#61692;     File content conversion at receiver side can be avoided in case of text or html output.
    &#61692;     Multiple occurrences of node within tree (source XML) can be handled easily.  
    &#61692;     XSLT can be used in combination with graphical mapping.
    &#61692;     Multi-mapping is also possible using xslt.
    &#61692;     XSLT can be used with ABAP and JAVA Extensions.
    I hope u got the idea.
    Thanks and Regards,
    Chirag

  • Benifits of XSLT Mapping.

    Hi Experts,
    Benfits of XSLT Mapping and when it is used.

    Hi,
    Advantages of using XSLT mapping
    1)XSLT program itself defines its own target structure.
    2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    4)File content conversion at receiver side can be avoided in case of text or html output.
    5)Multiple occurrences of node within tree (source XML) can be handled easily.
    6)XSLT can be used in combination with graphical mapping.
    7)Multi-mapping is also possible using xslt.
    8)XSLT can be used with ABAP and JAVA Extensions
    When to use
    1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    3)When data is to be filtered based on certain fields (considering File as source)
    4)When data is to be sorted based on certain field (considering File as source)
    5)When data is to be grouped based on certain field (considering File as source)
    reg,
    suresh

  • Why xslt  mapping?

    I just want to know in what kind of mapping requirements we can go with xslt mapping which is not supported in graphical mapping?
    Please help me with few mapping requirements which is not supported in graphical mapping but we can achive using xslt mapping.

    Hi serach in SDN you will get everything ,...
    anyways refer these links
    A few example in which an XSLT mapping can be used:-
    When the required output is other than XML like Text, Html or XHTML (html displayed as XML)
    When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    When data is to be filtered based on certain fields (considering File as source)
    When data is to be sorted based on certain field (considering File as source)
    When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    XSLT program itself defines its own target structure.
    XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    File content conversion at receiver side can be avoided in case of text or html output.
    Multiple occurrences of node within tree (source XML) can be handled easily.
    XSLT can be used in combination with graphical mapping.
    Multi-mapping is also possible using xslt.
    XSLT can be used with ABAP and JAVA Extensions.
    Disadvantages of using XSLT mapping
    Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    XSLT mapping requires more memory than mapping classes generated in Java.
    XSLT program become lengthier as source structure fields grows in numbers.
    XSLT program sometimes become complex to meet desired functionality.
    Some XSL functions are dependent on version of browser.
    Follow these links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
    Some scenarios
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    The following links give u step-by-step solution for XSLT mapping:
    Generic XSLT Mapping for SAP XI,Part I
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    Generic XSLT Mapping for SAP XI,Part II
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    XSLT: Recursive Templates
    /people/udo.martens/blog/2006/04/26/xslt-recursive-templates
    Easy RFC lookup from XSLT mappings using a Java helper class
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14
    Regds
    Abhishek

Maybe you are looking for

  • Problems with iTunes installation

    Hello, I am having problems with installing iTunes 10.4. I am running an Acer Aspire M1640 running Windows Vista (32) v 6.0.6002 SP2 and updated. When trying to update my old version of iTunes I got the following error "Bonjour: The feature that you

  • No Sound even though it's recogni

    I have a Sound Blaster Audigy which in control panel says b400. Anyway I installed the latest drivers and clicked restart. when i restarted i heard the restart sound and when the computer started up i heard that sound. but after that no sounds played

  • Theme Editor files for SP13

    The link in SAP Note 854870 for the SP13 Eclipse Web Dynpro Theme Editor/Themes returns "Error - download expired". Does anyone know of an alternate location for the SP13 themes or if it is possible to use the SP14 (or later) theme editor to maintain

  • Scenario to the users agent.

    Hello, For ATG 9.1 is there a way to setup a Scenario to know if the user is coming via a smartphone/tablet or notebook ? Basically get access of the browser's agent ?

  • How to Change Applet Windows Title in EBS 11.5.10.2?

    Dear All, would like to check How do I change the Applet Form Windows Title in EBS 11.5.10.2? Thanks.