on 06-18-2009 7:39 PM
Hi
I had followed the below thread
/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
i hadprice fields at the item level,
and i want to add the qty values for each order number and map to target header quatity field.
suppose if i have
PONum,LineItemNum,Qty,Description
001,1,34,Carrots
001,2,17,Apples
001,3,22,Bananas
002,1,4,Mangos
002,2,9,Coconuts
003,1,44,Grapes
Goal is to generate 3 messages, one for each PO and the sum of quantities to me mapped to target in header<qty>
<po>
<num>001</num>
<qty>73<qty> 34+17+22
<line_items>
... 3 line items for PO # 001 ...
</line_items>
</po>
<po>
<num>002</num>
<qty>13<qty> 4+9
<line_items>
... 2 line items for PO # 002 ...
</line_items>
</po>
<po>
<num>003</num>
<line_items>
... 1 line item for PO # 003 ...
</line_items>
</po>
to genearte 3 messages i followed the thread /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
and now my issue how can i sum the quantity fields for a order number and pass to the target header field.
Appreciate your help.
Thanks
Srinivas
Thanks Liangli and satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Goal is to generate 3 messages, one for each PO and the sum of quantities to me mapped to target in header<qty>
-
>
To generate 3 messages at target
PONum(context to root)--->SplitByValue(value change) --->collapsContext---> MT_target
To sum the quantities
Qty(context to root)--->sum---->target field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Srinivas:
You can use following logic:
PONum ->RemoveContext->
SortBykey---------------------------------->
Qty ->RemoveContext->
FormatByExample-->sum
PONum ->RemoveContext->Sort ->SplitByValue[valueChange]----------->
Regards.
Liang
Edited by: Liang Ji on Jun 18, 2009 9:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Liang
Thanks for your response.
it is ok when i there is same order number for both the rocords
when there order numbers are different iam getting the error
Cannot produce target element /ns0:Messages/ns0:Message1/ns1:MT_EBRAND_RECEIVER[2]/header/NetAmount. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
I had done the mapping as below.
qty(context mt_ebrand_receiver) --->remove context -----
------ format by example ---- sum ---- targetfield
ordernumber(context mt_ebrand_receiver) --> splitby value(value changed) --->remove context --
Please suggest
Srinivas
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
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.