Is it possible to make a READ TABLE
in ABAP to read more than one line?
Is it possible to make a READ TABLE
in ABAP to read more than one line?
You can not do it directly, you have to use a loop. Example of documentation :
DATA itab TYPE STANDARD TABLE OF i
WITH EMPTY KEY
WITH NON-UNIQUE SORTED KEY sort_key COMPONENTS table_line.
itab = VALUE #( ( 2 ) ( 5 ) ( 1 ) ( 3 ) ( 4 ) ).
DATA(output) = ''.
DATA(idx) = lines( itab ).
WHILE idx > 0.
READ TABLE itab INDEX idx USING KEY sort_key
ASSIGNING FIELD-SYMBOL(<fs>).
idx = idx - 1.
CHECK <fs> > 2.
output = output && <fs> && ' '.
ENDWHILE.
cl_demo_output=>display( output ).