XSLT mapping sometimes throw ArrayOutOfBoundsException

Hi
I have a simple XSLT mapping that is supposed to group elements based on an identificator (number).
My issue is that when testing message through PI, it sometimes throw ArrayOutOfBoundsException and sometimes not, with the same records involved..!!
I have tested it all in XML Spy and there it always works.
The XSLT looks like this:
     <xsl:for-each select="Invoice_KA49">
          <xsl:variable name="Ident">
               <xsl:value-of select="Identificator"/>
          </xsl:variable>
          <GroupElement>
               <xsl:copy-of select="../[Identificator=$Ident]"/><!--../-->
          </GroupElement>
     </xsl:for-each>
Anyone knows why this happens? Any help would be appreciated!
Thanks.
regards Ole

Hi Ole, looks like you produce a document with duplicate entries which have to be removed in a next step. Maybe the duplicate entries blow up the document. When you want to group Invoice_KA49 elements based on the key Identifikator, as Udo already suggest you should only select distinct values in the for-each loop, e.g.
<xsl:for-each select="//Invoice_KA49[Identifikator=not(./Identifikator=preceding-sibling::Invoice_KA49/Identifikator)]">
In this way you do not produce duplicate entries.
Unfortunately we cannot use the function
distinct-value(..)
here since it's only available in xslt 2.0.
Best regards, Martin

