on 06-16-2009 6:40 PM
Hi Gurus,
My scenario is File to File
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>
Suppose if my file contains records as below
570774 xxx xxx xxx xxx
570774 xxx xxx xxx xxx
570775 xxx xxx xxx xxx
For each new order number(key field ex: 570774) a new xml file to be created , from the above example 2 xml files sholud be created(one for 570774 and the other for 570775)
How can i acheive this functionality? Please help me on this,
Thanks in advance
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi RP,
i had gone through the blogs, but iam confused
let me explain you my scenario once again.
my source and target is as mentioned above(in the thread).
1) i must generate multiple o/p files for different ordernumbers.
2)if there is more than 1 record for the same order number,
then in target it must be 1 header and more than 1 detail items.
the above requirement i can only acheive only through multimapping?
Appreciate your help.
Srinivas
Srinivas,
Do this mapping and it should work for you:
OrderNumber(change context to Record) --> splitbyvalue(Valuechanged) --> collapsecontext --> Header
and for header elements map directly.
For Detail map like this:
OrderNumber(change context to Record) --> splitbyvalue(Valuechanged) --> Detail
For Detail Record map like this:
OrderNumber(change context to Record) --> splitbyvalue(Valuechanged) --> DetailRecord
Your all test cases should work.
Regards,
---Satish
Satish
iam getting the foloowing error ( for the records with same order numbers)
Compilation of MM_CRS_EBRAND successful Cannot produce target element /ns0:MT_EBRAND_RECEIVER/header[2]/detail[2]/detailrow. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element /ns0:MT_EBRAND_RECEIVER/header[2]/detail[2]/detailrow. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
Please suggest.
Srinivas
Satish,
Thanks for your help,it worked .
i had one more issue
i need to add the the productnetprice for a particular order number and pass into the header (netprice).
Please help me
I must add the amount of the same order number and pass it to the target
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
in the target the net price is at header level and the netprice for the
order number1 value should be 10+10 = 20 and for
order number2 value should be 15+15 = 30
<header>
<ordernumber1>
<product net price>20<product net price>
<item>
<item>
<header>
<header>
<ordernumber2>
<product net price>30<product net price>
<item>
<item>
<header>
Thanks in advance, Appreciate your help.
Srinivas
In Message mapping we need to change Target message occurences to 0..unbounded and then do the rest i.e map Key -> split by value (value changed) -> Header.
Even In Interface mapping we need to change occurences.
I hope this would work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Increase the Context of OrderNumber to the Record level.....then map to the target field....presently the context will be at Row level...
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please help...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Map the source key field to the header record of the target field. Use the split by value and change the source key field level to higher one so that the all occurences of the key field are occuring. The mapping will be like this;
Source Key Field (change to higher level) --> Spli by value --> Filename creation UDF --> Target header field.
Try this.
Regards,
Murugavel.
Thanks for all your suggestions.
I tried with your suggestions it is not working for some conditions.
ordernumber(context is record) -
> splitbyvalue(valuechange) -
>Header
Now the issue if there is more than 1 records with the same order number,then in target it must be 1 header and more then 1 detail items.
if there are 2 records in the file for the same order number -- product ean number will be different for the records.
for detail --- i had done the mapping like below.
productEanNumber(context is row) -
> splitbyvalue(valuechange) ---> detail
My issues are
if there are more than one record for a order number, in the target it must be one header record and morethan one detail record.
if there is change in the order number,then a new header record to be created along with the detail record.
Thanks in Adavance, Appreciate your Help.
Regards
Srinivas
Srinivas,
Do this mapping:
Ordernumber--> split by value(right click and select value change) --> Header.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.