ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Streaming →  Streaming for Data Objects → 

Streaming for internal tables

The specific classes for streaming for internal tables are: CL_ABAP_ITAB_C_READER

These classes are subclasses of the abstract superclasses CL_ABAP_MEMORY_....

Example

Uses a reader stream to read an internal table.

DATA:  itab TYPE TABLE OF string,
       text TYPE string.

DATA itab_reader TYPE REF TO if_abap_c_reader.

APPEND `abc` TO itab.
APPEND `def` TO itab.
APPEND `ghi` TO itab.

CREATE OBJECT itab_reader TYPE cl_abap_itab_c_reader
  EXPORTING
    itab = itab.

WHILE itab_reader->data_available( ) = 'X'.
  text = itab_reader->read( 3 ).
  cl_demo_output=>write_text( text ).
ENDWHILE.
itab_reader->close( ).

cl_demo_output=>display( ).