on 01-31-2014 12:50 PM
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
Hi Amar,
Check the note 1090369.
Regards,
Muni.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.