cancel
Showing results for 
Search instead for 
Did you mean: 

mapping question

Former Member
0 Kudos

Hi friends,

can anyone help me on this?

Needed output structure is:

<root>

<ORG1000>true</ORG1000>   if orgid 1000 exist

<ORG2000>true</ORG2000>  if orgid 2000 exist

</root>

<root>

<ORG1000>true</ORG1000>

<ORG2000>false</ORG2000>         if orgid is not 2000

</root>

input structure is like:

<E1MVKEM>
<MSGFN>005</MSGFN>
<VKORG>2000</VKORG>
</E1MVKEM>

<E1MVKEM>
<MSGFN>005</MSGFN>
<VKORG>2000</VKORG>
</E1MVKEM>

<E1MVKEM>
<MSGFN>005</MSGFN>
<VKORG>1000</VKORG>
</E1MVKEM>

it seems easy but i got for below input message always

<root>

<ORG1000>false</ORG1000>

<ORG2000>true</ORG2000> 

</root>

thank you for your help.

PM

Accepted Solutions (0)

Answers (2)

Answers (2)

r_s_kulkarni11
Participant
0 Kudos

Hello Peter,

As you stated the scenario, Which is having some what ambigous relattion.Because in first case you are saying that

Needed output structure is:

<root>

<ORG1000>true</ORG1000>   if orgid 1000 exist

<ORG2000>true</ORG2000>  if orgid 2000 exist

</root>

Bus as you are sending either 1000 or 2000 from source message how we can get both as true?

Either of one can be true only.

Former Member
0 Kudos

Hello,

Try using this UDF

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

{

if(var1[i].equals("1000"))

{

result.addValue ("true");

break;

}

}

Ur mapping will be:

VKORG--RC--UDF--ORG1000

In a similar way use the code for orgid :2000

ur mapping output will be:

<root>

<ORG1000>true</ORG1000>

<ORG2000>true</ORG2000> 

</root>

Thanks

Amit Srivastava