cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping - Create Targetnode and assign Values to Element

tharaka_fernando
Contributor
0 Kudos

Dear All experts,

I need your help on solving below issue in graphical mapping.

Below is the Source Structure

Target Structure

Assort and PackItem can repeat multiple times as mentioned in the occurrence.

At a particular instance If AssortNo is equal to Number in PackItem and at the same time Reference type is equal to "UserD4" and RefValue of that node is equal to Size;

(IF Assort - AssortNo == PackItem-Numer   AND reference-RefValue == Size where Reference-type = "UserD4")

then Create EDL4.

map Number with EDL4-VEBLN.

Thanking you all in advance...

Accepted Solutions (0)

Answers (3)

Answers (3)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Fernando,

You can use CREATEIF node function to create the node based on your condition.

For the field under the node, you can just map with the source required field.

Then, if the condition satisfies, the node will get created and the field will get populated and passed to the Receiver in the message as needed.

Regards

Vishnu

tharaka_fernando
Contributor
0 Kudos

Dear All,

Thank you..

I understand that I need to use CREATE IF function node for this.But I'm bit confused on building the conditions before the CREATE IF function.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Fernando,

Use AND BOOLEAN function, the input arguments to AND function are  reference-RefValue == Size(Use equals string function for this) & Reference-type = "UserD4"(Use equals string function for this)

Use Another AND function, the arguments for this are Assort - AssortNo == PackItem-Numer(Use equals string function for this) and the output of the above AND function.

Pass the output of this AND function to the CreateIf node function and the output of this to the target Node EDL4.

Regards

Vishnu

shivdutt
Explorer
0 Kudos

Hi Fernando,

You can try using the code provided by in an UDF, instead of result.addValue(Number[j]);

use result.addValue("true");

give the output of this UDF to CreateIf, and then to the target.

Thanks

Shivdutt

tharaka_fernando
Contributor
0 Kudos

Thank you all for the replies..

But none of these work for the requirement...any Graphical mapping display example or else UDF function code as Hareesh replies would be highly appreciated

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Fernando,

Please find below the Mapping screenshot:

For target node

For its field VEBLN, you can map accordingly to the source field.

Check this and let me know if you struck anywhere.

Regards

Vishnu

former_member184720
Active Contributor
0 Kudos

Try something like this..

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

{

for(int j=0;j<Number.length;j++)

{

if(assortno[i].equals(Number[j]))

{

for(int k=0;k<rtype.length;k++)

{

if(rtype[k].equals(size[j]) && refvalue[k].equals("UserD4"))

{

result.addValue(Number[j]);

}

}

}

}

}

}

P.S. I don't have a system to test/to check for syntax. So make changes if there are any.

It's not a good practice to have too many for loops, so if you always have only one reference with refvalue"UserD4" then use "if without else" function and then pass it to UDF.

shivdutt
Explorer
0 Kudos

Hi,

Try using create if node function after you put all the conditions, then it should work.

Thanks