Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Not what you were looking for? View more on this topic or Ask a question