Error in Muenchian method in XSLT mapping using sapxmltoolkit.jar

Hi,
The following example produces a different result in SAP from that of Altova, Microsoft providers. It is a resonably complex Muenchian transformation that I have reduced this to the core issue:
Have tried with SP14 but same result on every delivered version of sapxmltoolit.jar
I am trying to extract a unique set of locationCodes to assemble an IDOC for each locationCode - breaking out the relevant order lines.
<b>My question is twofold:</b>
a) is the behaviour of sapxmltoolkit errannt to the spec?
b) is there another way to produce this list or work around?
<?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" version="1.0" indent="yes"/>
  <xsl:key name="partner-ids" match="PRODQNTY/LOCNQNTY" use="locationCode"/>
  <xsl:template name="buildIdoc" match="ORDER">
    <ORDERS05>
      <xsl:for-each select="PRODQNTY/LOCNQNTY[count(.|key('partner-ids',locationCode)[1])=1]">
        <xsl:sort select="locationCode" data-type="number"/>
        <xsl:comment><xsl:value-of select="locationCode"/> Location Code</xsl:comment>
        <xsl:comment><xsl:value-of select="../lineNo"/> Line Number</xsl:comment>
        <IDOC BEGIN="1"></IDOC>
      </xsl:for-each>
    </ORDERS05>
  </xsl:template>
</xsl:stylesheet>
<b>Sample input document:</b>
?xml version="1.0"?>
<ORDER loops-id="ORDER">
  <PRODQNTY loops-id="PRODQNTY">
    <lineNo>1</lineNo>
    <productCode>9990007454</productCode>
    <LOCNQNTY>
      <locationCode>001</locationCode>
      <quantityOrdered>6</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>004</locationCode>
      <quantityOrdered>3</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>005</locationCode>
      <quantityOrdered>2</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>006</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>007</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>009</locationCode>
      <quantityOrdered>3</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>021</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>082</locationCode>
      <quantityOrdered>2</quantityOrdered>
    </LOCNQNTY>
    <unDefData></unDefData>
    <segmentCount>0</segmentCount>
  </PRODQNTY>
  <PRODQNTY loops-id="PRODQNTY">
    <lineNo>2</lineNo>
    <productCode>1864503696</productCode>
    <LOCNQNTY>
      <locationCode>001</locationCode>
      <quantityOrdered>4</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>004</locationCode>
      <quantityOrdered>2</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>005</locationCode>
      <quantityOrdered>2</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>006</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>007</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>009</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>021</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
    <LOCNQNTY>
      <locationCode>082</locationCode>
      <quantityOrdered>1</quantityOrdered>
    </LOCNQNTY>
  </PRODQNTY>
</ORDER>
<b>Expected Output:</b> - from Altova - 1 record per locationCode
<?xml version="1.0" encoding="UTF-8"?>
<ORDERS05>
     <!--001 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--004 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--005 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--006 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--007 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--009 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--021 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
     <!--082 Location Code-->
     <!--1 Line Number-->
     <IDOC BEGIN="1" />