Similar Messages

  • XSLT mapping throws error in XI, but not in XMLSPY

    Hi everybody,
    I got a really complex XSLT mapping. It works fine in XMLSPY.
    But when I execute the mapping in XI, I get the following error:
    Error during XSLT Transformation: Could not load stylesheet.com.sap.engine.lib.xml.util.NestedException: Operator or ')' expected.
    I asume there is a special character that XI cannot execute.
    has anybody an idea of finding this character?
    Thanks, regards Mario

    Hi Mario
    Check your input data, and also try to see test in Interface mapping test tab,
    you will get an idea about the input is correct or not
    see the below links..
    <u><b>XSLT Mapping</b>[/u
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    <u><b>XSLT Mapping with java enhancement</b></u>
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping - Using ABAP XSLT Extensions for XI Mapping
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • ERROR WHILE USING XSLT MAPPING IN INTERFACE MAPPING

    Hi,
      We are using an xslt mapping in our scenario but while i load the XSLT mapping in the interface mapping i get a message :
    Transformer configuration exception occurred when loading XSLT
    sorce interface :outbound and asyncronous.
    mapping : XSLT mapping (imported as a zip file)
    target interface: abstract,asyncronous.
    The xslt runs well in standalone and its well formed and there is no name space issue.
    please help if any one has faced such a situation while using XSLT mapping.
    regards,
    Anirban.

    Hi Anirban
    When you say it runs well <i>standalone</i> what exactly do you mean? Which XSLT processor are you using to run it? There are subtle difference between XSTL processors that can sometimes result in incompatibilities. For instance, I have seen XSLTs run correctly in XMLSpy but incorrectly (or at least slightly differently) in XI.
    Regards,
    Thorsten

  • Java ,abap and XSLT mapping

    Hi all,
               can any one provide some material on java ,ABA and XSLT mapping(as i got requirement on my current project)..
    thanks in advance.
    regards
    krish..

    Hi
       All mapping related links
    There is no hard and fast rule for using the mapping techniques.
    Graphical Mapping is used for simple mapping cases. When, the logic for your mapping is simple and straight forward and it does not involve any complex logic.
    Java and XSLT mapping are used when graphical mapping cannot help you and you have multilevel hierarchy structure data.
    When the choice is between Java and XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks. One among them being that you cannot use Java APIs and Classes in it. There might be cases in your mapping when you will have to perform something like a properties file look up or a DB lookup, such scenarios are not possible in XSLT and so, when you want to use some specific Java API's you will have to go for Java Mapping.
    Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but, DOM is very processor intensive.
    SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exactly easy to develop either.
    To know more about each of them please go thru the following links. And if you ask me your which is better, it depends basically on the scenario you implementing and the complexity involved. Anyways please go thru the following 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
    /people/bhanu.thirumala/blog/2006/02/02/graphical-message-mapping-150-text-preview
    http://www.sapgenie.com/netweaver/xi/mapping1.htm
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    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
    ABAP mapping
    /people/r.eijpe/blog
    To know more about the value mapping tools for the SAP Exchange Infrastructure (XI), please go thru the following link:
    http://www.applicon.dk/fileadmin/filer/XI_Tools/ValueMappingTool.pdf
    To get an idea as to what value mapping is, please go thru the following links:
    http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/dfae3d47afd652e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
    most of the links that I have provided also helps you get the step by step procedure of doing the same. And also involves the procedure to implement certain advanced features.
    And please go through this link which clearly explains the 3 types of mappings.
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    regards
    Prasad

  • 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

  • Get SYSID in XSLT mapping

    Hello,
    Does anybody know a way to get the sysid (or the current environment) at runtime using XSLT mapping.
    Some simple java code is also Okay
    Cheers
    Emile
    Message was edited by: Emile Hermans

    1) Write some Java code to get the hostname
    package com.company.xi;
    public class MappingFunctions {
    public String getServerHostname()
    throws UnknownHostException {
    InetAddress myAddress = InetAddress.getLocalHost();
    return myAddress.getHostName();
    2) Package it in a JAR and load it into the IR as an imported archive.
    3) Call it from your XSLT
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:mapping="java:com.company.xi.MappingFunctions">
    <HostName><xsl:value-of select="mapping:getHostName()"/></HostName>
    Thanks,
    Jesse

  • Raising Exceptions in XSLT mapping.?

    Hi,
    When there is an mapping exception, in UDF, i raise an exception...
    Similar is the case with Java & ABAP mappings.
    Now, How do i raise mapping exceptions in XSLT mapping (Java & ABAP)..?
    --DJ

    You could use Java enhancement, but instead of just adding info to the trace, you could raise a real exception, using an ErrorHandler object. Ive successfully worked with the one below (not with XSLTs, tho, but I dont see why it shouldnt work.
    import java.util.Map;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    * @author Henrique.Pinto
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class MappingErrorHandler implements ErrorHandler {
         private static AbstractTrace trace = null;
         public MappingErrorHandler(Map param) {
              trace =
                   (AbstractTrace) param.get(
                        StreamTransformationConstants.MAPPING_TRACE);
         public void warning(SAXParseException exception) throws SAXException {
              trace.addInfo(
                   "**Parsing Warning**n"
                        + "  Line:    "
                        + exception.getLineNumber()
                        + "n"
                        + "  URI:     "
                        + exception.getSystemId()
                        + "n"
                        + "  Message: "
                        + exception.getMessage());
              throw new SAXException("Warning encountered");
         public void error(SAXParseException exception) throws SAXException {
              trace.addInfo(
                   "**Parsing Error**n"
                        + "  Line:    "
                        + exception.getLineNumber()
                        + "n"
                        + "  URI:     "
                        + exception.getSystemId()
                        + "n"
                        + "  Message: "
                        + exception.getMessage());
              throw new SAXException("Error encountered");
         public void fatalError(SAXParseException exception) throws SAXException {
              trace.addInfo(
                   "**Parsing Fatal Error**n"
                        + "  Line:    "
                        + exception.getLineNumber()
                        + "n"
                        + "  URI:     "
                        + exception.getSystemId()
                        + "n"
                        + "  Message: "
                        + exception.getMessage());
              throw new SAXException("Fatal Error encountered");
    Regards,
    Henrique.

  • XSLT Mapping - problem with prefixes when calling template

    Hi all,
    I am having a problem with using an XSLT mapping in XI to combine various fields from 2 input messages of different structures into a single output message.  I understand that XI puts a wrapper around the 2 input messages so the structure of the XML I am mapping is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    <ns2:Message1>
    <ns:(root of first message)>
    </ns:(root of first message)>
    </ns2:Message1>
    <ns2:Message2>
    <ns:(root of second message)>
    </ns: (root of second message)>
    </ns2:Message2>
    </ns2:Messages>
    Currently my XSL looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge" xmlns:javamap="java:systemDate.CurrentDate" version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="ns2:Messages">
    ...<xsl:calltemplate name="FormattingTemplate"/>
    </xsl:template>
    <xsl:template name="FormattingTemplate">
    </xsl:template>
    </xsl:stylesheet>
    When I test the mapping it works fine until it calls the FormattingTemplate.  Then it throws out a "transformer exception" error saying the prefix 'ns2' is not mapped to a namespace.
    If anyone could tell me where I am going wrong I would be very grateful.
    Thanks,
    Mike

    Hi Udo,
    Thanks for your reply.
    When testing the stylesheet locally with XMLSpy, it works fine, but I have just noticed that it adds information in the root tag of the target message as follows:
    <(root of target message) xmlns:javamap="java:systemDate.CurrentDate" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    I checked the root tag of the target message in XI and it does not automatically add this information. Thus I added it in my stylesheet so the information above is projected in the target message, but the same error message appears when the call template function is called.  Do you know if I need to somehow add a namespace to templates other than the main one? If so, do you know how I go about doing that?
    Thanks,
    Mike

  • XSLT mapping - namespace problem?

    Hello,
    I am trying to proces a message with the following format:
    <XMLMESSAGE  xsi:nonamespaceSchemalocation='schema.xsd' >
       <ORDER>
         <HEADER>
         </HEADER>
         <ITEM>
         </ITEM
      </ORDER>
    <XMLMESSAGE>
    the mapping (XSLT or message mapping) throws an exception. During runtime or test, this is the same.
    The problem occurs, I think, because of the nonamespace atriibute. If a change or remove the value, the mapping is fine.
    Does anybody know if I should save the file mentioned in the attribute somewhere? Or is there a workaround for this problem?
    thnx, Paul
    PS: we are using PI 7.0.

    Hi Russ (and others),
    I tested it in the real example, but it still throws the same error on the  java (=compiled) mapping.
    this is my input:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ORDER [
    <!ENTITY % iso-lat1 PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "http://www.oasis-open.org/docbook/xmlcharent/0.3/iso-lat1.ent">
    %iso-lat1;
    ]>
    <XMLMESSAGE xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="OrderBericht.xsd">
         <ORDER>
              <HEADER>
                   <ACCOUNT_NUMBER></ACCOUNT_NUMBER>
              </HEADER>
              <LINE_ITEMS>
                   <ITEM>
                        <LINE>1</LINE>
                   </ITEM>
              </LINE_ITEMS>
         </ORDER>
    </XMLMESSAGE>
    this is my xslt:
    <?xml version='1.0' ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" standalone="no" indent="yes"/>
         <xsl:template match="/">
              <ORDERS05 xmlns="com:root">
                   <IDOC BEGIN="1">
                       <xsl:call-template name="CrtEDIDC40"/>
                   </IDOC>
              </ORDERS05>
         </xsl:template>
         <xsl:template name="CrtEDIDC40">
              <EDI_DC40 SEGMENT="1">
                   <TABNAM>EDI_DC40</TABNAM>
                   <SNDPRT>LS</SNDPRT>
                   <SNDPRN>XIDCLNT300</SNDPRN>
              </EDI_DC40>
         </xsl:template>
    </xsl:stylesheet>
    and this is the error:
    18:00:41 Start of test
    Creating XSLT mapping mindef_test
    Call XSLT processor with stylsheet mindef_test.xsl.
    Method error called terminate transformation
    javax.xml.transform.TransformerException: IOException occurred while parsing stream. An empty document will be used! at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:351) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150) at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) 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:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.addInputFromEntity(AdvancedXMLStreamReader.java:393) at com.sap.engine.lib.xml.parser.XMLParser.handleDTDReference(XMLParser.java:2267) at com.sap.engine.lib.xml.parser.XMLParser.scanIntSubset(XMLParser.java:1057) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1246) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2795) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2830) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:347) ... 19 more --------- java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.UnknownHostException: www.oasis-open.org at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148)
    any ideas? I am totally lost here.

  • XSLT Mapping with Dynamic Configuration for Mail Adapter

    Hi Guys,
    I am wondering if somebody can help me please.
    I have a requirement in which I need to pick up the file from FTP and email it to the user as an attachment with the same file name and content.
    I know it is possible via 3 method either by deploying adapter module or via XSLT or JAVA Mapping.
    I preferred XSLT Mapping because it is easier to use and we don't need to compile the code like JAVA Mapping.
    I have done the XSLT Mapping but the only problem I am facing is that how to copy the file name which we get it from Dynamic Configuration to the Mail ContentDisposition.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
        <!-- copy payload -->
    I tried many option but unfortunately none of them worked.
    <Content_Disposition>attachment;filename="$inputparam"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-conf"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-key"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-value"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dummy"</Content_Disposition>
             <Content_Disposition>
                attachment;filename=
                <xsl:value-of select="dynamic-key"/>
             </Content_Disposition>
    I really appreciate if someone can please provide some guidance.
    Thanks,

    Hi,
    Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
    It will throw Exception..
    The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
    If u r doing for file to file means no UDF required,, just check ASMA on both sides....
    Babu

  • Encoding Technique converting in XSLT Mapping.

    Hi,
    I have a scenarion File->XI->File. the incoming file has the encoding technique UTF-8. i have to convert it to ISO-8859-1. i'm using an XSLT mapping to do that after which my java mapping gets executed. when i tested this mapping with the source file in the Design, it works fine, but when i execute the whole scenario end to end,it is throwing some exception with Unsupported Charecter. the code of the XSLT looks as given under:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
         <xsl:output encoding="ISO-8859-1"/>
         <xsl:template match="/">
              <xsl:copy-of select="*"/>
         </xsl:template>
    </xsl:stylesheet>
    Can any one tell me how to resolve this.
    Any help wud b gr8ly appreciated.
    Thnx in Advance
    Anil

    HI Anil,
    Check these links, it might help you.
    Ampersand ('&')  dumps XI Mapping. JDBC to BIW
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    Best regards
    Mahesh.M

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • 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

  • Extracting more information from XI XSLT mapping failure

    Hello
    I am getting to grips with XI. When developing XSLT mappings I first run them on Stylus or XMLSpy, ensure they work, and then deploy them to XI.
    Unfortunately they sometimes fail to work in XI, and the amount of information retrieved about the failure is very small.
    I thought of a method to get more infomation in situations like this. I could write a Java method that sends messages to the XI console. This would involve seeing the javadoc API for GlobalContainer, Container and AbstractTrace. I would also need to have these objects in my classpath in order to compile the method. Then I could use the method in the XSL.
    There are two small drawbacks to this plan: I cannot find the Javadoc or the Jar file holding the classes.
    Perhaps one of you readers could either tell me where these things are, or suggest a better method of solving problems like this.
    In either case I look forward to receiving a reply.
    Thanks
    Bill Logan

    Thanks for the suggestion,
    completely forgot about the simpler <xsl:message/> command. I tried this, and it worked fine in Stylus.....but not in XI.
    I think the problem s when the file is being loaded. An alert box pops up. It says
    "Transformer configuration exception occurred when loading XSLT GDS_to_DP.xsl (http://sap.com/xi/GDSConsole, 155fc320-f69f-11d8-97f7-c0140a114c15, -1)"
    and the trace window says this
    "10:00:13 Start of test
    Creating XSLT mapping GDS_to_DP
    URIResolver called with href = GDS_DP_Common.xsl and base = GDS_to_DP.xsl
    Source resolved. System id = GDS_DP_Common.xsl
    10:00:14 End of test"
    It seems obvious (from deduction) that the problem lies in GDS_DP_Common.xsl. XI will not give me any information precisely where this occurs
    Thanks for you earlier answer Alessandro

  • XSLT Mapping......xsl-xs difference

    Dear all,
    In one of our scenarios we have used an xsd file where in we used xs instead xs1 and at the begining there was no name space.
    Can you throw more light on the same as I am confused.
    Thanks,
    Srinivasa

    Hi,
    Go through these
    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
    Regards,
    AKshay Jamgoankar,
    Reward points if find useful.

Maybe you are looking for

  • Call a pl/sql function froma jsp

    I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp? thanks for ur help.

  • Implementing tree datastructure in Java

    Hi, I have to implement tree structure in java. Each node in the tree can have child nodes. Also, I need to search for a node in this tree by passing some key. Can anyone guide how to implement such data structure in Java? I would like to use map col

  • I have lost my iphone?

    i have lost my iphone 1 day back. kindly suggest how to search?

  • Zen micro stuck in recovery mode

    Hi zen micro frozen in recovery mode and i downloaded new firmware on to my pc but it wont even open im at a loss at what to do any help much appriceated

  • Where is the "Window Layouts" file?

    I exported my 65 GB movie. I didn't check the location; just assumed it was going to plant the last place I exported a movie to. I clicked the "export" command again to see where it defaulted to; I can see the movie name, but the finder cannot locate