Conditional increment in XSLT
In a Shipment the number of orders is present. For each order there is a number of order line Items. Order Line Items contain item. For each iteration we are maintaining the hierarchy levels. In the orderLine Items section, if the previous item is equal to current item, there is no need to increment hierarchy.
points:
There is only one shipment
Number of orders are present per shipment.
number of orderLineItems per each order.
for each iteration of orders and orderlineItems we have to maintain a hierarchy levels(increment value),*but when comes to orderLineItems one condition is there if the previous item is equals to Current item,no need to increment hierarchy level.otherwise we should increment the hierarchy levels* like below output we needed.
below is the input.
Input:
<Shipment>
<Shipment1>Shipment151</Shipment1>
<ShipmentValue>ShipmentValue52</ShipmentValue>
<Order>
<Orderlevel1>Orderlevel153</Orderlevel1>
<Orderlevel2>Orderlevel254</Orderlevel2>
<Orderlevel3>Orderlevel355</Orderlevel3>
<OrderLineItems>
<Level1>Level156</Level1>
<Level2>Level257</Level2>
<Level3>Level358</Level3>
<Item>Item59</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level160</Level1>
<Level2>Level261</Level2>
<Level3>Level362</Level3>
<Item>Item59</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level164</Level1>
<Level2>Level265</Level2>
<Level3>Level366</Level3>
<Item>Item63</Item>
</OrderLineItems>
</Order>
<Order>
<Orderlevel1>Orderlevel168</Orderlevel1>
<Orderlevel2>Orderlevel269</Orderlevel2>
<Orderlevel3>Orderlevel370</Orderlevel3>
<OrderLineItems>
<Level1>Level171</Level1>
<Level2>Level272</Level2>
<Level3>Level373</Level3>
<Item>Item74</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level175</Level1>
<Level2>Level276</Level2>
<Level3>Level377</Level3>
<Item>Item78</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level179</Level1>
<Level2>Level280</Level2>
<Level3>Level381</Level3>
<Item>Item78</Item>
</OrderLineItems>
</Order>
</Shipment>
below is the output we need.
Output:
<ns1:Shipment>
<ns1:Shipment1>1</ns1:Shipment1>
<ns1:ShipmentValue>S</ns1:ShipmentValue>
<ns1:Order>
<ns1:Orderlevel1>2</ns1:Orderlevel1>
<ns1:Orderlevel2>1</ns1:Orderlevel2>
<ns1:Orderlevel3>O</ns1:Orderlevel3>
<ns1:OrderLineItems>
<ns1:Level1>3</ns1:Level1>
<ns1:Level2>2</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<ns1:Item>Item59</ns1:Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Item>Item59</ns1:Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Level1>4</ns1:Level1>
<ns1:Level2>2</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<ns1:Item>Item63</ns1:Item>
</ns1:OrderLineItems>
</ns1:Order>
<ns1:Order>
<ns1:Orderlevel1>5</ns1:Orderlevel1>
<ns1:Orderlevel2>1</ns1:Orderlevel2>
<ns1:Orderlevel3>O</ns1:Orderlevel3>
<ns1:OrderLineItems>
<ns1:Level1>6</ns1:Level1>
<ns1:Level2>5</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<Item>Item74</Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Level1>7</ns1:Level1>
<ns1:Level2>5</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<Item>Item78</Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Item>Item78</ns1:Item>
</ns1:OrderLineItems>
</ns1:Order>
</ns1:Shipment>
Edited by: 913885 on Mar 17, 2013 9:06 AM
yes, there is a global variable concept in XI which u can use for your Sequence Number concept.
If you are on SP14 and above, just take a lookat this blog and the GLOBAL Variables Section
XI: New features in SP14
check this thread
Re: Need Help in XSLT Mapping
Re: Sequence Number in XI Mapping
Similar Messages
-
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 -
Complex conditional mappings - XSLT constructs
Hi,
Please confirm if following such complex conditional mappings are possible using
BPEL Jdev and how can these be achieved
I could not find anything in XSLT constructs of BPEL or either tutorials which
would help me in ascertaining if the following types are possible in BPEL.
the items that fall before "_" below are the elements
suffixes source and target indicates that elements are of target or source
xsd
constants are indicated by _constant
if (x_source=c1_constant or x_source=c2_constant)
then
b_target=(b_source "concatenated with" d_source)
else b_target=b_source
if (a_source>a1_constant)
and
if (x_source!=c1_constant or x_source!=c2_constant)
then
a_target=a_source
We are planning to Use BPEL/B2B for EDI. Our current EDI systems have such kind
of complex mappings requirements where those are resolved by EDI tool, wanted
to check if same is possible in BPEL and how can this be achieved
Thanks
Sachin SutarOf course, use an XSL to transform from source XSD to destination XSD.
Check out http://www.w3.org/TR/xslt to see conditional processing in XSLT. You may either use xsl:if and xsl:choose for conditional processing in XSL. -
How to add multiple test conditions in 'test' attribute expression of xsl:if tag
Hi all,
How to add multiple test conditions in 'test' attribute expression of <xsl:if> tag ?
I have 2 parameters and I want To skip the massage if this 2 conditions happened I tried to write it :
<xsl:when test="($TransferToCompany = 0 and $ObjectInclide=1 )">
<b1im_skip xmlns="" info=" Obect Will Not Transfer To company">
</b1im_skip>
</xsl:when>
But I get an error while I am trying to transfer The object (Account) true B1if
I am working with SBO 9 PL 13
thank you
shacharHi saado
Check this link:
http://stackoverflow.com/questions/318875/can-you-put-two-conditions-in-an-xslt-test-attribute
Kind regards,
Radek -
Default Payment Terms on BP2BP B1i Scenario
Hello Expert,
I have designed Business partner to Business Partner scenario from One source to multiple company which is working fine on Live environment, Few BP entries are not posted due to following reason.
Source company Payment terms are not present on target company, Is it something possible to check on B1if Atom XML to pass default Payment terms as per Target company in case it is not present.
Please advise.
Thanks,
BGHi,
you could check on-the-fly e.g. via SQL call into the receiver company if the handed over payment term does not exist.
There are multiple options to handle a payment term mismatch:
use value mapping functionality to map different payment term codes.
create the not existing payment term on-the-fly and be aware of the system internally given payment term id in order to map the values.
built an error action to inform the administrator via email to add and check the payment terms manually.
built a condition into your xslt mapping: If the handed over payment term is not existing in the receiver company, don't map the field to let DI API choose the default payment term.
Best regards
Bastian -
How to implement this Scenario(JMS to IDOC)
Hi Frnds,
I am working on one scenario JMS to IDOC .based on JMS Message my XSLT Mapping will genarate Multiple Idocs(max 3) or 2 or one.
I have to send this IDOCS based on some conditions,the conditions mentioned below.
xslt mapping genarats one message ,but this contains 3 IDOCS or 2 or 1.(Order Create , Order Change and Order Response),
what is the best approach to implement this scenario
1)f Order Create segment exists (new PO), first check SAP to see if PO does actually exist using RFC Z_BBPR46_GET_PO_FROM_FPA ,If it does not exist, pass Order Create idoc to SAP to create new purchase order
If it does exist, retrieve PO details from RFC and pass Order Change idoc to SAP to update existing purchase order
2)If Order Change segment exists (change PO), retrieve PO details using RFC Z_BBPR46_GET_PO_FROM_FPA and pass Order Change idoc to SAP to update existing purchase order
3)If Order Response segment exists (goods movement), retrieve PO details using RFC Z_BBPR46_GET_PO_FROM_FPA and pass Order Response idoc to SAP to create goods movement.
Above logic i implemented in one mesage mapping Source is XSLT Mapping Output and Receiver message in message mapping is Multimapping selected 3 IDOCS.
Regards,
rajthanks
-
Seeking details on RESULT_CACHE statistics
I'm running 11.2.0.1, and I'm just beginning to look into the server result caching feature introduced in 11g. I'm evaluating the basic effectiveness of queries and the cache by watching query response times and monitoring v$result_cache_statistics. So far, I've found that queries with aggregation work well with the cache, and "SELECT *" queries from small tables also use the cache. Unfortunately, the type of query I really need to work so I can gain the benefit of the speed caching offers often ends up increasing the "Delete Count Invalid" statistic, without providing any benefit. My first assumption was that the cache itself was too small for the query results. My test query uses a table that is roughly 450MB. However, even after increasing RESULT_CACHE_MAX_SIZE to 500MB, the query results were still not cached.
I've read what I can find in the documentation and Metalink about the result cache feature and v$result_cache_statistics, but I haven't found any discussion of what causes some queries to be cached and used (where Find Count increases and performance is obviously improved) and others to not be used (where Delete Count Invalid increases and the query doesn't benefit). Is there another source of information that would explain these statistics and what they mean? The [reference page for the dynamic performance view|http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/dynviews_2140.htm#sthref3336] doesn't provide the detail I'm looking for.
Thanks -
WallyAh! RESULT_CACHE_MAX_RESULT was the key, as far as I can tell. By stretching this out (probably further than it should be stretched, I admit), I am able to see the query results in the cache statistics where I want them, with the corresponding increase in performance.
I acknowledge the previous contributor who questioned my logic in caching such a large portion of the data. At this point, I'm just working to understand the technology and its limitations so I can apply it rationally. To this end, I'm still seeking some documentation that can explain the specific statistics in V$RESULT_CACHE_STATISTICS in greater detail than the Oracle Database Reference http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/dynviews_2140.htm book offers.
SQL> select * from v$result_cache_statistics;
ID NAME VALUE
1 Block Size (Bytes) 1024
2 Block Count Maximum 512000
3 Block Count Current 512000
4 Result Size Maximum (Blocks) 384000
5 Create Count Success 8
6 Create Count Failure 0
7 Find Count 6
8 Invalidation Count 0
9 Delete Count Invalid 4
10 Delete Count Valid 2
11 Hash Chain Length 1
11 rows selected.I'm currently most interested in numbers 8 through 11, what they represent, what query conditions increment them, and so forth. Any pointers to documentation or Metalink notes along these lines will be greatly appreciated.
Thanks!
Added link to documentation: user650205 on Feb 10, 2010 9:44 AM -
Seeking explanation on the code below
public void addListEntries(List<ListEntry> list) {
for(ListEntry entry: list) {
addListEntry(entry);
The above method is from a sample program on using Java DB in desktop application. I need sombody to help explain the following:
(1) addListEntry(List<ListEntry> list)
the use of angular brackets in the specification of function parameter is new to me.
(2) for(ListEntry entry: list)
the for statement seem to depart from the definition of for statement as defined as follows: for(initialization;condition;increment)
Thank you
yosuleBoth of those are new features in Java 5 (aka 1.5.0). You should google for Generics and for-each respectively.
The first is a way to specify what type the content of a Collection is (among many other possibilities, but that's probably the most common use).
The for-each loop is basically just syntactic sugar. -
Hi all,
I have a UITable with two columns in the rootUIElementContainer, now I want to iterate in the UItable row by row and make a value as readonly based on condition dynamically. Please help me with some code.
Thanks in advance.
With regards,
Sai krishnaHi,
If you are using TextView as TableCellEditor, you cannot edit them. otherwise, if you are using Inputfield, you should create an boolean attribute in the context node which is bound to the table. Bind this attribute to Enabled property of the Inputfields.
To iterate the table you can use For loop or While,
IPrivate<Viewname>.I<NodeName>Node node=wdContext.node<NodeName>();
node.invalidate();
<b>for</b>(initialize; condition; increment/decrement)
IPrivate<Viewname>.I<NodeName>Element element=wdContext.create<NodeName>Element();
element.set<Attribute1>("..");
element.set<Attribute2>("..");
node.addElement(element);
<b>if</b>(condition)
wdContext.current<TableNode>Element().set<booleanAttribute>(<b>true</b>);
<b>else</b>
wdContext.current<TableNode>Element().set<booleanAttribute>(<b>false</b>);
regards
karthik -
Printing Duplicate in Smartform
Hi All,
I have created a new smartform with driver program for Delivery document. My requirement is that if user prints it for the second time then it should prind duplicate on it. User have denied to use the different output type to print the duplicate form.
Regards,
Raman.Maintain a Zstructure with field -say - print_itrn. set it's value as '0'
Whenever the form is executed, check the value of this variable. if it's 0, print the doc and increment the value.
update in the structure.
now it becomes 1.
next time when you execute the form, you get 1, add duplicate logo based on this condition.
increment the number again.
Regards,
Sumit -
"AssignmentOperator ArrayInitializer" to complete ForInit - JSP
The following JSP page produced an error when I tried to access it thru an html form.
I am running Tomcat as my servlet engine\ web server.
err msg:
Generated servlet error:
Syntax error, insert "AssignmentOperator ArrayInitializer" to complete ForInit
from the following code:
<%@ page import="java.sql.*" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<jsp:useBean id="emp" class="company.beans.EmployeeBean" scope="session">
<jsp:setProperty name="emp" property="lastname"/>
</jsp:useBean>
<body>
<%
company.util.DBConnect dbcon = new company.util.DBConnect(); //DBConnect class for connection to mySQL
java.util.ArrayList al = dbcon.getEmployee(emp); //retrieve ArrayList of Employees with queried lastname
int counter = 0;
for (counter ; counter<al.size(); counter ++){
out.println(al[counter].getEmployeeID());
out.println(al[counter].getFirstNmae());
out.println(al[counter].getLastName());
out.println(al[counter].getRole());
%>
</body>
</html>I can't figure out what went wrong.Syntax error, insert "AssignmentOperator ArrayInitializer" to complete ForInitYou have a syntax error. You must insert an Assignment Operator or Array Initializer to complete the For loop initialization.
A for loop definition must contain 3 parts
for([initialization] ; [loop continuation condition] ; [increment action])
You are using
for( counter ; counter < al.size() ; counter ++)
Which contains
for( [variable reference] ; [loop continuation condition] ; [increment action])
Can you tell how to fix the problem now?
Well, the real fix to not use scriptlets. The code I would use would look something like this:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<jsp:useBean id="emp" class="company.beans.EmployeeBean" scope="session">
<jsp:setProperty name="emp" property="lastname"/>
</jsp:useBean>
<jsp:useBean id="dbConnector" class="company.util.DBConnect(); scope="page">
<jsp:setProperty name="dbConnector" property="employeeLastName" value="${emp}"/>
<c:set var="employees" value="${dbConnector.employee}"/>
</jsp:useBean>
<body>
<c:forEach var="employee" items="employees">
<c:out value="${employee.employeeID}"/><br/>
<c:out value="${employee.firstName}"/><br/>
<c:out value="${employee.lastName}"/><br/>
<c:out value="${employee.role}"/><br/>
</c:forEach>
</body>
</html>
{code} -
Bad cache performace -- why?
Hi everybody,
on comp.lang.c++ Kenneth Massey posted a piece of code complaining about a cache performance regression. Out of curiousity and a similiarity in memory access patterns in the posted code with a program I am working on, I ran a test with sun studio 10 versus g++ version 3.4.2.
For sun studio I used:
CC -fast a.cc
and for g++ I used:
g++ -O3 -march=ultrasparc3 a.cc
The result was astonishing: the version compiled by g++ was almost 3 times faster than the one compiled by studio 10. I ran cputrack on the execution of both probrams and it showed that EC_rd_miss seems to be one of the main reasons, as it is 23758247 against 148306.
Got anybody any idea, what the reason therefore might be? Might there be an easy way to change the code to perform better or other compiler flags to produce code with a better cache performance? BTW: Kenneth Massey complained that g++ 3.4 is worse than g++ 3.3...
Cheers,
Tom
#include <stdio.h>
#include <vector>
class mytype_A {
public:
int id;
mytype_A():id(0) {}
class mytype_B {
public:
mytype_A* A;
mytype_B(mytype_A* p):A(p) {}
class mytype_C {
public:
mytype_B* B;
mytype_C(mytype_B* p):B(p) {}
class mytype_D {
public:
// mytype_C* C[2]; // less performance difference if we use simple arrays
std::vector<mytype_C*> C;
int junk[3]; // affects performance (must cause cache misses)
public:
mytype_D(mytype_A* a0, mytype_A* a1) {
// C[0] = new mytype_C(new mytype_B(a0));
// C[1] = new mytype_C(new mytype_B(a0));
C.push_back(new mytype_C(new mytype_B(a0)));
C.push_back(new mytype_C(new mytype_B(a0)));
int main() {
const int k = 5000; // run-time not linear in k
mytype_A* A[k];
mytype_D* D[k];
for (int c=0;c<=k;c++)
A[c] = new mytype_A();
for (int c=0;c<k;c++)
D[c] = new mytype_D(A[c],A[k-c]); // intentionally make some pointers far ther apart
clock_t before = clock();
int k0 = 0;
for (int i=0;i<k;i++) {
k0 = 0;
for (int j=0;j<k;j++) { // run through list of D's, and reference pointers
mytype_D* d = D[j];
if (d->C[0]->B->A->id) k0++;
if (d->C[1]->B->A->id) k0++;
printf("%d\n",k0); // don't allow compiler to optimize away k0
printf("time: %f\n",(double)(clock()-before)/CLOCKS_PER_SEC);
return 0;
}I don't have any particularly good answers for you.
I cannot reproduce your cache miss problem,
and the total data allocated only seems to be .25 to .5 MBs.
So, it should fit in second level cache for UltraSPARC-III chips,
which you seem to be using.
Perhaps there are some conflict misses in the first level cache
that are causing this problem.
We are working on some extensions
to the "analyzer" to enable better measurement
and understanding of these kinds of cache problems.
You might want to try running your code
under "collect" and use the analyzer
to see if anything "pops out" at you.
There are a couple of programming errors in the code:
for (int c=0;c<=k;c++)
A[c] = new mytype_A();The "c<=k" should presumably be "c<k",
or A[] is overindexed.
for (int c=0;c<k;c++)
D[c] = new mytype_D(A[c],A[k-c]);The "A[k-c]" should presumably be "A[k-c-1]",
or again, A[] will be overindexed.
In this case, it probably doesn't matter,
since the constructor for mytype_D
does not actually use its second parameter.
printf("%d\n",k0); // don't allow
ow compiler to optimize away k0
printf("time:
e: %f\n",(double)(clock()-before)/CLOCKS_PER_SEC);These two printf's should be done
in the opposite order to get better timing of the loops.
I also looked briefly at the code that g++ 3.2 produces
(didn't have 3.4.2 handy),
and gcc is handling the conditional increments
better than the Sun Studio compiler,
but that's about a 3% difference, not a 3x difference.
Peter.
-pd 5/3/05
Hi everybody,
on comp.lang.c++ Kenneth Massey posted a piece of
code complaining about a cache performance
regression. Out of curiousity and a similiarity in
memory access patterns in the posted code with a
program I am working on, I ran a test with sun studio
10 versus g++ version 3.4.2.
For sun studio I used:
CC -fast a.cc
and for g++ I used:
g++ -O3 -march=ultrasparc3 a.cc
The result was astonishing: the version compiled by
g++ was almost 3 times faster than the one compiled
by studio 10. I ran cputrack on the execution of both
probrams and it showed that EC_rd_miss seems to be
one of the main reasons, as it is 23758247 against
148306.
Got anybody any idea, what the reason therefore might
be? Might there be an easy way to change the code to
perform better or other compiler flags to produce
code with a better cache performance? BTW: Kenneth
Massey complained that g++ 3.4 is worse than g++
3.3...
Cheers,
Tom
#include <stdio.h>
#include <vector>
class mytype_A {
public:
int id;
mytype_A():id(0) {}
class mytype_B {
public:
mytype_A* A;
mytype_B(mytype_A* p):A(p) {}
class mytype_C {
public:
mytype_B* B;
mytype_C(mytype_B* p):B(p) {}
class mytype_D {
public:
// mytype_C* C[2]; // less performance
ce difference if we use simple arrays
std::vector<mytype_C*> C;
int junk[3]; // affects performance
ce (must cause cache misses)
public:
mytype_D(mytype_A* a0, mytype_A* a1) {
// C[0] = new mytype_C(new mytype_B(a0));
// C[1] = new mytype_C(new mytype_B(a0));
C.push_back(new mytype_C(new mytype_B(a0)));
C.push_back(new mytype_C(new mytype_B(a0)));
int main() {
const int k = 5000; // run-time
me not linear in k
mytype_A* A[k];
mytype_D* D[k];
for (int c=0;c<=k;c++)
A[c] = new mytype_A();
for (int c=0;c<k;c++)
D[c] = new mytype_D(A[c],A[k-c]); //
// intentionally make some pointers far ther apart
clock_t before = clock();
int k0 = 0;
for (int i=0;i<k;i++) {
k0 = 0;
for (int j=0;j<k;j++) { // run through
ough list of D's, and reference pointers
mytype_D* d = D[j];
if (d->C[0]->B->A->id) k0++;
if (d->C[1]->B->A->id) k0++;
printf("%d\n",k0); // don't allow
ow compiler to optimize away k0
printf("time:
e: %f\n",(double)(clock()-before)/CLOCKS_PER_SEC);
return 0; -
I want to run TimerTask for fixed number of times. How can i stop the timer after running it certain no of times.
You know how to increment a variable?I am facing difficulty in Stopping Schedular not in arriving at some condition (Incrementing variable) . So any help in stopping schedular is appreciated.
I am using cancel() of Timer class. But, Some thread is running in backgroud and program is not terminating -
Increment counter in XSLT mapping
Hi Experts,
I am creating xslt mapping by using mapforce tool. I am trying to get increment counter variable in xslt mapping. can you please tell me what would be the code for getting sequence number.
Thanks for your help.
Thanks,
Hariyes, there is a global variable concept in XI which u can use for your Sequence Number concept.
If you are on SP14 and above, just take a lookat this blog and the GLOBAL Variables Section
XI: New features in SP14
check this thread
Re: Need Help in XSLT Mapping
Re: Sequence Number in XI Mapping -
Help required on XSLT Conditional Mapping
Hi,
We need help on XSLT mapping in BPEL based on a condition. We are transforming from OAG format to a client specific format. We need to map a single tag (but repetitive) on the left hand side (OAG) to different tags on the right hand side. The same tag on the left hand side repeats with different values. Depending on the value the mapping to the right hand side varies. The left hand side (OAG) looks something like this.
<PARTNER>
<PARTNRID>2002</PARTNRID>
<PARTNRTYPE>Supplier</PARTNRTYPE>
<ADDRESS>
<ADDRLINE index="1">2000 Century Way</ADDRLINE>
</ADDRESS>
</PARTNER>
<PARTNER>
<PARTNRID>204</PARTNRID>
<PARTNRTYPE>BillTo</PARTNRTYPE>
<ADDRESS>
<ADDRLINE index="1">90 Fifth Avenue</ADDRLINE>
</ADDRESS>
</PARTNER>
Please note that the tag PARTNER and it's underlying tags appear twice in the XML file.
Based on the value in the tag PARTNRTYPE, the mapping to the right hand side differs. If the value is 2002, PARTNRID should map to Supplier ID on the right hand side and if the value is 24, PARTNRID should map to BillTo ID on the right hand side. The right hand side should look something like
<Supplier>
<SupplierID>2002</SupplierID>
<Address>2000 Century Way</Address>
</Supplier>
<BillTo>
<BillToID>204</BillToID>
<Address>90 Fifth Avenue</Address>
</BillTo>
Please let us know how to achieve this. Your help is much appreciated. Thanks in advance.
Thanks,
PrasannaHi Prasanna ,
I am not an expert but what about this:
<SUPPLIERID>
<xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
</SUPPLIERID>
<BILLTOID>
<xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
</BILLTOID>or
<xsl:choose>
<xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
<SUPPLIERID>
<xsl:value-of select="/PARTNER/PARTNRID"/>
</SUPPLIERID>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="/PARTNER/PARTNRTYPE = '24'">
<BILLTOID>
<xsl:value-of select="/PARTNER/PARTNRID"/>
</BILLTOID>
</xsl:when>
</xsl:choose>Regards Pete
Maybe you are looking for
-
Update to windows 8.1 fails every time with error 0x80004005
Like many others trying to install the update (windows 8.1 via Windows Store app), I keep getting the same error code (0x80004005) in the last stages of the update. I have successfully installed the update on 3 systems without a hitch - 2 desktop
-
Hai, I have a problem relating to payments made to multiple vendor. I have tried by using payment method set up in Admn>Setup>Banking>Payment method setup and by using payment wizard. It is coming correctly but it is making as individual entry for ea
-
Flash player not working on certain websites. Help?
Ok, so my flash player works for just about every site, with the exception of two so far: the Cosmos website and the Zero Punctuation website. The videos there just appear black. The player works everywhere else I've tried. I'm currently using Chrome
-
Can I place page 2 of an InDesign doc into another InDesign doc? A Script maybe?
I would like to take certain pages from document A and place them in document B so that when I change doc A, the linked pages placed in doc B automatically update. I often place single page InDesign documents into other InDesign documents but can't f
-
2 node RAC: one 10gR2 node and one 11.2.0.3 node on Solaris 10.
Is it possible to have a mixed Oracle version 2 node RAC with 10gR2 database on one machine and 11.2.0.3 database installed on the other machine. Has anyone done this?