</ORDERS05>
<b>Output from sapxmltoolkit.jar</b> - 1 record per locationCode per PRODQNTY line so I get a non unique set of locationCodes: (every location twice in this example - and with 16 order lines, every location 16 times and 128 IDOCs (instead of 8 IDOCs).
<?xml version="1.0" encoding="utf-8"?>
<ORDERS05>
  <!--001 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--001 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--004 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--004 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--005 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--005 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--006 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--006 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--007 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--007 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--009 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--009 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--021 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--021 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
  <!--082 Location Code-->
  <!--1 Line Number-->
  <IDOC BEGIN="1"/>
  <!--082 Location Code-->
  <!--2 Line Number-->
  <IDOC BEGIN="1"/>
</ORDERS05>

A bit more heartache & trials and I solved it
The key defition is unstable in XSLT the way I defined it
Simple change to the XSLT: remove the PRODQNTY node reference from the match attribute:
<b>incorrect key:</b>
<xsl:key name="partner-ids" match="PRODQNTY/LOCNQNTY" use="locationCode"/>
<b>correct key:</b>
<xsl:key name="partner-ids" match="LOCNQNTY" use="locationCode"/>
And the "group-by or Muenchian method" loop statement:
<xsl:for-each select="PRODQNTY/LOCNQNTY[count(.|key('partner-ids',locationCode)[1])=1]">
Hopes this helps someone else....
Regds Doug.

Similar Messages

  • External methods in xslt mapping

    can we call external JAVA and ABAP methods in XSLT mapping ? 
    thanks
    kumar

    Kumar,
    Yes you can, please refer the below webelogs.
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    Best regards,
    raj.

  • Reg - XSLT Mapping using stylesheet exception during test

    Hi experts,
    I am new to SAP PI. Currently i am working on PI's XSLT Mapping using Stylusstudio.
    I got error *Transformer Configuration Exception occurred when loading XSLT <name>.xsl; details: Could not compile stylesheet*.
    I tried test by selecting SAP XML TOOLKIT too, then i am facing
    *com.sap.engine.lib.xml.parser.NestedSAXParseException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)(:main:, row=4, col=15) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)*.
    Kindly help me to overcome this issue.

    Hi,
    Simply your XSLT file is not a well-formed XML. Check your syntax. You could also use the XML Tools plugin to Notepad++ to help you determine where the syntax error is precisely.
    Moreover, this error "Prefix 'a' is not mapped to a namespace" might mean that you are using a tag: <a:something>, but "a" is not properly declared as a namespace, for instance like: xmlns:a="something.sap.com".
    Hope this helps,
    Greg

  • 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

  • Calling abap method in xslt mapping?

    Hi
    I need to call abap method in my xslt mapping , i tried with
    <sap:external-call >and <sap:external-function> .
    But it is giving short dump error.
    Can anybody give me proper syntax..
    thanks
    Prasad

    Hello,
    Please see the code below.
    This is how u call
      <sap:external-function class="ZTEST_CLASS" kind="class" method="GETRECORDCOUNT" name="ns0:GetRecordCount">
        <sap:argument param="XXXX" type="string"/>
        <sap:argument param="YYYY" type="string"/>
        <sap:result param="ZZZZ" type="string"/>
      </sap:external-function>
      <xsl:template match="/">
        <xsl:param name="Counter">
    *And this is how u call below...
    <xsl:value-of select="ns0:GetRecordCount(A,B)"/>
    </xsl:template>
    </xsl:transform>
    Regards,

  • Error in Current Date in XSLT Mapping

    Hi Experts,
      I am having a problem in Dispaying the current Date and Time ( or System Date and Time ) .As per my Project Requirements I need do XSLT mapping
    My XSLT Mapping Looks like
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://XYZ.eu.ABC.com">
    <xsl:template match="/">
    <a:A2A>
        <a:PNo>
             <xsl:value-of select="Path/Path/PNO"/>
       </a:PNo>
       <a:Rev>
             <xsl:value-of select="Path/Path/REVISION"/>
       </a:Rev>
       <a:Current Date>
             <xsl:value-of select= ""/>
       </a:Current Date>
       <a:Current Time>
             <xsl:value-of select= ""/>
       </a:Current Time>
    </xsl:template>
    </xsl:stylesheet>
    Can any one please let me is there is any function to  dispaly the Current Date and time.

    Hi ..
    I just tried executing both the maps.. Both of them excutes well in both XMLSpy and Stylus Studio .. But having below problems in Executing in PI
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
    <xsl:template match="/aaa">
    <xxx>
    <xsl:value-of select="current-dateTime()"/>
    </xxx>
    </xsl:template>
    </xsl:stylesheet>
    Then I got the error
    javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Function with name 'current-dateTime' not found in context library.
    with
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:datetime="http://exslt.org/dates-and-times"
    exclude-result-prefixes="datetime">
    <xsl:template match="/">
    <currtime>
    <xsl:value-of select="datetime:dateTime()" />
    </currtime>
    </xsl:template>
    </xsl:stylesheet>
    I have got
    Unable to find resource http://exslt/org/dates-and-times.class (http://NAMESPACE Name) in the following software component versions: 0fe18820-410a-11dd-979b-dc8591374305

  • Not in class path - XSLT Mapping using Stylus studio

    Hello,
    I am using Stylus studio for XSLT mapping. I have written a JAVA function and when I tried to execute, I am getting an error " ...... not inclasspath".
    I have put JAVA file in the classpath as expained in the Stylus studio help documentation.
    Can anyone help me on how to place the Java class file in the proper class path and how that java file has to be called from main XML program.
    Regards and Thanks in Advance
    Arvind

    Hello sabarish,
    I have tried already as explained in the link you have mentioned. But still not working. In fact i was thinking to zip xsl, class and java files together and upload to XI. But I want to ensure whether i have called the java extension properly from XSL file.
    Request you check this:
    Java file
    package com.eds.ehro.ximapping;
    import java.util.Map;
    //import com.sap.aii.mapping.api.AbstractTrace;
    //import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.*;
    import java.text.*;
    public class Concat_Employee_Sydate_Sytime {
                 public static String concat(String empno)
                 return empno + "-" + System.currentTimeMillis();
    XSL file
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.gemsconsult.com/idoctofile/employee"
      xmlns:javamap="com.eds.ehro.ximapping.Concat_Employee_Sydate_Sytime">
         <xsl:template match="/">
              <ns1:SetEmployeesDemographics_R xmlns:ns1="urn:EmpDemoVi">
                   <ns1:demographics0>
                        <ns2:address xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">
                             <ns2:adressLine>
                                  <xsl:value-of select="concat(ns0:MT_EMPDETAILS/AddressLine1,ns0:MT_EMPDETAILS/AddressLine2)"/>
                             </ns2:adressLine>
                             <ns2:countyCode>
                                  <xsl:value-of select="ns0:MT_EMPDETAILS/Country"/>
                             </ns2:countyCode>
                             <ns2:postalCode>
                                  <xsl:value-of select="ns0:MT_EMPDETAILS/Zipcode"/>
                             </ns2:postalCode>
                        </ns2:address>
                        <ns2:clientID xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">200</ns2:clientID>
                        <ns2:employeeID xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">
                             <xsl:param name="empno">
                                  <xsl:value-of select="ns0:MT_EMPDETAILS/EmployeeNo"/>
                             </xsl:param><!xsl:value-of select="ns0:MT_EMPDETAILS/EmployeeNo"/>
                             <xsl:if test="ns0:MT_EMPDETAILS/EmployeeNo">
                                  <xsl:value-of select="javamap:concat($empno)"/>
                             </xsl:if>
                        </ns2:employeeID>
                        <ns2:personName xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">
                             <ns2:firstName>
                                  <xsl:value-of select="ns0:MT_EMPDETAILS/FirstName"/>
                             </ns2:firstName>
                             <ns2:middleName>
                                  <xsl:value-of select="ns0:MT_EMPDETAILS/LastName"/>
                             </ns2:middleName>
                        </ns2:personName>
                   </ns1:demographics0>
              </ns1:SetEmployeesDemographics_R>
         </xsl:template>
    </xsl:stylesheet>

  • Error adding package to class that is using a jar

    Hi,
    I have a class that is using a jar but I need it to be in a package so I can use it with JSP, but each time I put the package in the class I get some compile errors that the classes in the jar can't be found.
    Example:
    Compiling 1 source file to C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\build\web\WEB-INF\classes
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:22: cannot find symbol
    symbol : class PP_OpenInterface
    location: class tecno.Tecnomen
    private PP_OpenInterface pp = null;
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:23: cannot find symbol
    symbol : class PP_OpenInterface_Factory
    location: class tecno.Tecnomen
         private PP_OpenInterface_Factory ppf     = null;
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:127: cannot find symbol
    symbol : class PP_exception
    location: class tecno.Tecnomen
    public int GenericRecharge (String Subid,int monto) throws PP_exception
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:79: cannot find symbol
    symbol : variable PP_OpenInterface_FactoryHelper
    location: class tecno.Tecnomen
    ppf = PP_OpenInterface_FactoryHelper.narrow(nsRef);
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:91: cannot find symbol
    symbol : class PP_exception
    location: class tecno.Tecnomen
    catch(PP_exception ex)
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:139: cannot find symbol
    symbol : class paramRecord
    location: class tecno.Tecnomen
    paramRecord pSeq [] = new paramRecord[] {
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:139: cannot find symbol
    symbol : class paramRecord
    location: class tecno.Tecnomen
    paramRecord pSeq [] = new paramRecord[] {
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:140: cannot find symbol
    symbol : class paramRecord
    location: class tecno.Tecnomen
    new paramRecord(0,subId),
    C:\Documents and Settings\ehasbunv\Mis documentos\proyecto\mex\cc\src\java\tecno\Tecnomen.java:141: cannot find symbol
    symbol : class paramRecord
    location: class tecno.Tecnomen
    new paramRecord(1,amount),

    Checking another file, the problem is that if I'm
    trying to use a class in the default package in
    another class and put a package name in the class
    then I can't use the default package. Is there any
    workaround?Nope. Get in the habit now of making ALL of your classes belong to packages. The "no-package" is only for creating 'toy' applications with no dependencies from other packaged classes.

  • Easy RFC lookup from XSLT mapping using a java class (getting Error)

    Hi All,
    I am trying to implement the sample scenario for calling RFC from xslt with the help of wrapper class. I am getting following error.
    com.sap.aii.mapping.lookup.LookupException: Internal lookup service is not registered. Invoking the lookup service is only supported in the Integration Builder test environment or in the Integration Server runtime environment. at com.sap.aii.mapping.lookup.LookupService.getService(LookupService.java:400) at com.sap.aii.mapping.lookup.LookupService.getChannel(LookupService.java:285) at com.sap.aii.mapping.lookup.LookupService.getChannel(LookupService.java:318) at dk.applican.xi.mapping.lookup.RfcLookup.execute(RfcLookup.java:55) 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.lib.xsl.xpath.functions.JLBFunction.execute(JLBFunction.java:145) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:110) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:54) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:41) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:49) at com.sap.engine.lib.xsl.xslt.XSLVariable.process(XSLVariable.java:125) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:228) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:256) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.callTemplate(XSLStylesheet.java:1310) at com.sap.engine.lib.xsl.xslt.XSLCallTemplate.process(XSLCallTemplate.java:102) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:228) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:241) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:228) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:241) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:228) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:256) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:445) at com.sap.engine.lib.xsl.xslt.XSLApplyTemplates.process(XSLApplyTemplates.java:158) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:228) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:256) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:445) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:381) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:392) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:234) 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.GeneratedMethodAccessor482.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 $Proxy22.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
    I am SAP XI 3.0 SP-9

    Hello,
    I have the same issue as stated above.
    At runtime sometimes the mapping fails however when executing the mapping from ESR (test operation mapping) with the same payload it is executed succesfully (lookup is to system that is the senderservice of the scenario).
    Anybody a clue.
    Also clearing mapping cache etc. did not solve the problem.
    Thanks,
    Emile

  • XSLT Mapping Error while receiving Base64Binary content

    Dear Experts,
    I am new to SAP PI and working on PI 7.11. In our project we had a requirement to receive PDF file content in Base64 format from third party system by consuming the service provided by third party system with synchronous communication. The adapter we need to use is SOAP
    The reason to use XSLT mapping is as our third party system used some tokens in both the request and response header, I used XSLT mapping to add the required details in request header after receiving the request from ECC system and skip the details in response to send the response to ECC system.
    I have build two XSL files with XSLT mapping programs one for request and another for response using Oxygen XML editor tool. Both are checked, validated without any errors and also tested in ESB – Operation mapping which is successfully executed without errors.
    The third party is sending the PDF content in Base64Binaryformat. I have also tested the WSDL from Oxygen to check the whether the service is working fine, which also successfully receiving the response from third party system. 
    The thing I do not understand and not able to figure out the problem is, when executing the service from ECC by sending a sample request, there is no response coming back and receiving an error saying
    “TransformerException occurred during XSLT mapping Response_03 (URN:COM.XYZ_GET_ABSENCE_DETAILS, aa3a6491-e318-11e2-c1d7-c14948250cb4, -1)”
    I have checked the Communication Channel which working fine. And also the message status in message monitoring wherein Request message has “Cancelled with errors” status and Response has “To Be Delivered” Status.
    Could you please any of you help to figure out the issue and resolve the same.
    Thank you in advance.....
    Regards,
    Govardhan Duvva.

    The response am receiving is like below
    <!-- XML Validation Inbound Channel Response -->
    <html><head><title>Apache Tomcat/6.0.18 - Error report</title><style>
    <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
    H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
    H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
    B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
    P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
    A {color : black;}A.name {color : black;}HR {color : #525D76;}-->
    </style> </head><body>
    <h1>HTTP Status 415 - </h1>
    <HR size="1" noshade="noshade"><p>
    <b>type</b> Status report</p><p><b>message</b>
    <u></u></p><p><b>description</b>
    <u>The server refused this request because the request entity is in a format not supported
    by the requested resource for the requested method ().</u>
    </p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
    And also in SXMB_MONI, there are two call adaptor nodes as in below picture, which means our request is going to the third party system ?

  • Use XSLT mapping for multiple payloads

    Lydia,
    Do you mean multiple mapping as
    <message1>
    Payload1
    </message1>
    <message2>
    Payload2
    </message2>
    If you are generating XSLT mapping using any tool then you have can take xsd from the messagemapping and just map it.
    in you  target structure message1, message2 should be there.
    Gaurav Jain
    Reward Points if answer is helpful

    Thank you for your response.  I tried several variations - including this one - but I can't seem to get the results to match your screen shot.  Also, I am not sure if the tag should be 'Content-Type' or content_type ....
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:ns="http://sap.com/xi/XI/Mail/30">
         <xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
         <xsl:template match="/">
              <xsl:apply-templates select="ORDERS02"/>
         </xsl:template>
         <xsl:template match="ORDERS02">
              <ns:Mail>
                   <Subject>
                        <xsl:text>Purchase Order: </xsl:text>
                   </Subject>
                   <From>
                        <xsl:text>mail.com</xsl:text>
                   </From>
                   <To>
                        <xsl:text>mail.com</xsl:text>
                   </To>
                   <Content_Type>
                        <xsl:text>multipart/mixed; boundary="b1"</xsl:text>
                   </Content_Type>
                   <Content><xsl:text>--b12&#10;</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>Content-Type: text/plain; charset=us-ascii </xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>Content-Transfer-Encoding: 7bit </xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>My Order</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>--b1</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>Content-Type: text/plain; charset=us-ascii</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>Content-Transfer-Encoding: 7bit</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                   <xsl:text>Content-Disposition: attachment; filename="order.dc"</xsl:text>
                   <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>A </xsl:text>
                        <xsl:text>ORD 238            </xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>B</xsl:text>
                        <xsl:text>The Wolf Organization        </xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>C</xsl:text>
                        <xsl:text>PO Box 2044                  </xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:text>D</xsl:text>
                        <xsl:text>York, PA  17404-2044         </xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:text>E</xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:text>F</xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:text>G</xsl:text>
                        <xsl:text>&#10;</xsl:text>
                        <xsl:apply-templates select="IDOC/E1EDP01"/>
                        <xsl:text> </xsl:text>
                   </Content>
                   <xsl:text>--b1--</xsl:text>
              </ns:Mail>
         </xsl:template>
         <xsl:template match="IDOC/E1EDP01">
              <xsl:text>Z</xsl:text>
              <xsl:text>                </xsl:text>
              <xsl:text>&#10;</xsl:text>
         </xsl:template>
    </xsl:stylesheet>

  • I want to genarate fixed legth file using XSLT mapping

    Hi Experts,
    I am doing File to Mail scenario, text file as an attachmetachment in reciver side, i have successfully send the text file as an attachment in the mail. but i need fixed length fields in the file.
    I know we can do it in XSLT mapping using <xsl:if> or <xsl:choose> but i dont know how to use it.
    Can anybody please tell how can i use those statements in XSLT.
    Kind Regards,
    Praveen.

    Hi Stefan,
    This is my XSLT mapping, I am not expert in XSLT please can you help me, i want to do fixed length for "cust_name" field below.
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns0="http://www.Coj.co.za/SapIsuToABSA/DirectDebitFile">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:variable name="break">&lt;br/&gt;</xsl:variable>
    <xsl:variable name="space"> </xsl:variable>
    <xsl:variable name="newline"><xsl:text></xsl:text></xsl:variable>
    <xsl:template match="/">
    <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
    <Subject>Please Check Attached Direct Debit File</Subject>
    <From>joburg</From>
    <To>PraveenG</To>
    <Content_Type>text/plain</Content_Type>
    <Content>
    <xsl:for-each select="MT_SapIsuToABSA_DirectDebitFile/DirectDebitRec/Body">
    <xsl:value-of select="Space1"/>
    <xsl:value-of select="Cust_AccNo"/>
    <xsl:value-of select="Reserve_1"/>
    <xsl:value-of select = "Cust_name" />
    <xsl:value-of select="Cust_Name1"/>
    <xsl:value-of select="Cust_Bank_AccNo"/>
    <xsl:text>          </xsl:text>
    <xsl:value-of select="Space2"/>
    <xsl:value-of select="Cust_Bank_BranchNo"/>
    <xsl:value-of select="Reserve_2"/>
    <xsl:text>   </xsl:text>
    <xsl:value-of select="Space3"/>
    <xsl:value-of select="Cust_AccNo_1"/>
    <xsl:text>       </xsl:text>
    <xsl:value-of select="Space4"/>
    <xsl:value-of select="Reserve_3"/>
    <xsl:value-of select="Deduction_Amnt"/>
    <xsl:text>           </xsl:text>
    <xsl:value-of select="Space5"/>
    <xsl:value-of select="Reserve_4"/>
    <xsl:value-of select="Space6"/>
    <xsl:text>                      </xsl:text>
    <xsl:value-of select="Action_Date"/>
    <xsl:value-of select="Space7"/>
    <xsl:text>        </xsl:text>
    <xsl:value-of select="Reserve_5"/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </Content>
      </ns1:Mail>
      </xsl:template>
      </xsl:stylesheet>

  • XSLT Mapping : RFC Lookup using java helper class

    Hi All,
    I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
    Can anybody help me with step by step approach for the same?
    My basic questions are not answered in the blog as:
    1) where to add the jar file of the java class used in xslt mapping.
    I have added zip file of XSLT mapping in imported archived and using that in mapping.
    Thanks in advace.
    Regards,
    Rohan

    Hi,
    Can u please have look at this in detail , u can easily point out yourself the problem...
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
    Please observe the line,
    xmlns:javamap="java:com.company.group.MappingClass
    in XSLT mapping..
    The packagename of class and class name and XSLT namespace should be matching...
    Babu
    Edited by: hlbabu123 on Sep 29, 2010 6:04 PM

  • How can i access value mapping table using xslt mapping

    Hi All,
    I have maintained value mapping table in integration directory.I want to access the data from the value mapping table in XSLT mapping using java function.PLease suggest me to do this.
    Thanks
    Pullarao.

    Value mapping that thread should solve your query !!!

  • ABAP , JAVA And XSLT Mapping Doc's

    Hi,
    I am new to SAP XI Any body please send me the Doc's Related to ABAP, JAVA And XSLT Mappings. Thanks in Advance.
    Regards
    Kiran.B

    Hi
    Refer to
    ABAP mapping:
    How to Use ABAP Mapping in XI 3.0
    JAVA mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/bd/c91241c738f423e10000000a155106/frameset.htm (Java mapping)
    XSLT mapping:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    /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
    XSLT Mapping with java enhancement
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    XSLT - /people/dirk.roeckmann/blog/2006/07/26/grouping-xml-with-xslt--from-muenchian-method-to-xslt-20
    Regards,
    Kumar.
    Reward points if helpful!!

Maybe you are looking for

  • Some issues after clean installing windows 7 pro 64bit

    Hi, I have a couple of issues, I clean installed windows 7 pro, 64bit, (vanilla) restored my license with ABR and used system update to download all the drivers. (no issues until here) But after restarting the system, I found this issues: 1. I have t

  • How to display record selection settings in the result

    Hi, CR 2008 and 2013 are being used, but this is a rather general question. We are generating different schedules using one source file. Depending on the filter setting on the data scope, say CURRRENTDATE or last month, daily or monthly reports are s

  • What is Open Item Management

    Let me know what is the use of "Open Item Management" in GL creation. I read abt it by clicking F1. But i didn't got clarity. I just came to know that it should be used for balance sheet items. That too there are many balancesheet items like bank acc

  • Run a report of user access rights ?

    Hello, I would like to run a report from Active Directory (windows server 2012) that summarises the access rights that my various users have. Is there a way of doing this ? Thank you for any information.

  • VPD issue affecting scalability of Application

    Hi all -- Our reporting application is using VPD to limit access to the data a user can see. Unfortunately, we are seeing scalability issues when using VPD, so we are wondering if any of you have any insight on what we're doing incorrectly. Here's th