cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for repeated node

former_member249399
Active Participant
0 Kudos

Hi,

My requirement is how to map data in below situation.

I have one node which occur repeatedly.

Source:

Node A

  comment

Node A

  comment

Node A

  comment

Target:

comment

comment

comment

How can I achive this using UDF.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

You may use the below mapping, assuming the source and target structures are as shown in the screen capture below

Rgds

Diptee

former_member249399
Active Participant
0 Kudos

Hi Diptee,

It is not like that. Please check structure.

Z1WHCONS is mapped to NODE A

Z1WHCUSTC to NODE B

Z1WHCUSTCD to  Node B- LINE Node

Z1WHCMTH to comment field of Line Node

Target

NODE B

NODE A

--NODE B

---LINE

    --comment

if Z1WHCONS is blank , NODE B willl create else NODE A.

Former Member
0 Kudos

Hello,

Please give the structure of the target message as well.

Rgds

Diptee

former_member249399
Active Participant
0 Kudos


Hi Diptee,

Please find target XSD.

Former Member
0 Kudos

Hello,

I am able to obtain the below output with one to one mapping for Z1WHCMTH to comment field of Line Node.

However, as you can see since Z1WHCMTH is not a substructure of Z1WHCUSTCD; you will need to seek clarity on how to populate comment for each line segment being created.

Also what exactly are NODE A and NODE B in your target xsd?

Regards,

Diptee

former_member249399
Active Participant
0 Kudos

HI Diptee,

Node A - Mixplt

NODE B- Box.

Please check for this test file.

Comment field should display only in first line.

Former Member
0 Kudos

Hello,

I canot load the entire XML as I do not have the idoc structure, and the mapping definition I showed in my previous post still works fine for me.

Please try it and let me know if you run into any issues.

Regards

Diptee