on 10-07-2010 11:54 AM
I have a mapping problem.
I get the follwoing structure into my mapping.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:ResponseMsg>
<C_NAP_AP_FLAG>PM</C_NAP_AP_FLAG>
<E_MESCOD>MRM</E_MESCOD>
<E_SYSTEM>QA</E_SYSTEM>
<C_REFMES>APMM</C_REFMES>
</ns1:ResponseMsg>
</ns0:Message1>
<ns0:Message2>
<INVOIC02>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
</EDI_DC40>
<E1EDKA1 SEGMENT="1">
<PARVW>RE</PARVW>
<PARTN>XXX</PARTN>
<LIFNR>XXX</LIFNR>
<NAME1>XXX</NAME1>
</E1EDKA1>
<E1EDKA1 SEGMENT="2">
<PARVW>RS</PARVW>
<PARTN>YYY</PARTN>
<LIFNR>YYY</LIFNR>
<NAME1>YYY</NAME1>
</E1EDKA1>
</IDOC>
</INVOIC02>
</ns0:Message2>
</ns0:Messages>
If the following values appear
<E_SYSTEM> = QA
<PARVW> = RE
<PARTN> = XXX
Then i would like the following targetmessage.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:ResponseMsg>
<C_NAP_AP_FLAG>PM</C_NAP_AP_FLAG>
<E_MESCOD>MRM</E_MESCOD>
<E_SYSTEM>QA</E_SYSTEM>
<C_REFMES>APMM</C_REFMES>
</ns1:ResponseMsg>
</ns0:Message1>
<ns0:Message2>
<INVOIC02>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
</EDI_DC40>
<E1EDKA1 SEGMENT="1">
<PARVW>RE</PARVW>
<PARTN>ZZZ</PARTN>
<LIFNR>XXX</LIFNR>
<NAME1>XXX</NAME1>
</E1EDKA1>
<E1EDKA1 SEGMENT="2">
<PARVW>RS</PARVW>
<PARTN>YYY</PARTN>
<LIFNR>YYY</LIFNR>
<NAME1>YYY</NAME1>
</E1EDKA1>
</IDOC>
</INVOIC02>
</ns0:Message2>
</ns0:Messages>
So the PARTN in segment E1EDKA1 with a PARVW = RE will Be changed from XXX to ZZZ.
How would I solve this?
BR
Kalle
I've done the following mapping.
E_SYSTEM ->
Constant: QA -> equalS ->
PARVW -> equalS -> And ->
Constant: RE -> Constant: ZZZ
PARTN-> And -> IF -> SplitByValue -> PARTN
PARTN -> exsits -> IF -> equals -> PARTN->
Constant: [] -> Constant: XXX ->
I hope you can follow the mapping above.
Do not get the deciered output.
BR
Kalle
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of
PARTN-> And -> IF
PARTN -> exsits -> IF -> equals -> PARTN->
Constant: [] -> Constant: XXX ->
you should use PARTN - mapwithdefault - equals (constant"XXX") - if
another trick:
PARTN - mapwithdefault - fixvalues (XXX -> ZZZ, default = key) -
Edited by: Stefan Grube on Oct 7, 2010 2:18 PM
Hi Kalle,
a bit difficult doing it with the braincompiler
Your mapping looks pretty good, and I don't think you should have much problems with contexts. E_SYSTEM, as it occurs only once, you could use in the lowest context possible, eg. Messages or Message1, no harm in that. I don't think you need the SplitByValue, and you can keep PARNR and PARVW in their original context (as they share that context).
Displaying the queues of your mapping functions might help to see what's happening, eg. right-click on your IF function, and see what goes in and comes out. Sorry I can't be more specific.
kr,
Peter Glas
E_SYSTEM ---->
equalS---->
Constant(QA)-->
AND-----------------------> (Const)XXX - THEN
PARTN -> exists -----------> PARTN -----> AND----------IF -------------- >PARTN
equalS-----> PARTN--ELSE
Constant(XXX)-- >
Change the context of PARTN to the root tag of the xml.
Edited by: nagarjuna _s on Oct 7, 2010 2:28 PM
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.