rt_bool = boolc( iv_bool <> abap_true ).
will flip a boolean. However, it wouldn't deal with abap_undefined.
From 740 SP08 onwards, you can use xsdbool( )
instead of boolc( )
to achieve the same result. There is no difference for the example given, but xsdbool( )
is safer when using in comparisons