SAP LOGEXP INITIAL



Get Example source ABAP code based on a different SAP table
  


• IS INITIAL ABAP_RELAT_EXPR
• IS NOT INITIAL ABAP_RELAT_EXPR

ABAP_RELEXP - IS INITIAL

ABAP_SYNTAX
ABAP_KEY ... operand IS $[NOT$] INITIAL ...

What does it do?
This predicate expression checks whether the operand operand is initial. The expression is true, if the operand contains its type-dependent initial value. Any data objects can be specified for operand. This is an extended functional operand position in which, in addition to functional method calls, constructor expressions, or table expressions, certain built-in functions can also be specified.
With the addition NOT, the expression is true if the operand contains a value other than its type-dependent initial value



Latest notes:

The expression IS $[NOT$] INITIAL is suitable for checking the type-dependent initial value regardless of its actual data type, instead of comparing it with a type-compliant operand that contains the initial value.
If a functional method call is specified as operand, a potential short form of the following: ... operand IS NOT INITIAL ... is a predicative method call.
The fact that built-in functions or expressions can be specified as operands should not always be exploited, e.g.:
It is better to use str IS INITIAL or itab IS INITIAL instead of strlen( str ) IS INITIAL or lines( itab ) IS INITIAL.
It is better to use the predicate function matches instead of match( ... ) IS INITIAL.
It is better to evaluate the arguments of the constructor expression instead of VALUE type( ... ) IS INITIAL.
An enumerated object can be specified for operand. The initial value is checked in accordance with its base type.
Calculation expressions cannot be specified for operand.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
The logical expression in the IF statement is true if the internal table in the SELECT statement was filled with lines. DATA spfli_tab TYPE TABLE OF spfli.
...
CLEAR spfli_tab.
SELECT *
FROM spfli
WHERE ...
INTO TABLE @spfli_tab.

IF spfli_tab IS NOT INITIAL.
...
ENDIF.
ABAP_EXAMPLE_END