cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

Hi,

Using Fix values function we can pass some values like

if field1 = a then field1 =1

if field2= a then field1 =2

if field2 = a then field1 =3

if field3 = a then field1 =4

do we have a mapping function to do:-

if field1 =a and field 1= 1 then field1 =a1

if field1=b and field1=2 then field1 =b2

Jeff

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Jeff--

For one, "if field1 =a and field 1= 1 then field1 =a1" will always evaluate to false, if you think about it for a second :-)...

Two options depending on what you want to do, since the example is a bit ambiguous.

Option #1: Use the concatenate block to concatenate the values into your output (and use no fixed-mapping at all).

Option #2: Concatenate the input values, and feed the concatenated input to the fixed-mapping. I like using the pipe symbol "|" because it causes less visual confusion than commas (which look like periods and often appear in common numeric values that may need to be mapped, particularly in Europe).

Example:

Concatenate field1 & field2 = "a|1"

(Note that this only takes 1 concat block; double click on the block to put in the delimiter character)

Fixed-value map if input='a|1' then field1=a1

if input='b|2' then field1=b2

--Dan King

SAP NetWeaver Integration Architect

Capgemini

former_member214364
Active Contributor
0 Kudos

Hi Jeff,

>>do we have a mapping function to do:-

if field1 =a and field 1= 1 then field1 =a1

if field1=b and field1=2 then field1 =b2

we dont have any Standard Mapping function, which does the above mapping.

you need to go for UDF.

Cheers,

Jag

Former Member
0 Kudos

sorry there was a mistake in my post

Hi,

Using Fix values function we can pass some values like

if field1 = a then field1 =1

if field1= a then field1 =2

if field1 = a then field1 =3

if field1 = a then field1 =4

do we have a mapping function to do:-

if field1 =a and field 1= 1 then field1 =a1

if field1=b and field1=2 then field1 =b2

Jeff

Former Member
0 Kudos

Hi,

Using Fix values function we can pass some values like

if field1 = a then field1 =1

if field2= b then field1 =2

if field2 = c then field1 =3

if field3 = d then field1 =4

do we have a mapping function to do:-

if field1 =a and field 1= 1 then field1 =a1

if field1=b and field1=2 then field1 =b2

Jeff

henrique_pinto
Active Contributor
0 Kudos

How can you have field1 assume different values? Is it unbounded?

Regards,

Henrique.

Former Member
0 Kudos

Hi Jeff,

no we can not do UDF to solve this purpose.But solve by this way....

/********UDF********/

if(field1.equals(a) || field1.equals("1")){

field1 =a1;

}

return(field1);

Assume field1 is String.

Cheers!

Samarjit