Counter increment using XSLT

Hello Guys,
I am finding it difficult to increase my counter in XSLT program.
The counter is being calculated inside the template POHeader inside the PART Node set.I would like to increase this counter for
each every haeder as expained in the example.
Can someone suggest how to increase my counter?
For Eg :
Expected output:
850HD20102010122100000001 0095AAF52C, , * // 00001  before 009
850H1000115 1012210095A AS
850H4
850H7
850N1 0095A
850N2AFL HUNGARY D02RG
850D1 00000100000000015EA 96FG 10374 AA
850D6Seal
850HD20102010122100000002 0095AAF52C, , * // 00002 
850H1000115 1012210095A SS
850H4
850H7
850N1 0095A
850N2VALEO AUTOSYSTEMY SP.Z.O.O. EBECA
850D1 00000100000001202EA DSFSDF SDF
850D6WIRE ASSY
850D1 00000200000002118EA TEST
850D6ARM-WIPER
850HD20102010122100000003  0160AAF52C, , * // 00003
850H1000115 1012210160A SS
850H4
850H7
850N1 0160A
850N2VALEO AUTOSYSTEMY SP.Z.O.O. EBECA
850D1 00000100000000016EA V97FB 17526 BD
850D6Arm Assy - Wiper
But i am getting it as :
850HD201020101221000000010095AAF52C, , *
850H1000115 1012210095A AS
850H4
850H7
850N1 0095A
850N2AFL HUNGARY D02RG
850D1 00000100000000015EA 96FG 10374 AA
850D6Seal
850HD201020101221000000010095AAF52C, , *
850H1000115 1012210095A SS
850H4
850H7
850N1 0095A
850N2VALEO AUTOSYSTEMY SP.Z.O.O. EBECA
850D1 00000100000001202EA DSFSDF SDF
850D6WIRE ASSY
850D1 00000200000002118EA TEST
850D6ARM-WIPER
850HD201020101221000000010160AAF52C, , *
850H1000115 1012210160A SS
850H4
850H7
850N1 0160A
850N2VALEO AUTOSYSTEMY SP.Z.O.O. EBECA
850D1 00000100000000016EA V97FB 17526 BD
850D6Arm Assy - Wiper
The below is the XSLTcode:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--Correction V2.0  23.11.2010 -->
<!-- POtype added-->
<!DOCTYPE xsl:stylesheet [
<!ENTITY linefeed "<xsl:text>
</xsl:text>">
<!ENTITY tab "<xsl:text>     </xsl:text>">
<!ENTITY space "<xsl:text> </xsl:text>">
<!ENTITY space5 "<xsl:text>     </xsl:text>">
<!ENTITY space10 "<xsl:text>          </xsl:text>">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:n0="urn:-com:fcsd:btr:eu:sapscm:schedAgrRels">
    <xsl:output method="text"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="n0:COMMONFORMAT_MT">   
           <xsl:variable name="SHIPFROM" select="//Entity/ShipFrom"/>
               <xsl:for-each select="//Entity">
                    <xsl:for-each select="Part">
                                  <xsl:if test="SupplierCode = 'Y'">
                    <xsl:call-template name="RoutingHeader"/>
                    <xsl:call-template name="POHeader"/>
                    <xsl:call-template name="PODetails"/>
                                   </xsl:if>
                            <xsl:apply-templates select="."/>
                    </xsl:for-each>
                </xsl:for-each>
    </xsl:template>
<!-- Stock Order Header Record-->
<xsl:template name="RoutingHeader">
        <xsl:variable name="SHIPFROM" select="../ShipFrom"/>
        <xsl:variable name="SHIPTO" select="../ShipTo"/>
        <!-- HD Primary Routing Record-->
        <xsl:text>850HD2010</xsl:text>
        <xsl:value-of select="/n0:COMMONFORMAT_MT/Header/CreationYear"/>
        <xsl:value-of select="format-number(/n0:COMMONFORMAT_MT/Header/CreationMonth,'00')"/>
        <xsl:value-of select="format-number(/n0:COMMONFORMAT_MT/Header/CreationDay,'00')"/>   
        <xsl:text>0000</xsl:text> <!-- TIME ZERO-->
              <xsl:value-of select="format-number(position(),'0000')"/>
        <xsl:value-of select="substring($SHIPTO,1,5)"/>
        <xsl:text>AF52C</xsl:text>
        <xsl:text>,</xsl:text>
        &space5;
        <xsl:text>,</xsl:text>
        &space5;
        <xsl:text>*</xsl:text>
        &linefeed;
</xsl:template>
<xsl:template name="PODetails">
<xsl:variable name="SHIPFROM" select="../ShipFrom"/>
<xsl:variable name="SHIPTO" select="../ShipTo"/>
<!-- H4 Contacts-->
    <xsl:text>850H4</xsl:text>
    &linefeed;
<!-- H7 FoB Other Items-->
    <xsl:text>850H7</xsl:text>
    &linefeed;
<!-- N1 Buying name address-->
    <xsl:text>850N1</xsl:text>
    <xsl:value-of select="substring(../ShipToName,1,30)"/>
     <xsl:variable name="LEN1" select="string-length(../ShipToName)"/>
    <xsl:value-of select="substring('                              ',1,30-$LEN1)"/>
    <xsl:value-of select="substring($SHIPTO,1,5)"/>
    &linefeed;
<!-- N2 Supplier Name address-->
    <xsl:text>850N2</xsl:text>
    <xsl:value-of select="substring(../ShipFromName,1,30)"/>
    <xsl:variable name="LEN2" select="string-length(../ShipFromName)"/>
    <xsl:value-of select="substring('                              ',1,30-$LEN2)"/>
    <xsl:value-of select="substring($SHIPFROM,1,5)"/>
   &linefeed;
<!-- N3 Ship-To addresses-->
    <xsl:choose>
        <xsl:when test="$SHIPFROM = 'AF52M'">
            <xsl:text>850N3                              59791</xsl:text>
           &linefeed;
        </xsl:when>
    </xsl:choose>
    </xsl:template>
<xsl:template name="POHeader">
        <xsl:variable name="SHIPFROM" select="../ShipFrom"/>
        <xsl:variable name="SHIPTO" select="../ShipTo"/>
        <xsl:variable name="POTYPE" select="POType"/>   
<!Primary Contorl Record>
        <xsl:text>850H1</xsl:text>
        <xsl:variable name="PONR" select="../ReleaseNumberPrimary"/>
        <xsl:variable name="LEN" select="string-length($PONR)"/>
        <xsl:value-of select="$PONR"/>
        <xsl:value-of select="substring('                  ',1,18-$LEN)"/>
        &space10;&space5;&space;&space;&space;
        <xsl:value-of select="substring(/n0:COMMONFORMAT_MT/Header/CreationYear,3,2)"/>
        <xsl:value-of select="format-number(/n0:COMMONFORMAT_MT/Header/CreationMonth,'00')"/>
        <xsl:value-of select="format-number(/n0:COMMONFORMAT_MT/Header/CreationDay,'00')"/>       
        <xsl:value-of select="$SHIPTO"/>
        &space10;&space10;&space10;&space5;
<!<xsl:text>SS</xsl:text>>
        <xsl:value-of select="$POTYPE"/>
        &linefeed;
</xsl:template>
    <xsl:template match="Part">
    <!-- D1 Part Record-->
            <xsl:text>850D1</xsl:text>
            &space5;&space;
            <xsl:variable name="POS" select="position()"/>
            <xsl:value-of select="format-number(count(preceding-sibling::Part) + 1,'000000')"/>
            <xsl:variable name="QTY" select="ScheduleLines[1]/Quantity"/>
            <xsl:value-of select="format-number($QTY,'00000000000')"/>
            <xsl:text>EA</xsl:text>
            &space10;&space5;&space;
            <xsl:call-template name="FormatPartNumber"/>
            <xsl:if test="string-length(VendorPart/VendorPartID) > 0">
                    &space10;&space10;&space10;
                    <xsl:value-of select="VendorPart/VendorPartID"/>
            </xsl:if>
            &linefeed;
  <!-- D6 Part Description -->
            <xsl:text>850D6</xsl:text>
            <xsl:value-of select="substring(Description,1,80)"/>
            &linefeed;
    </xsl:template>
<!Formatting PartNumber>
    <xsl:template name="FormatPartNumber">
        <xsl:if test="../ShipFrom = 'FI05M'">
            <xsl:variable name="T1" select="substring-before(EPNCode,' ')"/>
            <xsl:variable name="T2T"  select="substring-after(EPNCode,' ')"/>
            <xsl:variable name="T2" select="substring-before($T2T,' ')"/>
            <xsl:variable name="T3" select="substring-after($T2T,' ')"/>
            <xsl:if test="$T3 != ''">
                <xsl:choose>
                    <xsl:when test="$T3 != '-'">
                       <xsl:variable name="PN" select="concat($T1,'/',$T2,'/',substring($T3,1,2),'/',substring($T3,3))"/>
                    </xsl:when>
                    <xsl:otherwise>
                       <xsl:variable name="PN" select="concat($T1,'/',$T2,'/','/')"/>   
                    </xsl:otherwise>
                </xsl:choose>
                       <xsl:variable name="LEN" select="string-length($PN)"/>
                       <xsl:value-of select="$PN"/>
                        <xsl:value-of select="substring('                              ',1,30-$LEN)"/>
            </xsl:if>
            <xsl:if test="$T3= ''">
                <xsl:choose>
                    <xsl:when test="$T2T != '-'">                                            <xsl:variable name="PN" select="concat(substring($T1,1,1),'/',substring($T1,2),'/',substring($T2T,1,2),'/',substring
($T2T,3))"/>
                    </xsl:when>
                    <xsl:otherwise>
                    <xsl:variable name="PN" select="concat(substring($T1,1,1),'/',substring($T1,2),'/','/')"/>   
                    </xsl:otherwise>
                </xsl:choose>
                     <xsl:variable name="LEN" select="string-length($PN)"/>
                      <xsl:value-of select="$PN"/>
                       <xsl:value-of select="substring('                              ',1,30-$LEN)"/>
                      </xsl:if>
        </xsl:if>
        <xsl:if test="../ShipFrom != 'FI05M'">
            <xsl:value-of select="substring(concat(EPNCode,'                              '),1,30)"/>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>
