Preferred Boolean type for ABAP Development

According to rule 6.11 of the Official ABAP Programming Guidelines, you should use abap_bool.

Rule 6.11: Use the abap_bool Data Type for Truth Values

To explicitly handle truth values, use the abap_bool type as a workaround for a real Boolean data type. A data object that is declared in this way is not supposed to contain other values than the corresponding constants, abap_true and abap_false (as well as abap_undefined).


I use the type pool ABAP and its constants in coding. It should always be available, though you may have to include it manually on older systems. For dictionary elements, I prefer to create my own data elements using any of the default domains so that I can add descriptions to suit my needs. You can use WDY_BOOLEAN as well.

Tags:

Abap