Skip to Content
0
Jul 04, 2016 at 09:09 PM

useOneAsMany problem in graphical mapping

90 Views

Hi All,

I am having trouble with a graphical mapping where I am using the node function useOneAsMany. From a source XML I am generating multiple IDOCS, here is a crude example of the source XML message:

<GetSite>

<Member>

<emailAddress>site1@gmail.com</emailAddress>

<deliveryAddresses/>

</Member>

<Member>

<emailAddress>site2@gmail.com</emailAddress>

<deliveryAddresses>

<MemberAddress>

<accountAddressCode>1111</accountAddressCode>

</MemberAddress>

<MemberAddress>

<accountAddressCode>2222</accountAddressCode>

</MemberAddress>

</deliveryAddresses>

</Member>

</GetSite>

The graphical mapping generates one IDOC for each <MemberAddress> node in the source XML. In the above case it generates two IDOCS:

<IDOC>

<Site>

<accountAddressCode>1111</accountAddressCode>

<Email>site2@gmail.com</Email>

</Site>

</IDOC>

<IDOC>

<Site>

<accountAddressCode>2222</accountAddressCode>

<Email>site2@gmail.com</Email>

</Site>

</IDOC>

The <Email> field in the IDOC must come from the header node of the source XML <Member>. I have achieved this with the useOneAsMany node function. It works fine when <Member> contains sub-node <MemberAddress> as an Idoc is always generated. However when the source XML file contains <Member> with no sub-node <MemberAddress> it is causing a problem. See the example below:

As the useOneAsMany function takes <emailAddress> as the first input it is getting confused as the first occurrence of <emailAddress> in the above XML does not generate an IDOC (which is correct).

Does anyone have any advice on how to get around this issue?

Che

Attachments

SCN post pic.png (15.7 kB)