My input XML data :
<?xml version="1.0" encoding="utf-8"?>
<n0:COMMONFORMAT_MT xmlns:n0="urn:nord-com:fcsd:btr:eu:sapscm:schedAgrRels" xmlns:prx="urn:sap.com:proxy:A8D:/1SAI/TAS00000000000000000025:700:2009/02/10">
<Header>
<EDIFormat>CIF850</EDIFormat>
<CreationYear>2010</CreationYear>
<CreationMonth>12</CreationMonth>
<CreationDay>21</CreationDay>
</Header>
<Details>
<Entity>
<ShipFrom>D02RG</ShipFrom>
<ShipTo>0095A</ShipTo>
<BillTo>0095A</BillTo>
<ReleaseNumberPrimary>000115</ReleaseNumberPrimary>
<ShipToInternal>PLDE11</ShipToInternal>
<ShipToName>nord-Werke GmbH</ShipToName>
<ShipFromName>AFL HUNGARY</ShipFromName>
<Part>
<FinisCode>TST_1004285</FinisCode>
<EPNCode> 96FG 10374 AA </EPNCode>
<SupplierCode>Y</SupplierCode>
<Description>Seal</Description>
<APNType>EN</APNType>
<CumQuanRec>60.000 </CumQuanRec>
<PurchasingUOM>EA</PurchasingUOM>
<PartHorizons>
<ProductGoAheadQty>0 </ProductGoAheadQty>
<MaterialGoAheadQty>0 </MaterialGoAheadQty>
<MaterialEndDate>101220</MaterialEndDate>
<FabEndDate>101220</FabEndDate>
<LastASNNo>KRISHNA</LastASNNo>
<LastASNDate>100929</LastASNDate>
<LastASNQty>20 </LastASNQty>
<LastASNCumQty>0 </LastASNCumQty>
</PartHorizons>
<PurchasingInformation>
<ReleaseID>JGxc9pCi0QhX08004sv34m</ReleaseID>
<PurchasingNumber>5500000039</PurchasingNumber>
<ReleaseNumber>0000018</ReleaseNumber>
<ReleaseIssueDate>101220</ReleaseIssueDate>
<HorizonEndDate>111220</HorizonEndDate>
<ReconciliationDate>100101</ReconciliationDate>
<BookNumber>180</BookNumber>
</PurchasingInformation>
<ScheduleLines>
<Quantity>15 </Quantity>
<Date>101220</Date>
<Time>0007</Time>
<TransportMethod>0001</TransportMethod>
</ScheduleLines>
<ShipCode>XX</ShipCode>
<POType>AS</POType>
</Part>
</Entity>
</Details>
<Details>
<Entity>
<ShipFrom>EBECA</ShipFrom>
<ShipTo>0095A</ShipTo>
<BillTo>0095A</BillTo>
<ReceivingDock>12</ReceivingDock>
<ReleaseNumberPrimary>000115</ReleaseNumberPrimary>
<ShipToInternal>PLDE11</ShipToInternal>
<ShipToName>nord-Werke GmbH</ShipToName>
<ShipFromName>VALEO AUTOSYSTEMY SP.Z.O.O.</ShipFromName>
<Part>
<FinisCode>1007257</FinisCode>
<EPNCode>DSFSDF SDF </EPNCode>
<SupplierCode>Y</SupplierCode>
<Description>WIRE ASSY</Description>
<APNType>EN</APNType>
<CumQuanRec>0.000 </CumQuanRec>
<PurchasingUOM>EA</PurchasingUOM>
<PartHorizons>
<ProductGoAheadQty>0 </ProductGoAheadQty>
<MaterialGoAheadQty>0 </MaterialGoAheadQty>
<MaterialEndDate>101221</MaterialEndDate>
<FabEndDate>101221</FabEndDate>
<LastASNNo>00000000000</LastASNNo>
<LastASNDate>000000</LastASNDate>
<LastASNQty>0 </LastASNQty>
<LastASNCumQty>0 </LastASNCumQty>
</PartHorizons>
<PurchasingInformation>
<ReleaseID>JGyw4Tf30QhX08004sv34m</ReleaseID>
<PurchasingNumber>5500023416</PurchasingNumber>
<ReleaseNumber>0000002</ReleaseNumber>
<ReleaseIssueDate>101221</ReleaseIssueDate>
<HorizonEndDate>111221</HorizonEndDate>
<ReconciliationDate>091005</ReconciliationDate>
<BookNumber>730</BookNumber>
</PurchasingInformation>
<ScheduleLines>
<Quantity>1202 </Quantity>
<Date>101220</Date>
<Time>0007</Time>
</ScheduleLines>
<ShipCode>11</ShipCode>
<POType>SS</POType>
</Part>
<Part>
<FinisCode>1008781</FinisCode>
<EPNCode> TEST </EPNCode>
<Description>ARM-WIPER</Description>
<APNType>EN</APNType>
<CumQuanRec>0.000 </CumQuanRec>
<PurchasingUOM>EA</PurchasingUOM>
<PartHorizons>
<ProductGoAheadQty>0 </ProductGoAheadQty>
<MaterialGoAheadQty>0 </MaterialGoAheadQty>
<MaterialEndDate>101217</MaterialEndDate>
<FabEndDate>101217</FabEndDate>
<LastASNNo>00000000000</LastASNNo>
<LastASNDate>000000</LastASNDate>
<LastASNQty>0 </LastASNQty>
<LastASNCumQty>0 </LastASNCumQty>
</PartHorizons>
<PurchasingInformation>
<ReleaseID>JGkW33ND0PxX08004sv34m</ReleaseID>
<PurchasingNumber>5500023075</PurchasingNumber>
<ReleaseNumber>0000001</ReleaseNumber>
<ReleaseIssueDate>101217</ReleaseIssueDate>
<HorizonEndDate>111217</HorizonEndDate>
<ReconciliationDate>100101</ReconciliationDate>
<BookNumber>180</BookNumber>
</PurchasingInformation>
<ScheduleLines>
<Quantity>2118 </Quantity>
<Date>101213</Date>
<Time>0007</Time>
</ScheduleLines>
<ShipCode>XX</ShipCode>
<POType>SS</POType>
</Part>
</Entity>
</Details>
<Details>
<Part>
<FinisCode>1049328</FinisCode>
<EPNCode>V97FB 17526 BD</EPNCode>
<SupplierCode>Y</SupplierCode>
<Description>Arm Assy - Wiper</Description>
<APNType>EN</APNType>
<CumQuanRec>11183.000 </CumQuanRec>
<PurchasingUOM>EA</PurchasingUOM>
<PartHorizons>
<ProductGoAheadQty>0 </ProductGoAheadQty>
<MaterialGoAheadQty>0 </MaterialGoAheadQty>
<MaterialEndDate>110201</MaterialEndDate>
<FabEndDate>110102</FabEndDate>
<LastASNNo>ADRIAN 17.1</LastASNNo>
<LastASNDate>091117</LastASNDate>
<LastASNQty>133 </LastASNQty>
<LastASNCumQty>0 </LastASNCumQty>
</PartHorizons>
<PurchasingInformation>
</PurchasingInformation>
<ScheduleLines>
<Quantity>16 </Quantity>
<Date>101129</Date>
<Time>0007</Time>
</ScheduleLines>
<ShipCode>XX</ShipCode>
<POType>SS</POType>
</Part>
</Entity>
</Details>
</n0:COMMONFORMAT_MT>

