sap - Cleanest way to flip a Boolean -


Are there any current methods or function modules that flip the boolean values ​​efficiently?

I have come up with a simple implementation that should define my utility method, but I am thinking that this is the most efficient approach:

  IF iv_bool = Abap_true Rt_bool = abap_false ELSEIF iv_bool = abap_false rt_bool = abap_true Other Rt_bool = abap_undefined if end.   

Edit: As described by Smigs, this implementation flips three valuable booleans or "trileans"

  rt_bool = boolc (iv_bool )   

However a Boolean will flip, it will not deal with abap_undefined.

From 740 SP08, you can use the xsdbool () instead of boolc () to get the same result given examples There is no difference to, but xsdbool () is

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -