ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Predicates →  rel_exp - Predicate Functions →  Predicate Functions for Table-Like Arguments → 

rel_exp - line_exists, Predicate Function

Syntax

... line_exists( table_exp ) ...

Effect

The predicate function line_exists checks whether the row of an internal table specified in the table expression table_exp exists and returns the appropriate logical value. Alongside single table expressions, table_exp can also handle chainings, whose result is a row of an internal table.

Within line_exists, an explicitly specified table key in the table row table_line of the table expression is handled in the same way as a free search key specified for this table key.

Notes

Example

DATA flight_tab TYPE HASHED TABLE OF spfli
                     WITH UNIQUE KEY carrid connid.

SELECT *
       FROM spfli
       INTO TABLE flight_tab.

IF line_exists( flight_tab[ carrid = 'LH'
                            connid = '0400' ] ).
  ...
ENDIF.