Posts

Showing posts from May, 2018

Boolean in ABAP

Dealing with two state flags is nothing new and a very common scenario in ABAP development, Historically they have been used to represent a true or false state. For example: Y or N, X or ' ', 0 or 1. Booleans are data objects that store truth values i.e. True or False , which are results of logical expressions. Truth values are the results of logical expressions. A truth value is either true or false. ABAP does not yet support boolean data types and thus does not support data objects for truth values. Therefore, the result of a logical expression cannot be assigned directly to a data object. However, it can be achieved using Boolean functions. It has become common practice to express the truth value "true" as value " X " and the truth value "false" as a blank (" ").  which leads to one of the bad practices still prevalent: Using the Data Type abap_bool for Truth Values The type group ABAP contains a data type abap_bool of elementary type