cancel
Showing results for 
Search instead for 
Did you mean: 

PI7.1

Former Member
0 Kudos

Hi,

I am working on a message mapping.

Its IDoc to EDI message mapping.

There is one target node Root for which the mapping is done this way

E1EDK02-Qualf(Context-IDoc)-FixedValueMapping(for keys 001,002,012)-equalscreateifRoot

(1)

Now to accomodate a few business requirements we splitted the logic by duplicating the Root,that total no Root node =3,one for keys001,002,012,second for001,002,third for 012,but now instead of 3 Root node,6 root nodes are getting created?

Can you please guide me?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

I am not 1005 clear about your requirement.

But try below mapping logic.

Create 3 root nodes at target and write a mapping logic like below.

use same mapping logic but in fix value table remove entries and compare with constant 001 like same way for 2nd root node 002 and 3rd root node 012.

Regards,

Raj

Former Member
0 Kudos

Hi Raja Sekhar,

Thanks for the reply.

My mapping logic is this

E1EDK02-Qualf(Context-IDoc)-FixedValueMapping(for keys 001,002,012)-equals--createif--Root
(1)

How can I implement it without fixed vale mapping?

Can you please help me?

Thanks

Former Member
0 Kudos

> How can I implement it without fixed vale mapping?

Yes

for first node give the map condition like

E1EDK02-QualfEquals(001 and 002 and 012) createiftargetnode(1)

For second node

E1EDK02-QualfEquals(001 and 002) createiftargetnode(2)

For third node

E1EDK02-QualfEquals(012) createiftargetnode(3)

Regards,

VR

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

former_member184681
Active Contributor
0 Kudos

Hi,

total no Root node =3,one for keys001,002,012,second for001,002,third for 012

Look at your mapping again. For key 001, root 1. and 2. are created. For key 002 - roots 1. and 2. And for key 012 - roots 1. and 3. The total is 6 roots You will have to modify the conditions if you require precisely 3 roots (create one root per one key, most probably).

Hope this helps,

Greg

Former Member
0 Kudos

Hi Greg,

Thanks for the reply.

You will have to modify the conditions if you require precisely 3 roots (create one root per one key, most probably)

Can you please tell me how to do it?

Thanks

Former Member
0 Kudos

HI,

Repeat the target node for 3 times.

for first node give the map condition like

E1EDK02-Qualf-FixedMapping-Equals(001 and 002 and 012) createif--targetnode(1)

For second node

E1EDK02-Qualf-FixedMapping-Equals(001 and 002) createif--targetnode(2)

For third node

E1EDK02-Qualf-FixedMapping-Equals(012) createif--targetnode(3)

Regards,

Venkata Ramesh

Former Member
0 Kudos

Hi Venkata,

Thanks for your reply.

Repeat the target node for 3 times.
for first node give the map condition like 
E1EDK02-Qualf-FixedMapping-Equals(001 and 002 and 012) createif--targetnode(1)
For second node
E1EDK02-Qualf-FixedMapping-Equals(001 and 002) createif--targetnode(2)
For third node
E1EDK02-Qualf-FixedMapping-Equals(012) createif--targetnode(3)

What should be the context for the field Qualf?IDoc?

Please help me.

Thanks

former_member184681
Active Contributor
0 Kudos

Dear Gayatri,

The actual mapping depends on your requirement. If you require different mapping rules for each of those three qualifiers, use:

E1EDK02-Qualfequals(001)createif--Root(1)

E1EDK02-Qualfequals(002)createif--Root(2)

E1EDK02-Qualfequals(012)createif--Root(3)

And provide detailed mappings under each node.

But if you want to map all three qualifiers exactly the same way, simply use one target root with:

E1EDK02-Qualf(Context-IDoc)-FixedValueMapping(for keys 001,002,012)-equalscreateifRoot

Hope this helps,

Greg

Former Member
0 Kudos

Hi,

Context should points to Idoc.

If the source field comes 001, 002 and 012 values then first node should populate the target node(1) so

https://picasaweb.google.com/bvramesh2006/February72012#5707050901322065970

For 2nd node use only 001 and 002 condition

for 3rd node use only 012 condition.

Regards,

VR

Former Member
0 Kudos

Hi Venkata,

The url you provided shows does not found error

Can you provide me the other one?

Thanks

Former Member
0 Kudos

Hi Venkata,

Sorry, that page was not found.

Former Member
0 Kudos

Hi Venkata,

Thanks for the reply.

E1EDK02-Qualf--Equals(001 and 002 and 012) createif--targetnode(1)
For second node
E1EDK02-Qualf--Equals(001 and 002) createif--targetnode(2)
For third node
E1EDK02-Qualf--Equals(012) createif--targetnode(3)

But the fixed value mapping has the value 1 for all the keys 001,002,012 and I need to compare the fixed mapping output with the value 1.

How can I achieve it?

Thanks

Former Member
0 Kudos

Hi,

Check this link

https://picasaweb.google.com/bvramesh2006/SDN?authkey=Gv1sRgCP-dmdSu8ZvA5wE#5707050901322065970

> But the fixed value mapping has the value 1 for all the keys 001,002,012 and I need to compare the fixed mapping output with the value 1.

You are checking the values not only for one occurance (chekcing values for next occurancess 001, 002 & 012) so if you use Fixed value then you may use UDF.

Regards,

VR

Former Member
0 Kudos

Hi Venkata,

Can you please provide me the UDF to achieve this?

E1EDK02-Qualf--Equals(001 and 002 and 012) createif--targetnode(1)
For second node
E1EDK02-Qualf--Equals(001 and 002) createif--targetnode(2)
For third node
E1EDK02-Qualf--Equals(012) createif--targetnode(3)


But the fixed value mapping has the value 1 for all the keys 001,002,012 and I need to compare the fixed mapping output with the value 1.

Thanks

Former Member
0 Kudos

Hi,

You need to write 3 udf for this, doing mapping is better than writing UDF.

For first node use this code //These 3 are queue type UDF and input parameter is inputStr

int count=0

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

{

if(inputStr<i>.equals(001))

count ++;

if(inputStr<i>.equals(002))

count ++;

if(inputStr<i>.equals(012))

count ++;

}

if(count==3) result.addValue("");

else result.addValue(ResultList.SUPPRESS);

For second node

int count=0

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

{

if((inputStr<i>.equals(001)) && (!(inputStr<i>.equals(012))))

count ++;

if((inputStr<i>.equals(002)) && (!(inputStr<i>.equals(012))))

count ++;

}

if(count==2) result.addValue("");

else result.addValue(ResultList.SUPPRESS);

For third node use 012 value (remove 001 & 002 conditions)

int count=0

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

{

if((inputStr<i>.equals(012)) && (!(inputStr<i>.equals(001))) && (!(inputStr<i>.equals(002))))

count ++;

}

if(count==1) result.addValue("");

else result.addValue(ResultList.SUPPRESS);

Regards,

VR

Former Member
0 Kudos

Hi Venkata,

These UDFs are not creating the target node itself.

Can you please help me?

Thanks

Former Member
0 Kudos

If the condition is satisfied then only it creates the node

for example take the third UDF for third node

Here if the source value contains 012 then it should creates the target node, if source value doesn't contains 012 then node never creates.