cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thnaks for your help

Former Member
0 Kudos

Pls help...

Srinivas

Former Member
0 Kudos

Hi Srinivas,

Can you please tell how the source structure looks?

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Subbu,

Can you explain me with an example

Aprreciate your help.

Srinivas