cancel
Showing results for 
Search instead for 
Did you mean: 

graphical mapping if else condition

Former Member
0 Kudos

Hi Friends,

What is the different between if and IFs in graphical mapping? I have a requirement where I have 3 source fields Src1 , Src2 , Src3. Target field Trg1.

I need to check if Src1 ( String) is not empty then trg1 = Src1 else if Src2 is not empty then Trg1 = Src2 else if Src3 is not empty then Trg1 = Src3.

How can I acheive the above ? Please advice.

Thanks,

Teresa

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

Use the mapping as below:

http://img205.imageshack.us/img205/3408/mappingexample.png

You can use different function instead of exists() if required (for example if you value always exists, but sometimes is empty, then use equals empty). And of course use your own fields instead of Name1,2,3.

Hope you'll find this useful,

Greg

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Please refer this thread

Former Member
0 Kudos

Hi,

The difference between IF and IFs is that IFs works like an if statement. that means that first the condition is evaluated and based on that either the IF or the ELSE branch is evaluated.

In the case of IF all the branches get evaluated.

In your case you can safely use any of the two blocks.

Regards,

Horia

Former Member
0 Kudos

chk this:

http://forums.sdn.sap.com/thread.jspa?threadID=1984292

whats the output in case when all the input fields dont have any value??

chk this UDF :


if(a.length()>0)
{
return a;
}
else if (b.length()>0)
{
return b;
}
else if(c.length()>0)
{
return c;
}
else
{
return "No combination exist";
}

Edited by: AmitSri on Jan 23, 2012 5:40 PM

Former Member
0 Kudos

Hi Teresa,

By using SDN search button with "IFS", in less 2 min, you should find by yourself the answer.

[Oss notes 1158484 - FAQ about If - IfS and IfWithoutElse/IfWithoutElse|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_xi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31313538343834%7d]. (SDN link, not service market place)

Mickael