Friday, November 17, 2017

Predicates In ABAP

Expression is something that has a result.

Relational expression is an expression whose result is truth value (true or false).

Other expressions are declaration, logical, constructor, table and calculation.

Relational expression can have comparison expression and predicates.

Comparison expression has joins operands using comparison operator.

Predicate qualifies an operand. Predicate operator is "IS".

This is implementing in ABAP using predicate expression, predicate function and predicate method calls.

Predicate expression examples:

1. variable IS NOT INITIAL

2. methodcall( ) IS NOT INITIAL

3. methodcall( ) IS INITIAL

As of ABAP 740 SP08, point 2 above can be written in short form.

IF methodcall( ).

<logic>

ENDIF.

No comments: