on 10-17-2013 1:52 AM
Hello PI Experts,
I need a help in a piece of mapping. Here is my requirement.
Source structure in Idoc.
<E1EDKA1></E1EDKA1>
<PARVW> BK<PARVW>
<E1EDP01></E1EDP01>
<PARVW> WE<PARVW>
My target structure should be
<contact>>/contact> ---> this node cardinal is 2..unbounded and role is 1:1.
<role>BK</role>
<role>WE</role>
<contact>>/Contact>
Would anyone help me on how to achieve this mapping with UDF since as I assume it can't be done through standard PI functions
Thanks
Brhamma
Hi Guys,
The fix is that you need a constant or a value in the Duplicate segment. Without that the segment will give an error saying that it cannot produce the structure and that it has changed.
Just add an constant and the problem will be solved.
Regards,
Jannus Botha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
<contact>>/contact> ---> this node cardinal is 2..unbounded and role is 1:1.
<role>BK</role>
<role>WE</role>
<contact>>/Contact>
if role has a cardinality 1:1 and contact 2...N the result XML will be
<contact>>
<role>BK</role>
</contact>
<contact>
<role>WE</role>
</Contact>
to get the result that you define in the main post the cardinality od role should be 1:N
Please check this out to try help ypu properly.
BTW i assume that the solution for your scenario will be:
1). rigth click over <Contact> and select "Duplicate subtree"
2) map the
E1EDKA1></E1EDKA1>
<PARVW> BK<PARVW> to the <Contact>--->Role
3) in the duplicated substree do this
1)<PARVW> (E1EDP01) --> removeContext--> <contact>
2) <PARVW> --> <Role>
try this out and let me know.
Regards
Rodrigo
Best Regards
Message was edited by: Rodrigo Alejandro Pertierra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, it was a typo. Yes, this is correct structure which I would need. Basically contact node is to be generated twice based on header node and item level node. I changed the context and tested it in several ways, but no luck. The contact node and it's sub elements are getting generated twice of PARVW==BK(header) and it's simply ignoring item level condition elements. So thought of like I would need a UDF.
<contact>>
<role>BK</role>
:
:
</contact>
<contact>
<role>WE</role>
:
:
</Contact>
Regards
BV
HI, if you cannot change the target structure you wont be able to generate many <ROLE> fields you will only send it ONCE.
the other possiblity that remains is generate an structure like this
<contact>>
<role>BK</role>
</contact>
<contact>
<role>MS</role>
<contact>
<contact>
<role>WS</role>
<contact>
ONE role per Contact segment. you dont have any more option.
check it with the funtional team. they shuold update the Funtional Document that tells you how to map the values with the structures involved
rgds
Rodrigo
Hi Vishnu
Can you please provide your exact target xml structure so that I can provide u the mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brhamma,
E1EDKA1 is at the header level and will occur once per IDoc while E1EDPA1 is at the item level and will occur multiple times per line item E1EDP01.
What is the condition for contact node creation?
Solution can be reached but the logic should be clear.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ambrish,
Thank you for your response.
The condition is if PARVW==BK then map some of E1EDKA1 sub element's pertaining to address, to Contact node at target side. Similarly, if PARVW==WE then map some of E1EDPA1 sub element's pertaining to address, to Contact node at target side. Of course E1EDKA1 occurs only once, I agree.
E1EDPA1 segment is also occurring once though it occurs multiple times out of line item in general.
Regards
BV
Hi Brahmma,
tried a quick prototype with what I could understand.
I created a dummy target structure as below:
Contact node has been duplicated. First contact node is mapped as below:
Street field is mapped as below with STRAS under E1EDKA1.
Second contact node has been mapped as below:
Street has been mapped similar as above.
I created a test case with 2 E1EDKA1 with one BK and 2 line item segments with first item having 2 E1EDPA1 with one WE and second Item with 3 E1EDPA1 with one WE as below:
I am able to produce 3 contact rows as below
I am not sure if it is that simple else why would you ask for UDF... do let me know if this is close.
cheers
Ambrish
>>>>>>>Duplicating node element is not working for some reason
I don't see any reason why it should not work. Try and change the cardnality to 0--unbounded and seee if its duplication happens.
Cardinality of 2--unbounded doe not mean it will be created twice atleast. It means it should be populated twice by the mapping...
Try to implement the solution as I suggested and let me know if you need further help.
Ambrish
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.