Don't see an attachment.
You could use a shift register to store an array.
Each button would map to an array index. For each button pushed you would index the array, +1 the value, replace the array element and pass back out to the shift register.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Similar Messages

  • How to Count schedule lines in IDoc ORDERS05 using XSLT Mapping

    Hi Experts,
    In a Scenario where we are sending Purchase order (ORDERS05) to SAP SNC using XSLT Mapping,
    where in we need to count the no. of schedule lines against the Purchase Order line.
    As in Schedule line segment there is no such provision, so it needs to be handle in XSLT mapping to count the schedule lines.
    Can you all please guide me how to go about the same.
    Regards,
    Nitin P

    Hi Satish,
    Thank you very much for the reply,
    as there is only Quantity and other information is maintained against schedule lines how we can count the schedule line repeatation against PO line ? Is that very simple as you suggested or some other consideration also needs to be taken.
    Please clarify the same and let me also know if there are some standard documents also for the same.
    Regards,
    Nitin P

  • DB insert using xslt-exception

    Hi
    I am having a weird problem when i am trying to insert values in table using xslt
    my process data object xsd is
    <xsd:element name="data">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="element1" type="dataCollection"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:complexType name="dataCollection">
    <xsd:sequence>
    <xsd:element name="seqid" type="xsd:string"/>
    <xsd:element name="value" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"/>
    <xsd:element name="price" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    my database xsd getting generated out db adapter is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/test" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/test" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Testatble1Collection" type="Testatble1Collection"/>
    <xs:complexType name="Testatble1Collection">
    <xs:sequence>
    <xs:element name="Testatble1" type="Testatble1" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Testatble1">
    <xs:sequence>
    <xs:element name="id">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="seqid" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="value" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="description" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="price" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    AND my xslt mapping is
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="XSD">
    <schema location="../xsd/test.xsd"/>
    <rootElement name="data" namespace="http://www.example.org"/>
    <param name="dataObject1" />
    </source>
    </mapSources>
    <mapTargets>
    <target type="XSD">
    <schema location="../xsd/test_table.xsd"/>
    <rootElement name="Testatble1Collection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/test"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.6.0(build 111214.0600.1553) AT [SAT DEC 15 18:10:29 GMT 2012]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://www.example.org"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/top/test"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    exclude-result-prefixes="xsi xsl ns0 xsd ns1 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
    <xsl:template match="/">
    <ns1:Testatble1Collection>
    <ns1:Testatble1>
    <ns1:seqid>
    <xsl:value-of select="/ns0:data/ns0:element1/ns0:seqid"/>
    </ns1:seqid>
    <ns1:attributevalue>
    <xsl:value-of select="/ns0:data/ns0:element1/ns0:value"/>
    </ns1:attributevalue>
    <ns1:description>
    <xsl:value-of select="/ns0:data/ns0:element1/ns0:description"/>
    </ns1:description>
    <ns1:price>
    <xsl:value-of select="/ns0:data/ns0:element1/ns0:price"/>
    </ns1:price>
    </ns1:Testatble1>
    </ns1:Testatble1Collection>
    </xsl:template>
    </xsl:stylesheet>
    i have used merge statement and every time i run the bpm project i get the error
    <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>oracle.fabric.common.FabricInvocationException: Schema validation failed for message part Testatble1Collection. Please ensure at the message sender level that the data sent is schema compliant. Element 'seqid' not expected.</summary></part><part name="detail"><detail>Element 'seqid' not expected.</detail></part><part name="code"><code>null</code></part></remoteFault></bpelFault>
    this is the most simple db insert and i really dont know hat i have done wrong here.
    pls help i am unable to figure out the problem.i tried typecasting too but it ddnt help.
    Regards...

    Hi Daniel,
    Thanks for your input.I have tried using foreach initially but the problem persists.
    I am pasting my input xml and xslt mapping below
    input xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="data">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="element1" type="dataCollection"/>
    <xsd:element name="element2" type="dataCollection"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:complexType name="dataCollection">
    <xsd:sequence>
    <xsd:element name="seqid" type="xsd:string"/>
    <xsd:element name="value" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"/>
    <xsd:element name="price" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    xslt mapping
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="XSD">
    <schema location="../xsd/test.xsd"/>
    <rootElement name="data" namespace="http://www.example.org"/>
    <param name="dataObject1" />
    </source>
    </mapSources>
    <mapTargets>
    <target type="XSD">
    <schema location="../xsd/test_table.xsd"/>
    <rootElement name="Testatble1Collection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/test"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.6.0(build 111214.0600.1553) AT [SAT DEC 15 21:04:32 GMT 2012]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://www.example.org"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/top/test"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    exclude-result-prefixes="xsi xsl ns0 xsd ns1 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
    <xsl:template match="/">
    <ns1:Testatble1Collection>
    <xsl:for-each select="/ns0:data/*">
    <ns1:Testatble1>
    <ns1:seqid>
    <xsl:value-of select="./ns0:seqid"/>
    </ns1:seqid>
    <ns1:attributevalue>
    <xsl:value-of select="./ns0:value"/>
    </ns1:attributevalue>
    <ns1:description>
    <xsl:value-of select="./ns0:description"/>
    </ns1:description>
    <ns1:price>
    <xsl:value-of select="./ns0:price"/>
    </ns1:price>
    </ns1:Testatble1>
    </xsl:for-each>
    </ns1:Testatble1Collection>
    </xsl:template>
    </xsl:stylesheet>
    the same problem persists.
    I tested the same input and xslt mapping for a table which does not have auto-increment primary key through trigger,it works perfectly fine.
    but the same fails when i have a table with auto-increment primary key named 'id' which is inserted as per below sql:
    CREATE TRIGGER TESTTABLE1_TRIG
    BEFORE INSERT ON TESTATBLE1
    FOR EACH ROW
    BEGIN
    SELECT test_seq.NEXTVAL
    INTO :new.id
    FROM dual;
    END;
    is it a really a limitation with soa db adapter or i am doing it wrong.
    Regards...
    Edited by: bpm11gnewbie on Dec 15, 2012 1:15 PM

  • Sequencing a node in Target using XSLT

    Hi,
    I need to give numbering to a node on the target evertime it occurs irrespective of the any field in the source. How can this be achieved using XSLT? I know this can be acheived using ora seq, but we do not want to touch the DB.
    My target should like this
    <root>
    <Item>
    <id>1</id>
    <value>some mapping from source</value>
    </Item>
    <Item>
    <id>2</id>
    <value>some mapping from source</value>
    </Item>
    <Item>
    <id>3</id>
    <value>some mapping from source</value>
    </Item>
    </root>
    the node id should be generated whenever the parent node Item occurs.
    How can this be achieved using XSLT?
    Thanks and Regards,
    Kamal
    Edited by: Kamal Dheeraj on 11-Jan-2011 01:13

    Hi Shanmu,
    Thanks for the reply.
    position() and the count will not help in this case as the source is a cascading structure and we have filters on the source, hence i cant get numbers in sequence. Any other workaround please.
    Thanks,
    Kamal

  • "frags delayed" counter incrementing for Voice PVC

    Hi,
    We are using VoFR between two Cisco 2610 using FXO\FXS Cards. It is a point-point link with two PVCs, one for Voice and one for Data.
    I have implemented Traffic-Shaping and FRF. However when i do a "show frame pvc " command, i can see "frags delayed"counter incrementing for the Voice PVC, indiciating delay in sending packets and thus compromising Voice Quality.
    1. Is it normal to have this counter increasing ? What is the acceptable percentage i.e "frags delayed \ total frags" ?
    2. Is there anything i can do ? Would PVC Priority Queuing help ?
    I need to be sure if PVC Priority is the solution, as we would have to do a Flash Upgrade to install the new software with this feature.
    ++++++++++++++++++++++++++
    show frame pvc 103
    PVC Statistics for interface Serial0/0 (Frame Relay DTE)
    DLCI = 103, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0.3
    input pkts 373951 output pkts 374604 in bytes 11542352
    out bytes 12245392 dropped pkts 0 in FECN pkts 0
    in BECN pkts 0 out FECN pkts 0 out BECN pkts 0
    in DE pkts 0 out DE pkts 0
    out bcast pkts 5474 out bcast bytes 1571038
    pvc create time 11w3d, last time pvc status changed 04:06:31
    Service type VoFR-cisco
    Voice Queueing Stats: 0/100/0 (size/max/dropped)
    Current fair queue configuration:
    Discard Dynamic Reserved
    threshold queue count queue count
    64 16 2
    Output queue size 0/max total 600/drops 0
    configured voice bandwidth 30000, used voice bandwidth 0
    fragment type VoFR-cisco fragment size 320
    cir 32000 bc 320 be 0 limit 40 interval 10
    mincir 32000 byte increment 40 BECN response no
    frags 374604 bytes 12261814 frags delayed 6501 bytes delayed 1609296
    shaping inactive
    traffic shaping drops 0
    +++++++++++++++++++++++++++++++++++

    The following links explains the delay in voice traffic and gow to do traffic policing
    VoIP over Frame Relay with QoS (Fragmentation, Traffic Shaping, LLQ / IP RTP Priority)
    http://www.cisco.com/warp/public/788/voice-qos/voip-ov-fr-qos.html#15
    Troubleshooting Output Drops with Priority Queueing
    http://www.cisco.com/warp/public/105/priorityqueuedrops.html
    Understanding Delay in Packet Voice Networks
    http://www.cisco.com/warp/public/788/voip/delay-details.html
    Voice QoS: ToS-CoS Mapping Via LLQ
    http://www.cisco.com/warp/public/788/voice-qos/tos-cos.html
    Frame Relay Traffic Shaping for VoIP and VoFR
    http://www.cisco.com/warp/public/788/voip/fr_traffic.html

  • Baby Giants counter incrementing on interface?

    Hi,
    I have a 7600 PE router running SRD2a with a WS-X6708-10GE card being used for the wan links (DWDM). The baby giants counters on the interfaces are incrementing very fast. Looking at Cisco.com I dont think it's an issue as it's just MPLS packets,etc that are above the usual ethernet 1518 bytes size.  Hopefully this is not something to worry about?! If so what I dont understand is why the baby giant counters are not incrementing on other wan links on the network. On most wan links we have 10G ES cards and I'm wondering if this is the reason?
    Thanks in advance for any answers!

    Fyi - I mentioned this to our company Cisco support contact.
    The giant counter incrementing does not indicate the packet was dropped, only that the frame size exceeded 1548bytes. The giants counter is going to increment for any frame greater than 1548 bytes on 6708 cards. It is an expected behaviour. This is fixed in the next generation of port ASICs and that's why you don't see this behaviour on ES cards.

  • How to feed data to generate a html file using XSLT?

    I need to implement email content generation in the hmtl format using XSLT. The document information is stored in a xsl file and the data is generated dynmically in the application. How to feed the data to have the file?
    Thanks,
    v.

    Thanks for your information. I, however, already thought about using string stream instand of a XML file to pass in data. I am looking for a more intelligent method. It doesn't seem to have one so far.

  • Can't View ACL count details using ASDM

    We are running a ASA5520 with system image of "disk0:/asa843-k8.bin".  I'm also running ASDM ver: 6.4(7).
    So my question is while I'm in the ASDM on the configuration of the firewall, I'm looking at the Access Rules.  When I do a show log on any of the rules that have hit counts on them, it opens up a Real-Time Log Viewer but I don't see any information.  It's not showing anything, nothing appears, it just sit's there like it's waiting but no data is coming.  Even though if I go back out to all the rules, I can see the hit count incrementing.  The same thing happens no matter which rule I pick with hit counts on them. 
    I'm hoping in the end I can click on show log on the rule in question and see each individual hit information Source/Destination IP, Srce/Dest Port, Severity, Date and time.
    I'm sure it's just a configuration issue I'm missing somewhere but I can't seem to figure it out.  Any help with this issue would be greatly appreciated.

    Hi,
    Wat you would need to do is to add the log option after the acl that you are viewing, like:
    access-list outside_access_in permit ip any host 1.1.1.1 log
    Then go to ASDM and check the logs in the window.
    Hope that helps.
    Thanks,
    Varun

  • Frequency counter unreliable using rotary vane anemometer

    I have set up an anemometer to measure air flow speed, with the signal being acquired by a 9402 module in a cDAQ-9174 chassis (4 slot). I am using Signal Express 2011 to program the instrument.
    I have set up a frequency counter task, using a maximum frequency of 1.8 kHz a minimum frequency of 250 mHz, rising edge and 1-counter (low frequency). The output is scaled using y = 0.0111x + 0. This gives 20 m/s when the frequency is 1.8 kHz.
    The readings given by Signal Express give a very noisy signal, at a frequency much higher than the bandwidth of the anemometer. The range is in the order of 20% of the mean. I have attached a PDF of the signal, for two different air flow sources, the seproj file and the tdms file for one of the runs. I have also observed that the counter output is rounded to the nearest multiple of 10, e.g. 490, 470, 480, 480, 470, etc.
    Is this consistent with a digital bounce issue? Is this consistent with an earthing issue? Is this consistent with a sample rate issue? Any other ideas for investigating this issue?
    thanks
    Attachments:
    EXPT 20 - ANEMOMETER NOISE.pdf ‏49 KB
    EXPT 20 Anemometer Noise.seproj ‏637 KB

    I have logged the voltage signal coming from the anemometer, using our 9239, a report of a few cycles is attached as a PDF. The graph clearly shows a small digital bounce. The noise is small compared to the signal, is there any way it can be filtered when acquired by the 9402?
    Other tests that I ran showed a background noise in the order of 50 microVolts and a frequency of 50 Hz, this is very likely a background noise from a power supply (we run at 50 Hz in Aus) but is many orders of magnitude smaller than the signal, I assume it would be ignoredby the 9402.
    Attachments:
    EXPT 20 Anemometer Noise Voltage.seproj ‏261 KB
    EXPT 20 Anemometer Noise Voltage.pdf ‏19 KB

  • ERROR WHILE USING XSLT MAPPING IN INTERFACE MAPPING

    Hi,
      We are using an xslt mapping in our scenario but while i load the XSLT mapping in the interface mapping i get a message :
    Transformer configuration exception occurred when loading XSLT
    sorce interface :outbound and asyncronous.
    mapping : XSLT mapping (imported as a zip file)
    target interface: abstract,asyncronous.
    The xslt runs well in standalone and its well formed and there is no name space issue.
    please help if any one has faced such a situation while using XSLT mapping.
    regards,
    Anirban.

    Hi Anirban
    When you say it runs well <i>standalone</i> what exactly do you mean? Which XSLT processor are you using to run it? There are subtle difference between XSTL processors that can sometimes result in incompatibilities. For instance, I have seen XSLTs run correctly in XMLSpy but incorrectly (or at least slightly differently) in XI.
    Regards,
    Thorsten

  • XML to Internal table using XSLT by CALL TRANSFORMATION error

    Dear experts,
    I have to fetch the data from an XML file using XSLT into internal tables. The XML file is very big as following:-
    <?xml version="1.0" standalone="yes" ?>
    - <Shipment>
      <shipmentID>25091203S000778</shipmentID>
      <manifestDateTime>2009-12-03T20:16:52.00</manifestDateTime>
      <shipmentFacilityNumber>025</shipmentFacilityNumber>
      <shipmentFacilityAbbreviation>CHI</shipmentFacilityAbbreviation>
      <shipmentFacilityAddress1>810 KIMBERLY DRIVE</shipmentFacilityAddress1>
      <shipmentFacilityAddress2 />
      <shipmentFacilityCity>CAROL STREAM</shipmentFacilityCity>
      <shipmentFacilityState>IL</shipmentFacilityState>
      <shipmentFacilityPostalCode>601880000</shipmentFacilityPostalCode>
      <shipmentTruckCarrierCode>X150</shipmentTruckCarrierCode>
      <shipmentSourceCode>T</shipmentSourceCode>
      <userID>CAMPOSG</userID>
    - <Delivery>
      <primaryCustomerNumber>954371</primaryCustomerNumber>
      <primaryCustomerName>MIDWEST OFFICE SUPPLY</primaryCustomerName>
      <primaryCustomerAddress1 />
      <primaryCustomerAddress2>4765 INDUSTRIAL DR</primaryCustomerAddress2>
      <primaryCustomerCity>SPRINGFIELD</primaryCustomerCity>
      <primaryCustomerState>IL</primaryCustomerState>
      <primaryCustomerPostalCode>627030000</primaryCustomerPostalCode>
      <primaryCustomerPhoneNumber>2177535555</primaryCustomerPhoneNumber>
      <shuttleStopFacilityNumber />
      <billOfLadingNumber>25HZK99</billOfLadingNumber>
      <carrierProNumber />
      <shipmentTotalCartonCount>6</shipmentTotalCartonCount>
      <shipmentTotalWeight>266</shipmentTotalWeight>
    - <order>
      <orderNumber>25HZK99</orderNumber>
      <subOrderNumber />
      <dateProcessed>2009-12-03</dateProcessed>
      <primaryOrderNumber />
      <shipTruckCode>X150</shipTruckCode>
      <shipTruckDescription>UDS - ADDISON</shipTruckDescription>
      <shipTruckPriorityCode>01</shipTruckPriorityCode>
      <shipTruckGroupCode>01</shipTruckGroupCode>
      <shipTruckDepartureTime>20.00.00</shipTruckDepartureTime>
      <shipTruckDockID>07</shipTruckDockID>
      <ldpFacilityAbbreviation />
      <shuttleAvailableIndicator>N</shuttleAvailableIndicator>
      <shuttleMessageText />
      <crossDockFacilityCode />
      <crossDockTruckCode />
      <crossDockID />
      <subsidizedFreightTruckID />
      <customerPurchaseOrderNumber>623559</customerPurchaseOrderNumber>
      <headerTypeCode>P</headerTypeCode>
      <orderTypeID>RG</orderTypeID>
      <deliveryTypeID>DS</deliveryTypeID>
      <deliveryMethodCode />
      <customerBarCode />
      <customerReferenceData>25HZK99</customerReferenceData>
      <customerReferenceText />
      <customerRouteData>ZNED UNTED</customerRouteData>
      <customerRouteText>ROUTE</customerRouteText>
      <endConsumerPurchaseOrderNumber />
      <endConsumerPurchaseOrderText />
      <endConsumerName>CHARLESTON TRANS. FACILITY</endConsumerName>
      <endConsumerAddress1>HOMEWOOD DT PROGRAM DEPT. 3</endConsumerAddress1>
      <endConsumerAddress2>17341 PALMER BLVD.</endConsumerAddress2>
      <endConsumerAddress3 />
      <endConsumerCity>HOMEWOOD</endConsumerCity>
      <endConsumerState>IL</endConsumerState>
      <endConsumerPostalCode>60430</endConsumerPostalCode>
      <endConsumerCountryCode />
      <fillFacilityNumber>025</fillFacilityNumber>
      <shpFacilityNumber>025</shpFacilityNumber>
      <homeFacilityAbbrCode>STL</homeFacilityAbbrCode>
      <homeFacilityNumber>015</homeFacilityNumber>
      <multiCartonIndicator>Y</multiCartonIndicator>
      <primaryCustomerIndicator>Y</primaryCustomerIndicator>
      <shipToCustomerNumber>954371001</shipToCustomerNumber>
      <customerCompanyID>01</customerCompanyID>
      <customerTruckID>U888</customerTruckID>
      <customerTruckDescription>UDS - ADDISON</customerTruckDescription>
      <customerTruckDockID>13</customerTruckDockID>
      <thirdPartyBillCarrier />
      <thirdPartyBillID />
      <thirdPartyBillType />
      <qualityCheckIndicator>N</qualityCheckIndicator>
      <warehouseLaydownID />
      <packListPosition>I</packListPosition>
      <preferredPackingType>CTN</preferredPackingType>
      <preferredPackingMaterial>PAPER</preferredPackingMaterial>
      <preferedPackingInstructions />
      <totalOrderCartonQty>6</totalOrderCartonQty>
      <convertAddressIndicator>N</convertAddressIndicator>
      <dealerInstructionIndicator>Y</dealerInstructionIndicator>
      <dealerinstructions1>CPO#: 623559</dealerinstructions1>
      <dealerinstructions2>ATTN: DANA GRIFFIN</dealerinstructions2>
      <dealerinstructions3>INFO: 612</dealerinstructions3>
      <dealerinstructions4>ROUTE: ZNED UNTED</dealerinstructions4>
      <dealerinstructions5 />
      <dealerinstructions6 />
      <shippingInstructionsIndicator>N</shippingInstructionsIndicator>
      <shippingInstructions1 />
      <shippingInstructions2 />
      <shippingInstructions3 />
      <shippingInstructions4 />
      <shippingInstructions5 />
      <shippingInstructions6 />
      <specialInstructionsIndicator>N</specialInstructionsIndicator>
      <specialInstructions1 />
      <specialInstructions2 />
      <customeContainerDesc />
    - <carton>
      <deliveryCartonID>253370905995</deliveryCartonID>
      <shipIndicator>Y</shipIndicator>
      <deliveryPalletID>X150</deliveryPalletID>
      <consolidatedDeliveryCartonID />
      <scanDateTime>2009-12-03T19:36:12.00</scanDateTime>
      <cartonWeight>52</cartonWeight>
      <dropShipFlag>1</dropShipFlag>
      <carrierTrackingNumber />
      <carrierZoneID>0</carrierZoneID>
      <codAmount />
      <customerPackageAmount />
      <declaredValue />
      <residentialDeliveryIndicator />
      <serviceTypeCode>00</serviceTypeCode>
      <ssccCode>006860244400829393</ssccCode>
    - <Item>
      <shipPrefix>UNV</shipPrefix>
      <shipStockNumber>21200</shipStockNumber>
      <itemDescription>PAPER XERO/DUP WE LTR 20#</itemDescription>
      <orderQuantity>1</orderQuantity>
      <originalShipQuantity>1</originalShipQuantity>
      <shipQuantity>1</shipQuantity>
      <inventoryUnitCode>CT</inventoryUnitCode>
      <inventoryWeightQuantity>52.000</inventoryWeightQuantity>
      <upcNumber>00000000000000</upcNumber>
      <upcRetailCode>087547212004</upcRetailCode>
      <hazmatIndicator>N</hazmatIndicator>
      <serialRequiredIndicator>N</serialRequiredIndicator>
      <dealerMemoPO>S</dealerMemoPO>
      <cartonLineNumber>1</cartonLineNumber>
      <orderLineNumber>11</orderLineNumber>
      <originalOrderPrefix>UNV</originalOrderPrefix>
      <originalOrderStockNumber>21200</originalOrderStockNumber>
      <reasonCode />
    - <Item_Serial>
      <serialNumber />
      </Item_Serial>
        </Item>
      </carton>
       </order>
      </Delivery>
      </Shipment>
    This is not the complete XML file as it exceeds the 15000 characters and then I cann't post here. So I have deleted much part of it.
    The hierarchy is as following: Shipment->Delivery->Order->Carton->Item.
    I have created a XSLT for it which is working fine.
    But when I execute my report program it gives CX_SY_XSLT_FORMAT_ERROR saying that
    Transformation error:  Non-canonical structure of element name XML_OUTPUT.

    Dear experts,
    My report program is as following:-
    *& Report  Z_ASNTRNS
    REPORT  Z_ASNTRNS.
    *& Report  Z_ASNTRNS
    TYPE-POOLS: abap, ixml.
    TABLES: ZASN_SHIPMENT,ZASN_DELIVERY,ZASN_ORDER,ZASN_CARTON,ZASN_ITEM.
    *CONSTANTS gs_file TYPE string VALUE 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
    This is the structure for the data from the XML file
    TYPES: BEGIN OF ts_item,
          ZSHIPMENT LIKE ZASN_ITEM-ZSHIPMENT,
          VBELN LIKE ZASN_ITEM-VBELN,
          ORDER_NUMBER LIKE ZASN_ITEM-ORDER_NUMBER,
          CARTON_ID LIKE ZASN_ITEM-CARTON_ID,
           ITEM LIKE ZASN_ITEM-ITEM,
           CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
           CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
          AEDAT(8),
          AEZET(6),
           ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
           ORD_QTY(16),
           ORIGINAL_SHIP(16),
           SHIP_QTY(16),
           UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
           DEALER_MEMO_PO(5),
           ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
          STATUS LIKE ZASN_ITEM-STATUS,
           END OF ts_item.
    TYPES: BEGIN OF ts_carton,
          ZSHIPMENT LIKE ZASN_CARTON-ZSHIPMENT,
          VBELN LIKE ZASN_CARTON-VBELN,
          ORDER_NUMBER LIKE ZASN_CARTON-ORDER_NUMBER,
           CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
          AEDAT(8),
          AEZET(6),
           SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
           TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
           ZZCARTON_WGT(18),
           Item type ts_item,
           END OF ts_carton.
    TYPES: BEGIN OF ts_order,
          ZSHIPMENT LIKE ZASN_ORDER-ZSHIPMENT,
          VBELN LIKE ZASN_ORDER-VBELN,
           ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
          AEDAT(8),
          AEZET(6),
           SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
           ORDER_DATE(8),
           PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
           CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
           PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
           SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
          ANZPK(5),
           carton type ts_carton,
           END OF ts_order.
    TYPES: BEGIN OF ts_delivery,
          ZSHIPMENT LIKE ZASN_DELIVERY-ZSHIPMENT,
          VBELN LIKE ZASN_DELIVERY-VBELN,
          AEDAT(8) TYPE C,
          AEZET(6) TYPE C,
           PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
           BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
           CARTON_COUNT(5),
           TOTAL_WEIGHT(18),
           order type ts_order,
           END OF ts_delivery.
    TYPES: BEGIN OF ts_shipment,
           ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
           MANIFEST_DATE_TIME(25),
          AEDAT(8) TYPE C,
          AEZET(6) TYPE C,
          SDATE(8) TYPE C,
          STIME(6) TYPE C,
           SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
           ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
           Delivery type ts_delivery,
           END OF ts_shipment.
    TYPES: BEGIN OF ts_shipment1,
           ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
           MANIFEST_DATE_TIME(25),
           SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
           ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
           PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
           BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
           CARTON_COUNT(5),
           TOTAL_WEIGHT(18),
           ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
           SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
           ORDER_DATE(8),
           PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
           CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
           PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
           SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
           CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
           SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
           TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
           ZZCARTON_WGT(18),
           ITEM LIKE ZASN_ITEM-ITEM,
           CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
           CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
           ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
           ORD_QTY(16),
           ORIGINAL_SHIP(16),
           SHIP_QTY(16),
           UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
           DEALER_MEMO_PO(5),
           ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
           END OF ts_shipment1.
    TYPES: BEGIN OF t_xml_line,
                 data(256) TYPE x,
               END OF t_xml_line.
    *Typdefinition für Airplus
    *READ THE DOCUMENTATION "LASG_XML_INVOICE_BTM"!!!
    VARs beginning with "a_" are ATTRIBUTES
    DATA: l_ixml            TYPE REF TO if_ixml,
          l_streamfactory   TYPE REF TO if_ixml_stream_factory,
          l_parser          TYPE REF TO if_ixml_parser,
          l_istream         TYPE REF TO if_ixml_istream,
          l_ostream         TYPE REF TO if_ixml_ostream,
          l_document        TYPE REF TO if_ixml_document,
          l_node            TYPE REF TO if_ixml_node,
          l_xml TYPE REF TO cl_xml_document,
          l_xmldata         TYPE string.
    DATA: l_xml_table       TYPE TABLE OF t_xml_line,
             l_xml_line        TYPE t_xml_line,
             l_xml_table_size  TYPE i.
    DATA: l_filename        TYPE string.
    DATA: xml_out TYPE string ,
          size type i.
    DATA: l_xml_x1   TYPE xstring.
    DATA: l_len      TYPE i,
              l_len2     TYPE i,
              l_tab      TYPE tsfixml,
              l_content  TYPE string,
              l_str1     TYPE string,
              c_conv     TYPE REF TO cl_abap_conv_in_ce.
             l_itab     TYPE TABLE OF string.
    DATA: BEGIN OF l_itab occurs 0,
          data(256) type c,
          end of l_itab.
    TYPES : BEGIN OF TY_TEXT,
              data(255) type C,
            END OF TY_TEXT.
    DATA: F_XML TYPE STRING.
    DATA : LT_TEXT_OUT type table of TY_TEXT with header line.
    tables
    DATA: it_shipment    TYPE STANDARD TABLE OF ts_shipment,
          wa_shipment    TYPE  ts_shipment.
    *Errorvariables
    DATA: xslt_err   TYPE REF TO cx_xslt_exception,
          err_string TYPE string.
    PARAMETERS: pa_file TYPE localfile OBLIGATORY
    DEFAULT 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
    START-OF-SELECTION.
      Creating the main iXML factory
        l_ixml = cl_ixml=>create( ).
      Creating a stream factory
        l_streamfactory = l_ixml->create_stream_factory( ).
        PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
    here we use the CALL TRANSFORMATION method which calls
    the XSLT program "z_asnfile"
    TRY.
        CALL TRANSFORMATION ('Z_ASNFILE')
          SOURCE xml LT_TEXT_OUT[]
          RESULT xml_output = it_shipment
    catch any error, very helpful if the XSLT isn't correct
        CATCH cx_xslt_exception INTO xslt_err.
        err_string = xslt_err->get_text( ).
        WRITE: / 'Transformation error: ', err_string.
        EXIT.
      ENDTRY." setting a breakpoint to watch the workarea
    by the internal table "it_airplus"
           break-point.
      LOOP AT it_shipment INTO wa_shipment.
      ENDLOOP.
    *&      Form  get_xml_table
      FORM get_xml_table CHANGING l_xml_table_size TYPE i
                                  l_xml_table      TYPE STANDARD TABLE.
        l_filename = pa_file.
      upload a file from the client's workstation
        CALL METHOD cl_gui_frontend_services=>gui_upload
          EXPORTING
            filename   = l_filename
            filetype   = 'BIN'
          IMPORTING
            filelength = l_xml_table_size
          CHANGING
            data_tab   = l_xml_table
          EXCEPTIONS
            OTHERS     = 19.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Convert binary to text.
    CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
      EXPORTING
        INPUT_LENGTH          = 70000
                FIRST_LINE            = 0
                LAST_LINE             = 0
                APPEND_TO_TABLE       = ' '
                MIMETYPE              = ' '
        WRAP_LINES            = 'X'
              IMPORTING
                OUTPUT_LENGTH         =
      TABLES
        BINARY_TAB            = l_xml_table
        TEXT_TAB              = LT_TEXT_OUT
              EXCEPTIONS
                FAILED                = 1
                OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    "get_xml_table

  • String to XML using XSLT..

    Hey folks
    Am having a XML in a single string in ma request and wanna convert that into a XML. Tried that using XSLT but seems am missing out on some point...It works fine with Stylus but fails within PI 
    Following code am using :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.sdn.com/xslt">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
       <xsl:template match="/">
            <xsl:for-each select="//*:string">
             <xsl:value-of select="." disable-output-escaping="yes"/>
          </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    The name of the element in which i get the whole XML is  "string".
    My request string is something liek this :
    <xml version="1.0" encoding="UTF-8"?><ProductDefinition><RefNo>23232323</RefNo><Description>dfdfdfdfdf</Description></ProductDefinition>
    Now am trying to generate a XML using the XSL but its failing in PI...
    Kindly point out where am i going wrong?

    Thanks, but graphical mapping does not expose <![CDATAhttp:// ... ] to be removed. Surely this must be done with XSLT?+
    Don't worry about <![CDATA ... pass your whole string in source message like this : <![CDATAhttp://<?xml version=\"1.0\" encoding=\"UTF-8\"?><ProductDefinition><RefNo>12345</RefNo><Description>Test</Description></ProductDefinition>]>
    1st the graphical mapping where you use replace string will replace <?xml version=\"1.0\" encoding=\"UTF-8\"?>  and then the XSLT mapping would get a input like this : <![CDATAhttp://<ProductDefinition><RefNo>12345</RefNo><Description>Test</Description></ProductDefinition>]> which would eventually form your target structure...
    I tried it myself few days back so its a sure shot method ... just try it 
    Cheers!!!
    Soumen 

  • String to XML conversion using XSLT

    Hi all,
    I have a scenario when my source input XML is in the form of a string which needs to be transformed into an XML target fields.
    I am using XSLT mapping to do that and its working but unfortunately, input XML contain xml declaration <?xml version='1.0'?>. Because of which it fails.
    I need to remove this. Can any body please suggest how to do this?
    Any help will be appriciated.
    Regards
    -Kulwant

    Hi,
    Refer these links
    XI/PI: Convert Flat File to Deeply Nested XML Structures Using Only Graphical Mapping
    Regards,
    Surya

  • How to update XML file using XSLT

    Hi there,
    I have a "small" issue with exporting data to an XML file using XSLT.
    A two steps process is needed to import data from a non-hierarchical XML file into ABAP, change the data, and then update the XML file with new values. The problem is not trivial, since the format of the XML file is a complex one: there are many interdependent elements on the same level, pointing to each other by using id and ref attributes. Based on these values the data can be read and written into an internal table. I use XSLT and XPath for that. So the inbound process is done and seems to work correctly. I have to mention that the file contains much more data than I need. I am working only with a small part of it.
    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT? I can pass only the internal table to the transformation, so how do I access the XML file in order to update it? I have tried to use the <B>xsl:document()</B> function to access the content of the file store locally on my PC, but it fails each time by throwing and URI exception. I have tried the absolute path without any addition and the path with the file:/// addition. Same result. Please advise.
    Many thanks,
    Ferenc
    P.S. Please provide me with links only if they are relevant for this very matter. I will not give points for irrelevant postings...

    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
    XSLT approach:  check these online tutorial
    http://www.xml.com/pub/a/2000/08/02/xslt/index.html
    http://www.xml.com/pub/a/2000/06/07/transforming/index.html
    ABAP approach:
    for example you have the xml (original) in a string called say xml_out .
    data: l_xml  type ref to cl_xml_document ,
            node type ref to if_ixml_node  .
    create object l_xml.
    call method l_xml->parse_string
      exporting
        stream = xml_out.
    node = l_xml->find_node(
        name   = 'IDENTITY'
       ROOT   = ROOT
    l_xml->set_attribute(
        name    = 'Name'
        value   = 'Charles'
        node    = node
    (the above example reads the element IDENTITY and sets attribute name/value to the same)
    like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
    so how do I access the XML file in order to update it?
    you have already read this XML into a ABAP variable right?
    Sorry couldnt understand your whole process, why do you need to read local XML file?
    Raja

  • Multi Mapping using condition & Dynamic Receiver determination – Used XSLT Mapping

    Dear Experts,
         I am struggling to identify an error on the Technical Routing. Firstly according to my scenario, I receive an XML file with multiple PO's and I have to split the file to 2 different target messages. and also according to the source payload I have to send the file to 2 different receivers. first receiver is ABAP Proxy to the back end system and the 2nd one is to a file location. I have used XSLT to split the message into 2 target message type and I have used a XSLT mapping for receiver determination. Does any one have any idea of what I am doing wrong.
    Note: some time I will only be able to fill in on target message.
    I have attached my XSLT message split mapping with this post, please let me know if you have further question.
    Your help is more appreciated.
    Advance Thanks,
    Pradeep
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:variable name="vFlag"/>
      <xsl:variable name="vPONUM" select="POTRACKING/Lines[1]/PONumber"/>
      <xsl:template match="/">
        <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
          <ns0:Message1>
            <ns1:MT_Tracking xmlns:ns1="http://www.findel-education.co.uk/axapta">
              <xsl:for-each select="POTRACKING/Lines">
                <sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
                  <sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
                  <sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
                </sap:call-external>
                <xsl:if test="$vFlag = 0">
                  <Lines>
                    <DDate>
                      <xsl:value-of select="DespatchDate"/>
                    </DDate>
                    <PONumber>
                      <xsl:value-of select="PONumber"/>
                    </PONumber>
                    <POLine>
                      <xsl:value-of select="POLine"/>
                    </POLine>
                    <QTY>
                      <xsl:value-of select="Quantity"/>
                    </QTY>
                    <VendorMaterial>
                      <xsl:value-of select="VendorMaterialNumber"/>
                    </VendorMaterial>
                    <AccountRef>
                      <xsl:value-of select="AccountReference"/>
                    </AccountRef>
                    <ConsignNumber>
                      <xsl:value-of select="ConsignmentNumber"/>
                    </ConsignNumber>
                    <CarrierURL>
                      <xsl:value-of select="CarrierURL"/>
                    </CarrierURL>
                    <ConsignURL>
                      <xsl:value-of select="ConsignmentURL"/>
                    </ConsignURL>
                  </Lines>
                </xsl:if>
              </xsl:for-each>
            </ns1:MT_Tracking>
          </ns0:Message1>
          <ns0:Message2>
            <ns2:MT_Tracking xmlns:ns2="http://www.findel-education.co.uk/ecc/ax/po/ftp">
              <xsl:for-each select="POTRACKING/Lines">
                <sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
                  <sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
                  <sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
                </sap:call-external>
                <xsl:if test="$vFlag = 1">
                  <Lines>
                    <DDate>
                      <xsl:value-of select="DespatchDate"/>
                    </DDate>
                    <PONumber>
                      <xsl:value-of select="PONumber"/>
                    </PONumber>
                    <POLine>
                      <xsl:value-of select="POLine"/>
                    </POLine>
                    <QTY>
                      <xsl:value-of select="Quantity"/>
                    </QTY>
                    <VendorMaterial>
                      <xsl:value-of select="VendorMaterialNumber"/>
                    </VendorMaterial>
                    <AccountRef>
                      <xsl:value-of select="AccountReference"/>
                    </AccountRef>
                    <ConsignNumber>
                      <xsl:value-of select="ConsignmentNumber"/>
                    </ConsignNumber>
                    <CarrierURL>
                      <xsl:value-of select="CarrierURL"/>
                    </CarrierURL>
                    <ConsignURL>
                      <xsl:value-of select="ConsignmentURL"/>
                    </ConsignURL>
                  </Lines>
                </xsl:if>
              </xsl:for-each>
            </ns2:MT_Tracking>
          </ns0:Message2>
        </ns0:Messages>
      </xsl:template>
    </xsl:stylesheet>

    Hi Hareesh,
    Please find my determination in the XSLT below, I am using enhanced receiver determination.
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:p1="http://sap.com/xi/XI/System" xmlns:ns="urn:sap-com:document:sap:idoc:messages" version="1.0">
      <xsl:variable name="vFlag"/>
      <xsl:variable name="vAX" select="0"/>
      <xsl:variable name="vSAP" select="0"/>
      <xsl:variable name="vBoth" select="0"/>
      <!--  <xsl:variable name="vPONUM" select="POTRACKING/Lines[1]/PONumber"/>-->
      <xsl:template match="/">
        <xsl:for-each select="POTRACKING/Lines">
          <sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
            <sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
            <sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
          </sap:call-external>
          <xsl:choose>
            <xsl:when test="$vFlag = 0">
              <!--          <p1:Receivers>
                <Receiver>
                  <Service>
                    <xsl:text>BS_AXAPTA_TST</xsl:text>
                  </Service>
                </Receiver>
              </p1:Receivers>-->
              <xsl:variable name="vAX" select="$vAX + 1"/>
            </xsl:when>
            <xsl:when test="$vFlag = 1">
              <!--          <p1:Receivers>
                <Receiver>
                  <Service>
                    <xsl:text>BS_ECQCLNT300</xsl:text>
                  </Service>
                </Receiver>
              </p1:Receivers>-->
              <xsl:variable name="vSAP" select="$vSAP + 1"/>
            </xsl:when>
          </xsl:choose>
        </xsl:for-each>
        <xsl:if test="$vSAP &gt; 0">
          <xsl:if test="$vAX &gt; 0">
            <xsl:variable name="vBoth" select="$vBoth + 1"/>
            <xsl:variable name="vSAP" select="0"/>
            <xsl:variable name="vAX" select="0"/>
          </xsl:if>
        </xsl:if>
        <xsl:if test="$vBoth &gt; 0">
          <p1:Receivers>
            <Receiver>
              <Service>
                <xsl:text>BS_AXAPTA_TST</xsl:text>
              </Service>
            </Receiver>
            <Receiver>
              <Service>
                <xsl:text>BS_ECQCLNT300</xsl:text>
              </Service>
            </Receiver>
          </p1:Receivers>
        </xsl:if>
        <xsl:if test="$vAX &gt; 0">
          <p1:Receivers>
            <Receiver>
              <Service>
                <xsl:text>BS_AXAPTA_TST</xsl:text>
              </Service>
            </Receiver>
          </p1:Receivers>
        </xsl:if>
        <xsl:if test="$vSAP &gt; 0">
          <p1:Receivers>
            <Receiver>
              <Service>
                <xsl:text>BS_ECQCLNT300</xsl:text>
              </Service>
            </Receiver>
          </p1:Receivers>
        </xsl:if>
      </xsl:template>
    </xsl:transform>

Maybe you are looking for