on 06-16-2009 1:52 PM
Hi,
I had an requirement to convert the CSV file XML on the sender side through FCC and map to the target (Header and Detail)
Suppose if the file contains 2 records with the same order number then there must be only one header record and 2 detail records
for example if the ordernumber is same for 2 records in the file
(order number cybersourceRequestID customerID is same in both the records)
OrderNumber CybersourceRequestID OrderDate CustomerID ContactEmailAddress ContactPhoneNumber ShipToAddress ShipToCity ShipToCountry ShipToDescription ShipToState ShipToZip ShippingCharges ShippingInstructions SoldToAddress
OrderNumber CybersourceRequestID OrderDate CustomerID ContactEmailAddress ContactPhoneNumber ShipToAddress ShipToCity ShipToCountry ShipToDescription ShipToState ShipToZip ShippingCharges ShippingInstructions SoldToAddress
the target structure must be as below
Header 1:unbounded
Detail 1: unbounded
<CRS_ORDER
<header xmlns="">
<LegacyCompanyNumber></LegacyCompanyNumber>
<CustomerNumber></CustomerNumber>
<OrderDate></OrderDate>
<NetAmount></NetAmount>
<TaxAmount></TaxAmount>
<FreightAmount></FreightAmount>
<TotalAmount></TotalAmount>
<PrepaidAmount></PrepaidAmount>
<GiftCertAmount></GiftCertAmount>
<StoreCreditAmount></StoreCreditAmount>
<LoyaltyCardAmount></LoyaltyCardAmount>
<ChargeCardAmount></ChargeCardAmount>
<detail>
<detailrow>
<UPC></UPC>
<Description></Description>
<Quantity></Quantity>
<Price></Price>
<CouponPromoAmount></CouponPromoAmount>
<CouponStructuralAmount></CouponStructuralAmount>
<CouponOtherAmount></CouponOtherAmount>
</detailrow>
</detail>
<detail>
<detailrow>
<UPC></UPC>
<Description>FARD A LEVRES ROUGE PUR Pure Lipstick</Description>
<Quantity></Quantity>
<Price></Price>
<CouponPromoAmount></CouponPromoAmount>
<CouponStructuralAmount></CouponStructuralAmount>
<CouponOtherAmount></CouponOtherAmount>
</detailrow>
</detail>
</header>
</CRS_ORDER>
Here my doubt if more than 1 record in the file has a same order number then how can i send the records to the item level of the same header record.
Thanks for your Help.
Srinivas
Thnaks for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pls help...
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Source structure is as below
<RECORD>
<ROW>
<OrderNumber/>
<CyberSourceRequestId/>
<OrderDate/>
<CustomerID/>
<ContactEmailAddress/>
<ContactPhoneNumber/>
<ShipToAddress/>
<ShipToCity/>
<ShipToCountry/>
<ShipToDescription/>
<ShipToState/>
<ShipToZip/>
<ShippingCharges/>
<ShippingInstructions/>
<SoldToAddress/>
<SoldToCity/>
<SoldToCountry/>
<SoldToDescription/>
<SoldToState/>
<SoldToZip/>
<ProductID/>
<ProductReferenceNumber/>
<ProductEANNumber/>
<ProductName/>
<ProductModel/>
<QuantityOrdered/>
<OrderCouponCode/>
<OrderCouponAmount/>
<OrderTaxes/>
<Price/>
<FinalPrice/>
<FinalProductNetPrice/>
<OrderTotalAmount/>
<GCAmount/>
<CCAmount/>
</ROW>
</RECORD>
My Target is below
<header>
<LegacyCompanyNumber>YSL</LegacyCompanyNumber>
<CustomerNumber>701</CustomerNumber>
<OrderDate></OrderDate>
<NetAmount></NetAmount>
<TaxAmount></TaxAmount>
<FreightAmount></FreightAmount>
<TotalAmount>Constant</TotalAmount>
<pre><code>0</code></pre>
<GiftCertAmount></GiftCertAmount>
<StoreCreditAmount>0</StoreCreditAmount>
<LoyaltyCardAmount>0</LoyaltyCardAmount>
<ChargeCardAmount></ChargeCardAmount>
<detail>
<detailrow>
<UPC></UPC>
<Description></Description>
<Quantity></Quantity>
<Price>Constant</Price>
<CouponPromoAmount>0</CouponPromoAmount>
<CouponStructuralAmount>0</CouponStructuralAmount>
<CouponOtherAmount>0</CouponOtherAmount>
</detailrow>
</detail>
</header>
Regards
Srinivas
Dear Srinivas,
Follow this mapping:
Order Number-> collapse Contexts> Split by Value(ValueChanged)->Detail
However, Before doing this graphical mapping, you will have to do an XSLT mapping for sorting your sender records based on the Order number.
you can do somehting like this
:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<ns:RECORD xmlns:ns="http://Yournamespace">
<xsl:for-each select="ns:RECORD /ROW">
<xsl:sort select="OrderNumber"/>
<ROW>
<OrderNumber/><xsl:value-of select="OrderNumber"/></OrderNumber>
and so on for rest fields..............
...........
</ROW>
</xsl:if>
</xsl:for-each>
</ns:RECORD>
</xsl:template>
</xsl:stylesheet>
Regards,
Merrilly
Hi,
Have you tried using SORT option along wiht one as many ( Context : Change Value) in your GUI mapping?...
Try those tings.. I think... Your requirement can be be handled with GUI mapping.
Thanks,
Subbu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.