cancel
Showing results for 
Search instead for 
Did you mean: 

XLLT mapping program

Former Member
0 Kudos

Hi,

I have to send an Idoc from SAP to a 3rd party using webservices. The request message( for web service) has 5 inputs.Idoc has to as a first input rest of the inputs are hard coded values.

Now I want the Idoc in the form of a string on the target side.I should map the Idoc with a string type.I wrote a java function and im gonna call this java function in XSLT mapping.So XSLT takes Idoc as input and pass this idoc to java function.

Could you please tell me how do i pass this para meter from XSLT?

Idoc structure is:

<MATMAS04>

<IDOC BEGIN="1">

<EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>850</MANDT>

<DOCNUM>0000000000670745</DOCNUM>

<DOCREL>640</DOCREL>

TO accept the above idoc as a parameter to XSLT I wrote:

<xsl:param name="IDOC"> <<+++++++++++++++

<xsl:value-of select="//IDOC"/> <<++++++++++++

</xsl:param>

<xsl:template match="/">

..

The lines marked with "<<+++++++++++++++", are im not sure.whether to write the MATMAS04 instead of IDOC ? Im kinda confused could you please help me?.when i execute this interface mapping, im getting "Transformer configuration exception occurred when loading XSLT MappingClass.xsl (http://sonata.com/xi/tm_pro, aa76d240-22f4-11db-90a8-d301ac108104, -1)".

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kiran,

From whatever you have explained, it looks like that you dont need a mapping at all (also explain what your Java function is going to do?). If thats the case, if you place the Java mapping directly in the (IM) Mapping object in IR (without any XSL mapping), the Idoc will be directly passed to the same from R/3, you need not specifically do anything.

Hope this helps

Regards

Vishnu

Shabarish_Nair
Active Contributor
0 Kudos

<xsl:template match="/"> -


> sud come in the begining

....

<xsl:value-of select="//MATMAS04/IDOC/xyx/yy/etc...."/> -


> the field you need

Former Member
0 Kudos

Hi Shabarish,

Thanks a lot for a quick response. Actually i need all the fields of idoc, Could you please tell me ,How can i do that ? and how about param name ? I should use matmas or IDOC as param name ?

<xsl:template match="/">

<xsl:param name="IDOC">

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

</xsl:param>

Thanks

Kiran

Shabarish_Nair
Active Contributor
0 Kudos

try ...

<xsl:for-each select="//MATMAS04">

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

</xsl:for-each>

<xsl:template match="@* | node()">

<xsl:copy>

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

</xsl:copy>

</xsl:template>

This will copy all from your source to target.

Message was edited by: Shabarish Vijayakumar