cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping of Recursive Source Structure?

Former Member
0 Kudos

Hello,

a mapping needs to be implemented from a custom source structure to an IDoc. An XSD has been provided for the source structures which contains recursive elements --> an element of a specific type contains another element with the same type.

If I import the XSD then the type of the recursive element is displayed in "red", but I still can expand it. If I want to use the source structure in the message mapping I cannot expand the recursive elements anymore. Does anyone of you have an idea how to handle this? I want to avoid XSLT if possible.

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Florian,

if you know the depth of the recursive node and if it is constant for all messages you can use message mapping. In this case you can right-click on the recursive node in the target message in order to expand the recursive structure until the desired depth is reached.

If the depth is changing per message, I recommend using XSL to process the recursive structure.

Regards, Martin

Former Member
0 Kudos

Hello,

thank you for your advice! Actually the recursive nodes are in the source structure. Depth in the sent message is known, but not limited in the XSD itself. However it is not possible to expand the nodes in message mapping with a right-click.

Changing the XSD and giving the nodes unique names is not an option as it is a standard XSD. It has to be recursive as depth of nodes is not limited in the XSD.

Former Member
0 Kudos

Hi again Florian,

please have a look at [Structure Overview in Message Mappings on SAP help|http://help.sap.com/saphelp_nwpi71/helpdata/en/e3/92be7c6cd34fd485c967144e302fb6/content.htm]. There is a paragraph on Recursive Structures:

...It is possible to map these elements in the mapping editor in a rudimentary fashion by using the context menu to expand a specific number of subnodes and then use them in target-field mappings...

That works for both source and target message.

Former Member
0 Kudos

Hello,

great! I had a look again and this time it worked and the mapping test was successful too. Many thanks --> 10 points!

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

you need to change XSD and make sure that all segment have unique name .