REPORT z_table_to_html.
TRY.
SELECT * FROM sflight INTO TABLE @DATA(flights) UP TO 100 ROWS.
cl_demo_output=>write_data( flights ).
DATA(lv_html) = cl_demo_output=>get( ).
cl_abap_browser=>show_html( title = 'Flights'
html_string = lv_html
container = cl_gui_container=>default_screen ).
" force cl_gui_container=>default_screen
WRITE: space.
CATCH cx_root INTO DATA(e).
WRITE: / e->get_text( ).
ENDTRY.
Tag: cl_demo_output
[ABAP] CL_DEMO_OUTPUT
cl_demo_output=>new( )->write_data( lt_display_data )->display( ).
*or
cl_demo_output=>display( lt_display_data ).