cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.4: XSLT Mapping for Dynamic Configuration.

former_member183910
Participant
0 Kudos

Hi Experts,

I am getting the below error while executing XSLT mapping. I am trying to set file name dynamically in mapping(this would be used in receiver file adapter).

        Transformer Configuration Exception occurred when loading XSLT Concur_TransformToFile.xsl; details: The first argument to the non-static Java function 'put' is not a valid object reference.

    

this is the XSLT mapping

<?xml version="1.0"?>

<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:template match="/">

                  <xsl:variable name="FileName" select="//FileName"/>

                  <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="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $FileName)" />

</xsl:template>

</xsl:stylesheet>

Any idea why it is throwing this error.

Thanks,

Sandeep Maurya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you ever find the cause of this error? I'm facing the exact same issue in PI 7.4.

former_member183910
Participant
0 Kudos

Yes Tom, use option "SAP XML ToolKit" option in operation mapping.

When you create operation mapping, by default it is not checked.

Thanks,

Sandeep Maurya.

Former Member
0 Kudos

Thank you for the update Sandeep, this resolved the issue for me as well.

Former Member
0 Kudos

Hello,

I am receiveing the same error in SAP PO 7.5. I examined your solution and applied it. But the problem still continuing. It is working on SAP PO 7.4

Is stylesheet version 2.0 in SAP PO 7.5 ? The style sheet is in the attachment.

Former Member
0 Kudos

Our system is running 7.50 though the components are presumably still on 7.40. As far as I know PI 7.50 still uses XSLT 1.0 and running 2.0 requires activating a custom processor.

Former Member
0 Kudos

I used stylesheet version 1.0 But the error is still remaining

Former Member
0 Kudos

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:ns0="http://sap.com/xi/SFIHCM01"

  xmlns="urn:fault.sfapi.successfactors.com"

  xmlns:ns2="urn:sfobject.sfapi.successfactors.com"

  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 method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

   <xsl:param name="sessionId">

      <xsl:value-of select="//sessionId"/>

   </xsl:param>

   <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/System/HTTP', 'Cookie')"/>

      <xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $sessionId)"/>

    

  <ns2:upsert>

          <xsl:apply-templates select="upsert/type"/>

          <xsl:apply-templates select="upsert/sfobject"/>

          <xsl:apply-templates select="upsert/processingParam"/>

      </ns2:upsert>

   </xsl:template>

   <xsl:template match="sfobject">

      <ns2:sfobject>

         <xsl:apply-templates select="*"/>

      </ns2:sfobject>

   </xsl:template>

   <xsl:template match="processingParam">

      <ns2:processingParam>

         <xsl:apply-templates select="*"/>

      </ns2:processingParam>

   </xsl:template>

   <!-- filter -->

   <xsl:template match="id"/>

   <xsl:template match="*">

      <xsl:element name="ns2:{local-name()}" namespace="urn:sfobject.sfapi.successfactors.com">

         <xsl:apply-templates select="@*|*|text()"/>

      </xsl:element>

   </xsl:template>

</xsl:stylesheet>

There is a problem about

xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"

  xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey"

The error is :

        Transformer Configuration Exception occurred when loading XSLT upsert_mapping.xsl; details: The first argument to the non-static Java function 'put' is not a valid object reference.

It is working on 7.4 but it is not working on 7.5

helmut_skolaut3
Active Participant
0 Kudos

Hi,

I have exactly the same problem. When I have SAP XML Toolkit acticated, I run into the problem mentioned here:

https://scn.sap.com/thread/3928151

SAP Note 2338800 tells to deactivate the SAP XML Toolkit. Now I  am coming into that new issue ;-(

Any ideas how to solve?

Regards

   Helmut

helmut_skolaut3
Active Participant
0 Kudos

Please also consider SAP NOTE 1731772

Answers (3)

Answers (3)

Former Member
0 Kudos

I have modified ur XSLT -

Copy/paste below code and test.

<?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="/">

   <xsl:variable name="FileName" select="//FileName"/>

     <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="new-value" select="concat($dynamic-value, $FileName)"/>

      <xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>

  

   </xsl:template>

</xsl:stylesheet>

Thanks

Amit Srivastava

former_member183910
Participant
0 Kudos

Hi Amit,

did you test this code in PI 7.4? I am still getting the same error.

Thanks

Sandeep Maurya.

iaki_vila
Active Contributor
0 Kudos

Hi Sandeep,

Follow the steps pointed out by

Former Member
0 Kudos

Hello,

Inputparam parameter declaration is missing? Add the same and then check.

XSLT Mapping of Adapter-Specific Message Attributes - Enterprise Services Repository - SAP Library

Thanks

Amit Srivastava