cancel
Showing results for 
Search instead for 
Did you mean: 

mapping - if

Former Member
0 Kudos

Hi,

How to do mapping for following:

If input element = A then send output as NT or

element = B then send output message as ST or

element = C then send output message as CT

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use Fixed Values Function from Standard Function

Input field-Fixed Values--Target Field

double click on Fixed values and define your rules for sourece value and target value

REgards

Former Member
0 Kudos

but I have to check input xml field values and need to update output element accordingly.

Former Member
0 Kudos

Hi,

Input fieldFixedValues-Target field

inside Fixed values, mention your source field values and in target field enter the value that you are expecting

Regards

Edited by: Vamsi Krishna on Oct 13, 2009 5:56 PM

Former Member
0 Kudos

but I have to check input xml field values and need to update output element accordingly.

If you are looking at one input that you want to compare against a list of values, I agree that the FixValues function will do the trick. It is like a "CASE" statement or "SWITCH" in other programming languages. It also provides a default value in case no match is made.

Your example looks like

If input element = A then send output as NT or

element = B then send output message as ST or

element = C then send output message as CT

which implies you are testing the same input element against a list of values A, B, C and then outputing corresponding matched value of NT, ST, or CT.

Former Member
0 Kudos

Also, this Wiki article might help you if you decide to go the UDF route:

[Wiki artilce for enhanced UDF IF statement|http://wiki.sdn.sap.com/wiki/display/Snippets/XI%28PI%29UDFtoovercomethelimitationoftheStandardBoolean%27IF%27+Function]

Former Member
0 Kudos

Hello Anitha, did we help you or are you still looking for help with this?

Answers (2)

Answers (2)

former_member187339
Active Contributor
0 Kudos

Hi Anitha,

You are saying your field names are A, B, and C and at a time any one of them will come and based on that you nee to map NT, ST or CT to output field?

Then use the node function exists and check which field is there then you can use if then else

Regards

Suraj

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

use if then else function in Grapphical mapping its very easy.

or write simple udf

pass element as argument

If(Arg1=="a")

{ return NT;

}

if(Arg1="b")

{

return ST;

}

else

retrun CT;

Cheers,

Raj