cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT MAPPING

Former Member
0 Kudos

Hi Experts,

I want to develop one xslt mapping for my interface, but this is the first time i need to develop, Could anyone help me in this regard how to create xslt mapping step by step.

i searced sdn but unable to pick the correct one developing from scratch.

step by step process i need

regards,

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Amruth,

First you have to know some functions in XSLT.

Open w3schools.com you will find good meterials with working examples.

Below Code Smaple XSLT Mapping .

Converting ORDERS04 IDoc in to CIDX Order Create.

<?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" omit-xml-declaration="yes" encoding="UTF-8" />

<xsl:param name="Role" select="'seller'" />

<xsl:variable name="regionCode" select="'SA'" />

<xsl:param name="orderType" select="'OrderResponse'" />

<xsl:variable name="MarketPlace" select="'ELE'" />

- <xsl:template match="/">

- <xsl:choose>

- <xsl:when test="//ORDERS04">

- <xsl:call-template name="ORDERS04_Idoc">

<xsl:with-param name="ORDERS04" select="//ORDERS04/IDOC" />

</xsl:call-template>

</xsl:when>

- <xsl:when test="//YRDAORDR01">

- <xsl:call-template name="ORDERS04_Idoc">

<xsl:with-param name="ORDERS04" select="//YRDAORDR01/IDOC" />

</xsl:call-template>

</xsl:when>

</xsl:choose>

</xsl:template>

- <xsl:template name="ORDERS04_Idoc">

<xsl:param name="ORDERS04" />

- <InputXMLs>

- <Payload>

- <Order DocType="{$orderType}" Version="2.0.2">

- <Header>

- <ThisDocumentIdentifier>

- <xsl:choose>

- <xsl:when test="$orderType = 'OrderResponse' and $regionCode = 'NAFTA'">

- <DocumentIdentifier>

<xsl:value-of select="$ORDERS04/EDI_DC40/DOCNUM" />

</DocumentIdentifier>

</xsl:when>

- <xsl:otherwise>

- <DocumentIdentifier>

<xsl:if test="$MarketPlace!='WA'">IDOC</xsl:if>

<xsl:value-of select="$ORDERS04/EDI_DC40/DOCNUM" />

</DocumentIdentifier>

</xsl:otherwise>

</xsl:choose>

</ThisDocumentIdentifier>

- <ThisDocumentDateTime>

- <xsl:choose>

- <xsl:when test="$orderType = 'OrderResponse' and $regionCode = 'NAFTA'">

- <xsl:choose>

- <xsl:when test="$ORDERS04/E1EDK03/UZEIT">

- <DateTime DateTimeQualifier="On">

<xsl:value-of select="$ORDERS04/E1EDK03/DATUM" />

T

<xsl:value-of select="$ORDERS04/E1EDK03/UZEIT" />

</DateTime>

</xsl:when>

- <xsl:otherwise>

- <DateTime DateTimeQualifier="On">

<xsl:value-of select="$ORDERS04/E1EDK03/DATUM" />

</DateTime>

</xsl:otherwise>

</xsl:choose>

</xsl:when>

- <xsl:otherwise>

- <DateTime DateTimeQualifier="On">

<xsl:value-of select="$ORDERS04/EDI_DC40/CREDAT" />

T

<xsl:value-of select="$ORDERS04/EDI_DC40/CRETIM" />

</DateTime>

</xsl:otherwise>

</xsl:choose>

</ThisDocumentDateTime>

After developing your XSLT check its valid or not.

use Stlus Studio or XML Spy.

after that genearate Jar file or Zip File.

Import using Imported Archieves.

select mapping as XSLT,in Interface Mapping.

You have to be expertise in XSLT,then only you can develop XSLT Mapping.

XSLT very easy.

Cheers,

Raj

Former Member
0 Kudos

thanks Raja,

you got what i am expecting, but one more doubt, are there any classes or functions to be imported and what is the parser we are using here.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Amruth,

we no need to import any parcer, bcz SAP XI internally uses XSLT Parcer.

wt u have to do build XSLT Program.genarate ZIP file or jar IMPORT itI.

Thats it buddy,

Cheers,

raj

Former Member
0 Kudos

Hi

Check this step-by-step process in wiki page

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/fileTOFile-UsingXSLTmapping(forBeginners)

Regards

Vishnu

Answers (1)

Answers (1)

JoelTrinidade
Active Contributor
0 Kudos

Hi Amruth,

Please go through the following for starters....

/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

Rgds

joel

Former Member
0 Kudos

Yeah joel,

Thanks for your support, but i dont know how to start the mapping( xslt) right from data type.

Will you please explain me in step by step

please help me...

prateek
Active Contributor
0 Kudos

The only difference in your IR development would be replacing the Message Mapping creation step by creating an XSL file Outside XI and importing it. You may use some tools like XMLSpy or Stylus for generating these XSL files.

Regards,

Prateek