It has become common practice to express the truth value “true” as value “X” and the truth value “false” as a blank (” “).
To make it easier to handle truth values expressed in this way, the TYPE GROUP abap contains a data type abap_bool of elementary type c with length 1, and the constants
- abap_true of value “X”
- abap_false of value ” “
- abap_undefined of value “-“
When working explicitly with truth values, use the type abap_bool as a substitute for a real boolean data type.
Writing your code this way will make it easy to understand and maintain.
Here is an example of Good and Bad ABAP Coding practice.
Bad example
Good example
The following source code shows the recommended way to write your program using of the boolean data.
This tutorial is very helpful if you really want to learn about abap….
Hi,
Thanks for the tips.
I got an error : abap_bool undefined :
TYPE-POOLS ABAP.
FIND LIKE ABAP_BOOL.
Can you help me ? Thanks !
It’s OK : I use LIKE instead of TYPE ! my bad, thanks for the tutorial !
thank you linkin, Your blog used in emergency situation
thank you
IF cl_sd_bill_switch_check=>sd_sfws_mev_01( ) = abap_true AND
cl_sd_doc_category_util=>is_bill_period_end( tvfk-vbtyp ) = abap_true.
here im getting error…
can u plz