I found a solution here which I try to apply.
cl_salv_bs_runtime_info=>set(
EXPORTING
display = abap_false
metadata = abap_false
data = abap_true
).
SUBMIT ('RM07MLBS')
AND RETURN.
DATA: lt_outtab TYPE STANDARD TABLE OF alv_t_t2.
FIELD-SYMBOLS: <lt_outtab> like lt_outtab.
DATA lo_data TYPE REF TO data.
TRY.
" get data from SALV model"
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING
r_data = lo_data
).
ASSIGN lo_data->* to <lt_outtab>.
BREAK-POINT.
CATCH cx_salv_bs_sc_runtime_info.
ENDTRY.
Source: http://zevolving.com/2015/07/salv-table-22-get-data-directly-after-submit/
But this does not work. I get a type mismatch error in this line:
ASSIGN lo_data->* to <lt_outtab>.
What could be wrong?
Is there a way to do this generic? At runtime I don't know which report is to be called.
My overall goal is to get the report in XML or JSON format.