cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping - Duplicate Subtrees

Former Member
0 Kudos

Hi,

Does anybody have any experience with mapping duplicate subtrees in the graphical mapping editor?

I am trying to map a straightforward list of source fields to a recurring set of target fields (type & value). As described in the help. I duplicated the subtree of the target structure and mapped the fields.

The mapping looks like this (and this corresponds with the SAP XI help:

/ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute/EnqAttribTypeCode=Constant([value=VRM]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/VRM /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]/EnqAttribTypeCode=Constant([value=Foreign]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Foreign /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[2]/EnqAttribTypeCode=Constant([value=RHDrive]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[2]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/RHDrive /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[3]/EnqAttribTypeCode=Constant([value=TaxDisc]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[3]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/TaxDisc /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[4]/EnqAttribTypeCode=Constant([value=Type]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[4]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Type /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[5]/EnqAttribTypeCode=Constant([value=Make]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[5]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Make /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[6]/EnqAttribTypeCode=Constant([value=Model]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[6]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Model /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[7]/EnqAttribTypeCode=Constant([value=Colour]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[7]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Colour

However, whenever I try to save the mapping, it gives me the following error and deletes all the subtrees:

The source or target structure has been changed or could not be found in the Integration Repository. The mapping definition contains elements or attributes that do not exist in the changed structure. The relevant entries will be deleted

Target structure has no such path: /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]/@EnqAttribStringValue. Skipping mapping

.. and so on for the entire list of fields.

I have tried everything I can think of... saving before mapping, mapping then saving, etc. But it dosn't work. Can anyone advise, please?

Thanks and Regards

Manish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Manish,

You only need to use the duplicate subtree when you want to have different mapping to the same repeating segment.

Example

If you want to map to two E1EDKA1 (name and address) segments in an order.

You could hardcode the first PARVW to AG

and use the duplicate subtree to map WE to the PARVW of the second occurrence of the segment.

You would then get two segments at run time one with AG and the next with WE.

Hope this helps,

Regards,

Simon

Former Member
0 Kudos

Hi Simon,

I do want different mappings to the same repeating structure.

My source message looks like this:

<i><Dummy_ExtendedAttributes>

<VRM>VRMvalue</VRM>

<Type>TYPEvalue</Type>

...

...

...

</Dummy_ExtendedAttributes></i>

My target message looks like this:

<i>

<Dummy_EnqAttribSet>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>VRM</EnqAttribTypeCode>

<EnqAttribStringValue>VRMvalue</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Type</EnqAttribTypeCode>

<EnqAttribStringValue>TYPEvalue</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

...

...

</Dummy_EnqAttribSet>

</i>

This is repeating. I need to fill the value in the source elements (eg, VRM, Type) into repeating elements of EnqAttribStringValue.

I think that duplicate subtrees is the way to go...but I could be wrong.

In the message mapping, i am able to create the subtrees I want, and then map them. But when I try to save, the systems starts behaving funny.

Any ideas?

Cheers

Manish

Former Member
0 Kudos

Manish,

You only need to use the Duplicate Subtree to create different mapping (not data).

Do you want an occurrence of your destination data structure per occurrence of your source structure?

If so then you do not use the duplicate subtree function.

Can you show me what the two structure look like?

Regards,

Simon

Former Member
0 Kudos

Hi Simon,

I need to map distinct source fields to the same (recurring) target field.

I have eight distinct source fields (nonrecurring)...

<Dummy_ExtendedAttributes>
<VRM><i>ABC12345</i></VRM>
<Foreign><i>No</i></Foreign>
<RHDrive><i>Yes</i></RHDrive>
<TaxDisc><i>Unknown</i></TaxDisc>
<Type><i>Car</i></Type>
<Make><i>Audi</i></Make>
<Model><i>A3</i></Model>
<Colour><i>Black</i></Black>
</Dummy_ExtendedAttributes>

I need to map this into a recurring target structure like this...

<Dummy_EnqAttribSet>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>VRM</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>ABC12345</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>Foreign</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>No</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>RHDrive</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>No</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>TaxDisc</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>Unknown</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>Type</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>Car</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>Make</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>Audi</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>Model</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>A3</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>
<EnqAttribTypeCode><i>Colour</i></EnqAttribTypeCode>
<EnqAttribStringValue><i>Black</i></EnqAttribStringValue>
</Dummy_EnquiryAttribute>

</Dummy_EnqAttribSet>

Hope this gives a better idea ?

Regards

Manish

Former Member
0 Kudos

Manish,

Set a constant to <b>Dummy_EnqAttribSet</b>

Set a constant to <b>Dummy_EnquiryAttribute</b>

Now map VRM. Then Duplicate subtree. The trick is always map a constant to <b>Dummy_EnquiryAttribute</b>

I have mapped your message successfully.

/ns:Dummy_EnqAttribSet=Constant([value=1]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute=Constant([value=1]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute/EnqAttribTypeCode=Constant([value=VRM]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/VRM /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]=Constant([value=2]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]/EnqAttribTypeCode=Constant([value=Foreign]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[1]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Foreign /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[2]=Constant([value=3]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[2]/EnqAttribTypeCode=Constant([value=RHDrive]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[2]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/RHDrive /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[3]=Constant([value=4]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[3]/EnqAttribTypeCode=Constant([value=TaxDisc]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[3]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/TaxDisc /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[4]=Constant([value=5]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[4]/EnqAttribTypeCode=Constant([value=Type]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[4]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Type /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[5]=Constant([value=6]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[5]/EnqAttribTypeCode=Constant([value=Make]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[5]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Make /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[6]=Constant([value=7]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[6]/EnqAttribTypeCode=Constant([value=Model]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[6]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Model /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[7]=Constant([value=8]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[7]/EnqAttribTypeCode=Constant([value=Colour]) /ns:Dummy_EnqAttribSet/Dummy_EnquiryAttribute[7]/EnqAttribStringValue=/ns:Dummy_ExtendedAttributes/Colour

The output now looks like this

<?xml version="1.0" encoding="UTF-8"?>

<ns:Dummy_EnqAttribSet xmlns:ns="http://intervet.intra/Christiaan">

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>VRM</EnqAttribTypeCode>

<EnqAttribStringValue>ABC12345</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Foreign</EnqAttribTypeCode>

<EnqAttribStringValue>No</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>RHDrive</EnqAttribTypeCode>

<EnqAttribStringValue>Yes</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>TaxDisc</EnqAttribTypeCode>

<EnqAttribStringValue>Unknown</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Type</EnqAttribTypeCode>

<EnqAttribStringValue>Car</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Make</EnqAttribTypeCode>

<EnqAttribStringValue>Audi</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Model</EnqAttribTypeCode>

<EnqAttribStringValue>A3</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

<Dummy_EnquiryAttribute>

<EnqAttribTypeCode>Colour</EnqAttribTypeCode>

<EnqAttribStringValue>Black</EnqAttribStringValue>

</Dummy_EnquiryAttribute>

</ns:Dummy_EnqAttribSet>

This should do the trick

Regards,

Simon

Former Member
0 Kudos

Hi Simon,

Yes this solved the problem!! Thanks a million !!

Funny, the documentation on help.sap.com does not mention this.

Once again, thanks

Regards

Manish

Former Member
0 Kudos

HI simon,

i have similar requirment.

i wanna change E1EDKA1-WE(ship to)

According our business process, i can have two solutions

1) E1EDKA1- WE can be made equal to the values of

E1EDKA1- AG.

2) I can avoid the E1EDKA1-WE segment during the conversion, system will take care by itself in finding the ship to party..

In either case i failed in getting the output .

This process is in ALE ,SAP 4.7, Orders05,Receiving end.

There is no part of XML, its complete SAP- SAP.

Can you please give me some tips for getting this output.

Regards

Message was edited by: Satheesh Mothukuri

Answers (1)

Answers (1)

Former Member

I've been struggeling with the same problem all day, but I have finally found a solution.

The error "The source or target structure has been changed or could not be found in the Integration Repository ...." Occurs when you have more than one subtree mapping of the same structure, and NO MAPPING to the structure itself.

I tried to map a simple constant to the structure itself, and VOILA! now it works.

/ Claus