cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Liangli and satish

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

In your second paramter of FormatByExample, the "RemoveContext" is un-necessary,

get rid of it.

Your mapping seems always expect the ordernumber come in sequence, e.g. 001, 001, 001, 002, 002, etc.

Regards.

Liang

Former Member
0 Kudos

Hi Srinivas,

Do like this:

quantity>removecontext> > formatbyexample>sum-->target

ordernumber>removecontext>splitbyvalue(valuechange)

Dont change any context level for any fied just use straight. It should work. I tried it and it is working.

Regards,

---Satish