Update repository to reflect latest changes on PO.

This commit is contained in:
crey443
2024-10-08 11:54:07 +02:00
parent 606bade556
commit a8b5c0b11f
46 changed files with 396 additions and 22769 deletions
+247
View File
@@ -0,0 +1,247 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 22.12.2023 DEV-8311 SAP sends delivery advices to stores MAPPING: SOURCE
- SAP ZFSHDLV TARGET - syspro internal Format -->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" xmlns:map="java.util.Map" xmlns:dyn="com.sap.aii.mapping.api.DynamicConfiguration" xmlns:key="com.sap.aii.mapping.api.DynamicConfigurationKey" exclude-result-prefixes="xs map key dyn">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="inputparam"/>
<xsl:template match="/" name="DELIVERY">
<ns0:Messages>
<ns0:Message1>
<xsl:apply-templates/>
</ns0:Message1>
</ns0:Messages>
</xsl:template>
<xsl:template match="/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC" name="checkForHandlingUnit">
<xsl:if test="./E1EDL20/E1EDL37">
<xsl:call-template name="HandlingUnit"/>
</xsl:if>
<xsl:if test="not(./E1EDL20/E1EDL37)">
<xsl:call-template name="WithOutHandlingUnits"/>
</xsl:if>
</xsl:template>
<xsl:template name="Message">
<xsl:param name="CASE"/>
<xsl:param name="ID"/>
<xsl:param name="SSCCID"/>
<xsl:param name="POSITIONS"/>
<xsl:variable name="PackageCode">
<xsl:value-of select="'33E'"/>
</xsl:variable>
<xsl:variable name="PackageType">
<xsl:value-of select="'BJ'"/>
</xsl:variable>
<XMLDESADV>
<XMLDESADVHEADER>
<DocumentId>
<xsl:value-of select="$ID"/>
</DocumentId>
<DeliveryNote>
<xsl:choose>
<xsl:when test="/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/LIFEX/node()">
<xsl:value-of select="/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/LIFEX"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/VBELN"/>
</xsl:otherwise>
</xsl:choose>
</DeliveryNote>
<DocumentType>
<xsl:value-of select="'XMLDESADV'"/>
</DocumentType>
<DocumentSubType>
<xsl:call-template name="DocumentSubType">
<xsl:with-param name="LFART">
<xsl:value-of select="../E1EDL21/LFART"/>
</xsl:with-param>
</xsl:call-template>
</DocumentSubType>
<DocumentDate>
<xsl:value-of select="format-dateTime(adjust-dateTime-to-timezone(xs:dateTime(concat(
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,1,4),
'-',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,5,2),
'-',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,7,2),
'T',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,1,2),
':',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,3,2),
':',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,5,2)))),
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')"/>
</DocumentDate>
<DeliveryDate>
<xsl:value-of select="format-dateTime(adjust-dateTime-to-timezone(xs:dateTime(concat(
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,1,4),
'-',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,5,2),
'-',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,7,2),
'T',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,1,2),
':',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,3,2),
':',
substring(/ns0:Messages/ns0:Message1/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,5,2)))),
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')"/>
</DeliveryDate>
<ReferenceSupplierOrder/>
<ReferenceBuyerOrder/>
<ReferenceDocument>
<xsl:value-of select="$ID"/>
</ReferenceDocument>
<AllocationReference/>
<SenderGLN>
<xsl:value-of select="//IDOC/E1IDOCENHANCEMENT[IDENTIFIER='SENDERGLN']/DATA"/>
</SenderGLN>
<ReceipientGLN>
<xsl:value-of select="//IDOC/E1IDOCENHANCEMENT[IDENTIFIER='RECEIVERGLN']/DATA"/>
</ReceipientGLN>
<SupplierGLN/>
<BuyerGLN/>
<DeliveryPartyGLN/>
<UltimateConsignyGLN/>
<ReturnGLN/>
<SendFromGLN/>
<SendToGLN/>
<DeliveryCurrency/>
</XMLDESADVHEADER>
<XMLDESADV>
</XMLDESADV>
<XMLPACKAGEGROUP>
<NumberOfPackages>
<xsl:choose>
<xsl:when test="number(format-number(../../../IDOC/E1EDL20/ANZPK,'#')) > 0 ">
<xsl:value-of select="format-number(../../../IDOC/E1EDL20/ANZPK,'#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="1"/>
</xsl:otherwise>
</xsl:choose>
</NumberOfPackages>
<PackageCode>
<xsl:value-of select="$PackageCode"/>
</PackageCode>
</XMLPACKAGEGROUP>
<XMLSSCCGROUP>
<SSCC>
<xsl:value-of select="$SSCCID"/>
</SSCC>
<PackageCode>
<xsl:value-of select="$PackageCode"/>
</PackageCode>
<PackageType>
<xsl:value-of select="$PackageType"/>
</PackageType>
<xsl:copy-of select="$POSITIONS"/>
</XMLSSCCGROUP>
</XMLDESADV>
</xsl:template>
<xsl:template name="WithOutHandlingUnits">
<xsl:variable name="POSITIONS">
<xsl:for-each select="./E1EDL20/E1EDL24">
<XMLITEMS>
<PositionNumber>
<xsl:value-of select="./POSNR"/>
</PositionNumber>
<GTIN>
<xsl:value-of select="./EAN11"/>
</GTIN>
<DeliveredQuantity>
<xsl:value-of select="xs:decimal(./LGMNG)"/>
</DeliveredQuantity>
<QuantityQualifier>
<xsl:call-template name="QuantityQualifier">
<xsl:with-param name="UoM">
<xsl:value-of select="./MEINS"/>
</xsl:with-param>
</xsl:call-template>
</QuantityQualifier>
<DeliveryPrice/>
<ReferenceSupplierOrder>
<xsl:value-of select="./VGBEL"/>
</ReferenceSupplierOrder>
<ReferenceBuyerOrder/>
</XMLITEMS>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="Message">
<xsl:with-param name="CASE" select="'NoHandlingUnit'"/>
<xsl:with-param name="ID" select="./E1EDL20/VBELN"/>
<xsl:with-param name="SSCCID" select="./E1EDL20/VBELN"/>
<xsl:with-param name="POSITIONS" select="$POSITIONS"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="HandlingUnit">
<xsl:for-each select="./E1EDL20/E1EDL37">
<!-- Looping over all E1EDL37 segments and create a new message -->
<xsl:variable name="POSITIONS">
<xsl:for-each select="./E1EDL44">
<xsl:variable name="position" select="./POSNR"/>
<XMLITEMS>
<PositionNumber>
<xsl:value-of select="$position"/>
</PositionNumber>
<GTIN>
<xsl:value-of select="../../E1EDL24[POSNR = $position]/EAN11"/>
</GTIN>
<DeliveredQuantity>
<xsl:value-of select="xs:decimal(../../E1EDL24[POSNR = $position]/LGMNG)"/>
</DeliveredQuantity>
<QuantityQualifier>
<xsl:call-template name="QuantityQualifier">
<xsl:with-param name="UoM">
<xsl:value-of select="../../E1EDL24[POSNR = $position]/MEINS"/>
</xsl:with-param>
</xsl:call-template>
</QuantityQualifier>
<DeliveryPrice/>
<ReferenceSupplierOrder>
<xsl:value-of select="../../E1EDL24[POSNR = $position]/VGBEL"/>
</ReferenceSupplierOrder>
<ReferenceBuyerOrder/>
<xsl:if test="exists(./E1EPC03)">
<xsl:for-each select="./E1EPC03">
<XMLEPC>
<EPC>
<xsl:value-of select="./EPC"/>
</EPC>
</XMLEPC>
</xsl:for-each>
</xsl:if>
</XMLITEMS>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="Message">
<xsl:with-param name="CASE" select="'HandlingUnit'"/>
<xsl:with-param name="ID" select="concat(../VBELN,'_',./EXIDV)"/>
<xsl:with-param name="SSCCID" select="format-number(./EXIDV,'#')"/>
<xsl:with-param name="POSITIONS" select="$POSITIONS"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<xsl:template name="DocumentSubType">
<xsl:param name="LFART"/>
<xsl:choose>
<xsl:when test="$LFART = 'ZIL'">
<xsl:value-of select="'DESADV_IBT'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'DESADV_GI'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="QuantityQualifier">
<xsl:param name="UoM"/>
<xsl:choose>
<xsl:when test="$UoM = 'PCE'">
<xsl:value-of select="'12'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'999'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 22.12.2023 DEV-8311 SAP sends delivery advices to stores MAPPING: SOURCE
- SAP ZFSHDLV TARGET - syspro internal Format -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:output method="xml" omit-xml-declaration="no"
indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="/XMLRECADV[XMLRECADVHEADER/DocumentSubType = 'RECADV_GI']" name="GOODS_RECEIPT">
<xsl:variable name="Location"><xsl:value-of select="./XMLRECADVHEADER/UltimateConsignyGLN"/></xsl:variable>
<xsl:variable name="Separator"><xsl:value-of select="'_'"/></xsl:variable>
<DELVRY07>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:call-template name="EDI_DC40-8309">
<xsl:with-param name="sendFromGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendFromGLN"/>
</xsl:with-param>
<xsl:with-param name="sendToGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendToGLN"/>
</xsl:with-param>
</xsl:call-template>
<E1EDL20 >
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:choose>
<xsl:when test="contains(./XMLRECADVHEADER/ReferenceDocument,'_')">
<!--<TRAID><xsl:value-of select="format-number(substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator),'0000000000')"/></TRAID>-->
<VBELN><xsl:value-of select="format-number(substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator),'0000000000')"/></VBELN>
</xsl:when>
<xsl:otherwise>
<!--<TRAID><xsl:value-of select="format-number(./XMLRECADVHEADER/ReferenceDocument,'0000000000')"/></TRAID>-->
<VBELN><xsl:value-of select="format-number(./XMLRECADVHEADER/ReferenceDocument,'0000000000')"/></VBELN>
</xsl:otherwise>
</xsl:choose>
<E1EDL18>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<QUALF><xsl:call-template name="Qualifier-8309"/></QUALF>
</E1EDL18>
<!-- Source has deep structure of SSCC-Group with Items / therefore using -->
<!-- <xsl:for-each select="./*/XMLRECADVITEMS">
<E1EDL24>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<POSNR><xsl:value-of select="position()"/></POSNR>
<WERKS><xsl:value-of select="$Location"/></WERKS>
<LIFIMG> <xsl:value-of select="OriginalQuantity"/></LIFIMG>
<EAN11> <xsl:value-of select="./GTIN"/></EAN11>
<POSEX> <xsl:value-of select="./PositionNumber"/></POSEX>
</E1EDL24>
</xsl:for-each> -->
</E1EDL20>
</IDOC>
</DELVRY07>
</xsl:template>
<xsl:template match="/XMLRECADV[XMLRECADVHEADER/DocumentSubType = 'RECADV_IBT']">
<xsl:variable name="Location"><xsl:value-of select="./XMLRECADVHEADER/UltimateConsignyGLN"/></xsl:variable>
<xsl:variable name="Separator"><xsl:value-of select="'_'"/></xsl:variable>
<DELVRY07>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:call-template name="EDI_DC40-8309">
<xsl:with-param name="sendFromGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendFromGLN"/>
</xsl:with-param>
<xsl:with-param name="sendToGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendToGLN"/>
</xsl:with-param>
</xsl:call-template>
<E1EDL20 >
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:choose>
<xsl:when test="contains(./XMLRECADVHEADER/ReferenceDocument,'_')">
<!--<TRAID><xsl:value-of select="substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator)"/></TRAID>-->
<VBELN><xsl:value-of select="substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator)"/></VBELN>
</xsl:when>
<xsl:otherwise>
<!--<TRAID><xsl:value-of select="./XMLRECADVHEADER/ReferenceDocument"/></TRAID>-->
<VBELN><xsl:value-of select="./XMLRECADVHEADER/ReferenceDocument"/></VBELN>
</xsl:otherwise>
</xsl:choose>
<E1EDL18>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<QUALF><xsl:call-template name="Qualifier-8309"/></QUALF>
</E1EDL18>
<!-- Source has deep structure of SSCC-Group with Items / therefore using *-->
<xsl:for-each select="./*/XMLRECADVITEMS">
<!--<E1EDL24>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<POSNR><xsl:value-of select="position()"/></POSNR>
<WERKS><xsl:value-of select="$Location"/></WERKS>
<LIFIMG> <xsl:value-of select="OriginalQuantity"/></LIFIMG>
<EAN11> <xsl:value-of select="./GTIN"/></EAN11>
<POSEX> <xsl:value-of select="./PositionNumber"/></POSEX>
</E1EDL24>-->
</xsl:for-each>
</E1EDL20>
</IDOC>
</DELVRY07>
</xsl:template>
<xsl:include href="./valueMaps.xsl" />
</xsl:stylesheet>
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="DocumentType">
<xsl:param name="DocumentType" />
<xsl:choose>
<xsl:when test="'DEV-8311'">
<xsl:value-of select="'XMLDESADV'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="' '" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="DocumentSubType">
<xsl:param name="LFART" />
<xsl:choose>
<xsl:when test="$LFART = 'ZIL'">
<xsl:value-of select="'DESADV_IBT'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'DESADV_GI'" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="QuantityQualifier">
<xsl:param name="UoM" />
<xsl:choose>
<xsl:when test="$UoM = 'PCE'">
<xsl:value-of select="'12'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'999'" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="EDI_DC40-8309">
<xsl:param name="sendFromGLN" />
<xsl:param name="sendToGLN" />
<EDI_DC40>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<TABNAM>EDI_DC40</TABNAM>
<MANDT>100</MANDT>
<DIRECT>2</DIRECT>
<OUTMOD></OUTMOD>
<DOCNUM></DOCNUM>
<IDOCTYP>DELVRY07</IDOCTYP>
<MESTYP>WHSCON</MESTYP>
<MESCOD>WE</MESCOD>
<STDMES>DESADV</STDMES>
<SNDPOR>SAPPO</SNDPOR> <!-- change to Syspro -->
<SNDPRT>LS</SNDPRT>
<SNDPRN>SYSPRO</SNDPRN>
<RCVPOR>SAP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPFC></RCVPFC>
<RCVPRN>SAP</RCVPRN>
<SNDLAD><xsl:value-of select="$sendFromGLN"/></SNDLAD>
<RCVLAD><xsl:value-of select="$sendToGLN"/></RCVLAD>
<CREDAT></CREDAT>
<CRETIM></CRETIM>
<SERIAL><xsl:value-of select="current-dateTime()"/></SERIAL>
</EDI_DC40>
</xsl:template>
<xsl:template name="Qualifier-8309">
<xsl:value-of select="'PGI'" />
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" exclude-result-prefixes="xs" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template name="PHYSICAL_INVENTORY" match="/">
<WVINVE03>
<IDOC>
<xsl:attribute name="BEGIN">
<xsl:value-of select="1"/>
</xsl:attribute>
<EDI_DC40>
<xsl:attribute name="SEGMENT">
<xsl:value-of select="1"/>
</xsl:attribute>
<TABNAM>EDI_DC40</TABNAM>
<MANDT/>
<DOCNUM/>
<DOCREL/>
<STATUS/>
<MESCOD/>
<DIRECT>2</DIRECT>
<OUTMOD/>
<IDOCTYP>WVINVE03</IDOCTYP>
<MESTYP>WVINVE</MESTYP>
<REFINT><xsl:value-of select="@FILENAME"/></REFINT>
<SNDPOR>SAPPO</SNDPOR>
<SNDPRT>KU</SNDPRT>
<SNDPRN>XXXX</SNDPRN>
<RCVPOR/>
<RCVPRT>LS</RCVPRT>
<RCVPFC/>
<RCVPRN>SAP</RCVPRN>
<SNDLAD>
<xsl:value-of select="/XMLINVRPT/XMLINVRPTHEADER/SiteGLN"/>
</SNDLAD>
<RCVLAD/>
<CREDAT>
<xsl:value-of select="format-dateTime(xs:dateTime(/XMLINVRPT/XMLINVRPTHEADER/DocumentDate),&apos;[Y0000][M00][D00]&apos;)"/>
</CREDAT>
<CRETIM>
<xsl:value-of select="format-dateTime(xs:dateTime(/XMLINVRPT/XMLINVRPTHEADER/DocumentDate),&apos;[H00]:[m00]:[s00]&apos;)"/>
</CRETIM>
<SERIAL>
<xsl:value-of select="current-dateTime()"/>
</SERIAL>
</EDI_DC40>
<E1WVINH>
<xsl:attribute name="SEGMENT">
<xsl:value-of select="1"/>
</xsl:attribute>
<LGORT>1000</LGORT>
<!-- DocumentId ohne &amp;apos;-&amp;apos; -->
<XBLNI>
<xsl:value-of select="translate(/XMLINVRPT/XMLINVRPTHEADER/DocumentId,&apos;-&apos;,&apos;&apos;)"/>
</XBLNI>
<IBLNR/>
<DDATE>
<xsl:value-of select="format-dateTime(xs:dateTime(/XMLINVRPT/XMLINVRPTHEADER/InventoryDate),&apos;[Y0000][M00][D00]&apos;)"/>
</DDATE>
<!--TODO keine doppelpunkte -->
<DTIME>
<xsl:value-of select="format-dateTime(xs:dateTime(/XMLINVRPT/XMLINVRPTHEADER/InventoryDate),&apos;[H00][m00][s00]&apos;)"/>
</DTIME>
<FILIALE>
<xsl:value-of select="/XMLINVRPT/XMLINVRPTHEADER/SiteGLN"/>
</FILIALE>
<INVNU/>
<xsl:for-each select="/XMLINVRPT/XMLINVRPTITEMS/XMLINVRPTITEM">
<E1WVINI>
<xsl:attribute name="SEGMENT">
<xsl:value-of select="1"/>
</xsl:attribute>
<!-- use GTIN -->
<QUALARTNR>003</QUALARTNR>
<ZEILI>
<xsl:value-of select="PositionNumber"/>
</ZEILI>
<ARTNR>
<xsl:value-of select="GTIN"/>
</ARTNR>
<ERFMG>
<xsl:value-of select="InventoryQuantity"/>
</ERFMG>
<xsl:if test="InventoryQuantity = 0">
<XNULL>X</XNULL>
</xsl:if>
</E1WVINI>
</xsl:for-each>
</E1WVINH>
</IDOC>
</WVINVE03>
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- change for gln -->
<xsl:template name="WriteOffGLNs">
<xsl:param name="sendToGLN" />
<xsl:choose>
<xsl:when test="$sendToGLN = '7321609001155'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609001162'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609004118'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609004125'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609004668'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609004675'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609005566'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609005573'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609006662'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609006679'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609007119'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609007126'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609007911'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609007928'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609008567'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609008574'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609008710'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609008727'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609009168'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:when test="$sendToGLN = '7321609009175'">
<xsl:value-of select="true()" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="false()" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"
exclude-result-prefixes="xs">
<xsl:output method="xml"
indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="/ns0:Messages/ns0:Message1">
<xsl:variable name="writeOff">
<xsl:call-template name="WriteOffGLNs">
<xsl:with-param name="sendToGLN">
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/SendToGLN" />
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$writeOff = true()">
<xsl:call-template name="WRITE_OFF" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="STOCK_TRANSFER_ORDER" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:include href="./GLNValueMap.xsl" />
<xsl:include href="./writeOff.xsl" />
<xsl:include href="./stockTransferOrder.xsl" />
</xsl:stylesheet>
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"
exclude-result-prefixes="xs">
<xsl:output method="xml"
indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template name="STOCK_TRANSFER_ORDER">
<ns0:Messages>
<ns0:Message1>
<WGSREQ02>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:value-of
select="1" /></xsl:attribute>
<EDI_DC40>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<TABNAM>EDI_DC40</TABNAM>
<MANDT></MANDT>
<DOCNUM></DOCNUM>
<DOCREL></DOCREL>
<STATUS></STATUS>
<MESCOD>
<xsl:if
test="./XMLDESADV/XMLDESADVHEADER/SendFromGLN != ''">
<xsl:value-of select="SFS" />
</xsl:if>
</MESCOD>
<DIRECT>2</DIRECT>
<OUTMOD></OUTMOD>
<IDOCTYP>WGSREQ02</IDOCTYP>
<MESTYP>WGSREQ</MESTYP>
<SNDPOR>SAPPO</SNDPOR>
<SNDPRT>KU</SNDPRT>
<SNDPRN>XXXX</SNDPRN>
<RCVPOR>SAP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPFC></RCVPFC>
<RCVPRN>SAP</RCVPRN>
<SNDLAD>
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/SendFromGLN" />
</SNDLAD>
<RCVLAD>
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/SendToGLN" />
</RCVLAD>
<CREDAT>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[Y0000][M00][D00]')" />
</CREDAT>
<CRETIM>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[H00]:[m00]:[s00]')" />
</CRETIM>
<SERIAL>
<xsl:value-of select="current-dateTime()" />
</SERIAL>
</EDI_DC40>
<E1WGRK1>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<DATUM>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[Y0000][M00][D00]')" />
</DATUM>
<ACTION></ACTION>
<xsl:for-each
select="./XMLDESADV/XMLSSCCGROUP/XMLITEMS">
<E1WGRP1>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<MENGE>
<xsl:value-of select="./DeliveredQuantity" />
</MENGE>
<EAN11>
<xsl:value-of select="./GTIN" />
</EAN11>
<BEDAT>
<xsl:value-of
select="format-dateTime(xs:dateTime(../../XMLDESADVHEADER/DocumentDate),'[Y0000][M00][D00]')" />
</BEDAT>
<EINDT>
<xsl:value-of
select="format-dateTime(xs:dateTime(../../XMLDESADVHEADER/DeliveryDate),'[Y0000][M00][D00]')" />
</EINDT>
<BEDNR>
<xsl:value-of
select="../../XMLDESADVHEADER/DocumentId" />
</BEDNR>
<RESWK>
<xsl:value-of
select="../../XMLDESADVHEADER/SendFromGLN" />
</RESWK>
<KUNNR>
<xsl:value-of
select="../../XMLDESADVHEADER/SendToGLN" />
</KUNNR>
<POSEX>
<xsl:value-of select="./PositionNumber" />
</POSEX>
</E1WGRP1>
</xsl:for-each>
</E1WGRK1>
</IDOC>
</WGSREQ02>
</ns0:Message1>
<ns0:Message2></ns0:Message2>
</ns0:Messages>
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"
exclude-result-prefixes="xs">
<xsl:output method="xml"
indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template name="WRITE_OFF">
<ns0:Messages>
<ns0:Message1></ns0:Message1>
<ns0:Message2>
<WPUWBW01>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:value-of
select="1" /></xsl:attribute>
<EDI_DC40>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<TABNAM>EDI_DC40</TABNAM>
<MANDT></MANDT>
<DOCNUM></DOCNUM>
<DOCREL></DOCREL>
<STATUS></STATUS>
<MESCOD></MESCOD>
<DIRECT>2</DIRECT>
<OUTMOD></OUTMOD>
<IDOCTYP>WPUWBW01</IDOCTYP>
<MESTYP>WPUWBW</MESTYP>
<SNDPOR>SAPPO</SNDPOR>
<SNDPRT>KU</SNDPRT>
<SNDPRN>XXXX</SNDPRN>
<RCVPOR>SAP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPFC></RCVPFC>
<RCVPRN>SAP</RCVPRN>
<SNDLAD>
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/SendFromGLN" />
</SNDLAD>
<RCVLAD>
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/SendToGLN" />
</RCVLAD>
<CREDAT>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[Y0000][M00][D00]')" />
</CREDAT>
<CRETIM>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[H00]:[m00]:[s00]')" />
</CRETIM>
<SERIAL>
<xsl:value-of select="current-dateTime()" />
</SERIAL>
</EDI_DC40>
<E1WPG01>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<BELEGDATUM>
<xsl:value-of
select="format-dateTime(xs:dateTime(./XMLDESADV/XMLDESADVHEADER/DocumentDate),'[Y0000][M00][D00]')" />
</BELEGDATUM>
<BONNUMMER>
<xsl:value-of
select="./XMLDESADV/XMLDESADVHEADER/DocumentId" />
</BONNUMMER>
<xsl:for-each
select="./XMLDESADV/XMLSSCCGROUP/XMLITEMS">
<E1WPG02>
<xsl:attribute name="SEGMENT"><xsl:value-of
select="1" /></xsl:attribute>
<!-- use GTIN -->
<QUALARTNR>003</QUALARTNR>
<LITEM>
<xsl:value-of select="PositionNumber" />
</LITEM>
<ARTNR>
<xsl:value-of select="GTIN" />
</ARTNR>
<!-- send to gln (letzten drei zifern ohne prüf) -->
<xsl:variable name="SendToGLN">
<xsl:value-of
select="../../XMLDESADVHEADER/SendToGLN" />
</xsl:variable>
<xsl:variable name="SendToGLNLength">
<xsl:value-of select="string-length($SendToGLN)" />
</xsl:variable>
<BEWART>
<xsl:value-of
select="substring($SendToGLN, $SendToGLNLength - 3, 3)" />
</BEWART>
<MENGE>
<xsl:value-of select="DeliveredQuantity" />
</MENGE>
</E1WPG02>
</xsl:for-each>
</E1WPG01>
</IDOC>
</WPUWBW01>
</ns0:Message2>
</ns0:Messages>
</xsl:template>
</xsl:stylesheet>