well done! BUT I could make it work without an internal table:
DATA: l_stmt TYPE string, l_stmt_ref TYPE REF TO cl_sql_statement, l_res_ref TYPE REF TO cl_sql_result_set, lr_count TYPE REF TO data, l_count TYPE i. DATA go_conn TYPE REF TO cl_sql_connection. CREATE OBJECT go_conn. * create a statement object l_stmt_ref = go_conn->create_statement( ). l_stmt = 'select count(*) from t000'. l_res_ref = l_stmt_ref->execute_query( l_stmt ). * set output variables GET REFERENCE OF l_count INTO lr_count. l_res_ref->set_param( lr_count ). WRITE : / l_count. " always zero * read first result line l_res_ref->next( ). WRITE : / l_count. l_res_ref->close( ).