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.