cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Boolean Functions

Former Member
0 Kudos

Hi Experts,

I want the know difference between these two standard boolean functions in graphical message mapping.

IFS and IF.

I m not able to see any difference while using them.

Thanks

Regards,

Amarnath

Accepted Solutions (1)

Accepted Solutions (1)

Muniyappan
Active Contributor
0 Kudos

Hi Amar,

Check the note 1090369.

Regards,

Muni.

Former Member
0 Kudos

Hi Muniyappan.

Thanks for the info.

But with this note, I'm not able to understand it clearly.

If this is clear to you, Can you please explain me with an example where and when these can be used? what impact does one have on another in terms of functionality.?

Thanks

Regards,

Amarnath

Muniyappan
Active Contributor
0 Kudos

Hi Amar,

let us consider a scenario. say you have value A and two udfs. if A equals to 5, execute first udf. else second udf.

do remember here udf execution type should be "All values of queue or All values of context".

for understanding, in second udf i will put some expression like int i = 5/0. so whenever this udf is called it will throw ArithmeticException (Java Platform SE 7 ).

1. using ifs

pass   A= 5.

as per this condition first udf should be executed let us say "UDFA". we don't want UDFB to be executed. but look here what happens.

result:

you would be thinking that UDFA will be called and UDFB will not be called. but in this case it does not matter if it satisfies the condition or not it will execute both the udfs. hence error.

2. using if

for the same input use if function and see what happens.

now go back to sap note read the description. you will understand.

still if you have any doubts please let us know.

Regards,

Muni.

Muniyappan
Active Contributor
0 Kudos

Hi Amar,

did you understand?

please let us know if you have any doubts.

Regards,

Muni

Former Member
0 Kudos

Hi Muni,

Good explanation...keep it up

Regards,

Mastan vali

Muniyappan
Active Contributor
0 Kudos

Thanks mastan

Regards,

Muni.

Former Member
0 Kudos

Thanks Muniyappan...very thorough explanation...Sorry for the delay in responding to this as i have seen this today itself..It is now very clear of  the difference between the two. In most cases while using only  UDFs , it makes the difference otherwise there is no concrete difference between them to say the least.

Thanks

Regards,

Amarnath

Answers (1)

Answers (1)

rhviana
Active Contributor
0 Kudos

Also, check this link below Amar,

Regards,

Former Member
0 Kudos

Nice one , thanks Muni.

@Ricardo, thanks for the link.

that link says :


That is, all arguments are evaluated first,

then value of one of them is returned.

To minimize compatibility problems with old usages,

the function makes one exception to this rule:

in case when evaluating one of the branches throws an Exception,

the function ignores it,

if the exception is in the branch that is not selected by condition

In the above example of Ifs , the exception will not be thrown, as the conditional output is UDFA.

Best Regards

Divyesh Vasani