on 02-16-2009 9:35 AM
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,
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.