cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue ?

Former Member
0 Kudos

Hi Guys,

I have 2 messages on source side and 1 message on the target side

Source side

Message-1

<node1>

<elment1> 0..1

Message-2

<node2> 0..unbounded

<element2> 0.1

Target side

Message-3

<node3> 0..1

<element3> 1.1

I have mapped

node2>SplitByValue(EachValue)>node3

element1-->element3

I need to make element3 occur under each occurance of node3.

any help would be appreciated

Thanks,

Srini

Edited by: srinivas kapu on Mar 6, 2008 11:07 AM

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Srini,

UseoneAsMany will do the logic.

element1,element2(don't change context), element2 (ChangeContext)->SplitByValue (Each Value)--> element3.

raj

Former Member
0 Kudos

Hi Raj,

I am not all using the element2. I need to map element 1 to element 3 and since the node of element 3 occurs multiple times, i need to make element 3 also occur under each occurance of node3.

Thanks,

Srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

I thought the element2 will always present under node2. That's the reason I suggested you to take element2.

Do u know any element which always present under node2, i'm using it just to make element1 will repeat as many times element2.

raj.

Former Member
0 Kudos

Hi Raj,

The problem solved with your logic,

UseoneAsMany

element1,element2(change context), element2 (dontChangeContext)->SplitByValue (Each Value)--> element3.

Is it always that in UseoneAsMany that the second element should be one level higher than the third element ?

Thanks,

Srini

justin_santhanam
Active Contributor
0 Kudos

Yes Srini.

Former Member
0 Kudos

Thanks Raj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

First you need to change the ocurance of Target fields Node and element to 0-Unbounded and 1-unbounded respectively.

Then just map Node2 ->SplitByValue->Node3

For element field use as below

Element1 ---> FormatByExample ---> SplitByValue -


>Element3

Node2 (2nd parameter)

If this will not work then just create UDF with cache paramter Queue and paste below code

Pass input values as

Node2--->A

element1--->B

//Write your code

for(int i=0; i<A.length;i++)

result.addValue(B[0]);

Thanks

Swarup

Former Member
0 Kudos

Hi Swarup,

I tried

Element 1 - FormatByExample - SplitByValue - Element 3

Node 2

I got the exception

The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Function formatByExample: Queues have not equal number of values.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method formatByExample[, ] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/ns2:ClearingHousePaymentOrderConfirmation/ClearingHousePaymentOrder/Settlement/ResultDescription. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Function formatByExample: Queues have not equal number of values.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method formatByExample[, ] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:284)

I need to try the UDF

Thanks,

Srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

You can't use FormatByExample , for ur case. You need to use only UseoneAsMany.

raj.

Former Member
0 Kudos

Ohh this exception have raised due to the occurance of Element1 and Node2 are not same.

You have to go for UDF.

Try it out and let me know

Thanks

Swarup

Former Member
0 Kudos

Hi Swarup,

For the node function FormatByExample, does the occurance of the first parameter and second parameter should be the same ?

can you explain more on this function when we use this ?

Thanks,

Srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

As I said earlier, in your case we can't apply FormatByExample. If you want to know the exact usage of FormatByExample, then refer the below links

http://www.flickr.com/photos/8764045@N06/2264815255/sizes/o/

http://www.flickr.com/photos/8764045@N06/2264815257/sizes/o/

In the link Just go thru the logic applied for Date field, it will give u clear picture.

raj.