on 07-16-2020 8:29 AM
Hello experts,
I have created a mapping-scenario where the source fields is once per context filled with data and I want that data in a target field in ten Idocs.
You can see an example in the pictures I added below.
Thanks in advance,
David
The screenshots do not help very much (at least to me) but I would assume
<recordset>
<record>
<data1>a1</data1>
<data2>a2</data2>
<data3>a3</data3>
<!-- more data -->
</record>
<record>
<data1>b1</data1>
<data2>b2</data2>
<data3>b3</data3>
<!-- more data -->
</record>
<!-- more records -->
</recordset
If that's the case I think you wouldn't even need useOneAsMany which Praveen suggested. You could simply map the record to the "multi-root-node" (the one below message node) of multi mapping and then work your way down using one-to-one mapping and using map with default where appropriate. If it is a really deeply nested IDoc you surely must look into useOneAsMany, look at contextes or other "node functions".
Cheers
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jens,
you're right on target with your hunch about the source structure.
The problem is that no source field always contains the same data but different data.
Yes, that is correct again. I want to create a multi-mapping by creating 10 IDocs. The special thing about this is that ten target IDocs are created from seven fields in the source structure. Roughly speaking, each source field creates a target IDoc with many fixed values.
But thank you for your effort.
okay, I get that the real life is more complicated that my example 🙂
Anyways, I'm still not sure where exactly you are stuck. What hinders you to map the <record> node with your <COND_A02> node which by using a multi mapping (message mapping --> signature --> target message --> occurence 0...unbounded) will become 0...unbounded. (Subtext, you don't use "duplicate subtree" then). If you only conditionally need to create an IDoc, say when input recordset has so and so field values, than do so .e.g using createIf.
Also, depending on the complexity of your mapping logic, you might be better of using XSLT, instead of graphical mapping. However, I've never done that with multi mapping, but I'm quite positive it should be possible. Have a look here for example: https://answers.sap.com/answers/13095183/view.html
Cheers
Jens
Hi, Jens,
I have not solved the mapping in this way because different fixed values are to be written to the fields in each IDoc.
Thank you for linking the instructions for XSLT mapping.
PS: After searching for the error in the mapping all morning, it turned out that the source data was incorrect...
But thanks for your help anyway.
Best Regards,
David
Hi David Faßhauer,
Could you please try Node function use-one-asMany.
Hope this helps !
thanks and regards,
Praveen T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen Tirumareddy,
thanks for your help.
I tried the Useoneasmany function, but I can't get the number of times I want to multiply the value from the source structure. Because this structure appears infinitely often and not only ten times as I need it.
You can see more information in the pictures I have attached.pi-problem.png
Thanks and regards,
David F
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.