SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Internal Tables → Expressions and Functions for Internal Tables → Table Functions →line_index - Index Function
Syntax
... line_index( table_exp ) ...
The table function line_index returns the number of the row found using the table expression table_exp with respect to the table index used. The return value has the type i.
The row itab_line found using the table expression must be defined by specifying a key. An index cannot be specified. Alongside single table expressions, table_exp can also handle chainings, whose result is a row of an internal table (i.e. they are closed using pointed brackets). The result always refers to the row specified in the final pointed bracket and the key read restrictions applies only to this pointed bracket.
Within line_index, 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.
The table index used makes reference to the specified key as follows:
If the row in question is not found, no exception is raised. The value 0 is returned instead. In the case of chainings, of table expressions, the first unsuccessful from the left produces this value.
Notes
Example
See Internal Tables, Index Function
Example
The index function can be used on chain expressions as follows, where the nested internal table accessed is taken from the example for Chainings with Table Expressions. The first read returns the value 1 for the first row of the innermost table. The second read returns the value 0, since there is no row available for the index read on the outermost table.