ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Internal Tables → Expressions and Functions for Internal Tables → table_exp - Table Expressions → table_exp - itab_line
Table Expressions, Specified Rows
This example demonstrates how the row is specified in table expressions.
Other versions:
7.31 | 7.40 | 7.54
Source Code
TRY.
DATA(out) = cl_demo_output=>new(
)->begin_section(
`Primary index line 1`
)->write(
flight_tab[ 1 ] ).
out->next_section(
`Secondary index CITIES line 1`
)->write(
flight_tab[ KEY cities INDEX 1 ] ).
out->next_section(
`Free key CARRID, CONNID not optimized`
)->write(
flight_tab[ carrid = 'UA'
connid = '0941' ] ) ##primkey[id].
out->next_section(
`Secondary key ID optimized`
)->write(
flight_tab[ KEY id COMPONENTS carrid = 'UA'
connid = '0941' ] ).
out->next_section(
`Secondary key CITIES optimized`
)->write(
flight_tab[ KEY cities cityfrom = 'FRANKFURT'
cityto = 'NEW YORK' ] ).
CATCH cx_sy_itab_line_not_found.
out->write( `Nothing found` ).
ENDTRY.
out->display( ).
Description
Table expressions that specify different rows are used as input parameters of the method WRITE_DATA of the output class CL_DEMO_OUTPUT. The following output is produced:
cities
.
id
.
cities
.