cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with mapping

Former Member
0 Kudos

Source

Message		1..1
   MessageDataType  1..1
      messageId   xsd:string
   Datatype2Node  1..1
      objectId    xsd:string
      Datatype3Node  0..n
         symbol      xsd:string

Destination

Messages        1..1
   Message1     1..1
     Datatype4Message 0..n (datatype4)
	Datatype3Node 1..1 (the same type as datatype3Node)	
          Symbol   xsd:string
        AdditionalNode 1..1 (of some other Datatype5)
          messageId   xsd:string
	  objectId    xsd:string

Datatype4 is build as two fields of type Datatype3/Datatype5 - both 1..1

Fields are mapped like names suggest, node Datatype3Node is mapped to Datatype3Node.

When there is only one record in node Datatype3Node (source) everything works ok.

When I try tu test it with 2 records I get "Cannot create target element" error for AdditionaNode and it's subelements.

When I map constants to AdditionaNode and it's subelements - works ok for multiple source elements.

How to "multiply" those 1..1 source elements to correctly satisfy target mapping?

TIA

Best regards

Maciej

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I've managed to solve this in way described in this blog:

http://sapxitutorials.blogspot.com/2009/07/minimize-memory-usage-during-message.html

Thanks for any support

Regards

Maciej

Former Member
0 Kudos

try to map like this :

Datatype3Node 0..n -


map------ > Datatype4Message 0..n (datatype4)

then try to map fields of Src Datatype3Node to respective filed of Dest. Datatype3Node & AdditionalNode

Former Member
0 Kudos

> Datatype3Node 1..1 (the same type as datatype3Node)

Change the occurrance of Datatype3Node as 0..unbounded, then it will work.

Do same with AdditionalNode.

stefan_grube
Active Contributor
0 Kudos

> How to "multiply" those 1..1 source elements to correctly satisfy target mapping?

If a source value comes exactly one time, then you can use constant function "copyValue" to multiply it to target.