ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  Logical Functions → 

boolc, boolx - Boolean Functions

The arguments of Boolean functions are logical expressions. The return value of a Boolean function expresses the truth value of the logical expression.

Syntax Forms

1. ... boolc( log_exp ) ...

2. ... boolx( bool = log_exp bit = bit ) ...

Effect

The functions determine the truth value of the logical expression log_exp. For log_exp, any logical expression can be specified in accordance with the applicable rules.

The return value is as follows:

Notes

Example

The value 0, 1, or 2 is assigned to the variable bool_value, depending on the result of the logical expressions log_exp1 and log_exp2.

DATA bool_value TYPE i.

bool_value = strlen( condense( val = boolc( log_exp1 ) ) ) +
             strlen( condense( val = boolc( log_exp2 ) ) ).

Example

Calls a method, where the input parameter no_dialog is supplied with the character-like representation of the results of a predicate expression.

PARAMETERS word TYPE c length 30.
DATA result_tab TYPE cl_abap_docu=>search_results.

cl_abap_docu=>start(
  EXPORTING word           = word
            no_dialog      = boolc( sy-batch IS NOT INITIAL )
  IMPORTING search_results = result_tab ).