cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping: Map value from the first element in a context in target el

Former Member
0 Kudos

Hi experts,

I have a problem with a message mapping in XI. I hope you can help me. At first I will give you a source and a target structure. Then I will explain the problem.

<u>Source structure:</u>

<E1EDP01>

<E1EDPT1>

<TDID> ... </TDID>

<E1EDPT2>

<TDLINE> ... </TDLINE>

</E1EDPT2>

</E1EDPT1>

</E1EDP01>

The structure can contain more than one E1EDP01-Elements, more than one E1EDPT1-Elements and more than one E1EDPT2-Elements.

<u>target structure:</u>

<LineItem>

<vendmemo> ... </vendmemo>

</LineItem>

For every E1EDP01-Element my mapping creates one LineItem-Element in the target structure. To fill the element <vendmemo> the mapping should do the following steps:

The mapping should search in E1EDP01 for a E1EDPT1 with the TDID = Z505. And from this E1EDPT1-Element (with the TDID=Z505) the mapping should take the value <TDLINE> from the first E1EDPT2-Element in the context of the E1EDPT1-Element (the E1EDPT1 with the TDID=Z505) and put this value in <vendmemo>.

The mapping should do this action for every E1EDP01 -> so for every LineItem.

I tried it with UDF but I didn't found a solution. Can anybody help me?

best regards

Christopher

View Entire Topic
Former Member
0 Kudos

Hi Christopher,

Try this:

E1EDP01 -


> LineItem.

for vendmemo use 2 UDFs.

TDID----


-


\

TDLINE(Context E1DPT1)----/UDF1--\formatByExample-->UDF2--->vendmemo

E1EDPT1----


/

UDF1 :

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

{

if(a<b>[</b>i<b>]</b>.equals("Z505"))

result.addValue(b<b>[</b>i<b>]</b>);

else

result.addValue("1");

}

UDF2 :

String flag = "false";

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

{

if(a<b>[</b>i<b>]</b> != "1" )

{

result.addValue(a<b>[</b>i<b>]</b>);

break;

}

}

if(flag != "true")

result.addValue(" ");

Thanks,

Maheshwari.

Former Member
0 Kudos

Hi Maheshwari,

thanks for your help. Now the problem is solved and the mapping is working fine.

With best regards

Christopher