on 11-09-2008 5:39 AM
I am trying to map target based on a condition. Meaning I want to map E1EDKA2(1..99999) of DESAD01 Idoc to ShipTo(0..1) node if E1EDKA2-PARVW = WE.
I tried all the variations with creatIf and formatByExample but I couldn't able to get it working.
Here is the target XML structure
<Delivery>
<Header>
<ShipmentNumber>1234</ShipmentNumber>
<BOLNumber>ABDC</BOLNumber>
<ShipTo>
<Name>XYZ</Name>
</ShipTo>
<SoldTo>
<Name>XYZ</Name>
</SoldTo>
</Header>
<LineItems>
</LineItems>
</Delivery>
Thanks
Suman
I found a better way of doing this...
/ns0:MT_XML_Delivery/Delivery/Header/ShipmentNumber=/DESADV01/IDOC/E1EDK07/VBELN /ns0:MT_XML_Delivery/Delivery/Header/BOLNumber=/DESADV01/IDOC/E1EDK07/BOLNR /ns0:MT_XML_Delivery/Delivery/Header/ShipTo=createIf(stringEquals(removeContexts(/DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW), const(value=WE))) /ns0:MT_XML_Delivery/Delivery/Header/ShipTo/Name=/DESADV01/IDOC/E1EDK08/E1EDKA2/NAME1
Thanks for all who tried to help me.
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try with this advance UDF code.
for(int i = 0;i<E1E.length;i++)
{
if(PAR<i>.equals("WE"))
result.addValue("");
}
There will be two inputs first the segment E1E and the another is PAR field with same context as of parent segment E1EDKA2 and map this with shipTo field.
Try with this and let us know the result.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh,
I don't know what is the significance of checking 1 = 1. Anyway I could able to resolve the issue by my self. Thank you very much for taking time to help me.
/ns0:MT_XML_Delivery/Delivery/Header/ShipmentNumber=/DESADV01/IDOC/E1EDK07/VBELN
/ns0:MT_XML_Delivery/Delivery/Header/BOLNumber=/DESADV01/IDOC/E1EDK07/BOLNR
/ns0:MT_XML_Delivery/Delivery/Header/ShipTo=createIf(stringEquals(/DESADV01/IDOC/*E1EDK08*/E1EDKA2/PARVW, const(value=WE)))
/ns0:MT_XML_Delivery/Delivery/Header/ShipTo/Name=replaceString(/DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW, /DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW, /DESADV01/IDOC/E1EDK08/E1EDKA2/NAME1)
/ns0:MT_XML_Delivery/Delivery/Header/ShipTo/AccountNumber=/DESADV01/IDOC/E1EDK08/E1EDKA2/PARTN
XI/PI is really strange. It needs to have that PRVW in the first field mapping, even though it is not being used. I just replaced PARVW with the NAME1 and mapped to name. For the ShipTo, I set E1EDK08 (next higher level structure) as the context.
I think it will take time for me to learn this, as I come from webMethods and XSLT background.
Thanks
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh,
I kind of lost here.
What should be the other input for (equlaS 1).
- Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
What the problem you are facing
if you use
source -> equals (constant = WE) - createif -> target
Whats the source structure.
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
My source structure is Idoc DESADV01. With the following code I don't get anything in the ShipTo/Name.
/ns0:MT_XML_Delivery/Delivery/Header/ShipmentNumber=/DESADV01/IDOC/E1EDK07/VBELN /ns0:MT_XML_Delivery/Delivery/Header/BOLNumber=/DESADV01/IDOC/E1EDK07/BOLNR /ns0:MT_XML_Delivery/Delivery/Header/ShipTo=createIf(stringEquals(/DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW, const(value=WE))) /ns0:MT_XML_Delivery/Delivery/Header/ShipTo/Name=/DESADV01/IDOC/E1EDK08/E1EDKA2/NAME1.
- Suman
Hi,
You need to do your mapping something like this..
Mapping for Segment "ShipTo"
E1EDKA2 ---> equalS (WE) ---> IF Then map constant 1 -
> ShipTo (this will create the segment "ShipTo" only when you have value WE)
Mapping for field "NAME"
E1EDKA2 ---> equalS (WE) ---> IF then map constant 1 --> IF ---> equalS (1) Then NAME1 ---> Remvoecontext -
> SplitByValue -
> NAME
Try this I hope it will help you.
Regards,
Sarvesh
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.