I want to export the report "RM07MLBS" (tcode mb52).
If I call this report via the SAP-GUI it has 18 columns.
If I call the report with the following abap code, then it has only these column:
- maktx, werks, matkl, matnr, name1, mtart
Here the abap code:
FUNCTION /FOO/GET_REPORT_DATA .
cl_salv_bs_runtime_info=>set(
EXPORTING
display = abap_false
metadata = abap_false
data = abap_true
).
SUBMIT (IV_REPORT_NAME)
WITH SELECTION-TABLE selection_table
AND RETURN.
DATA: lo_data TYPE REF TO data.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING
r_data = lo_data
).
IF lo_data IS NOT BOUND.
ev_result_json = '[]'.
EXIT.
ENDIF.
field-SYMBOLS <lv_data> type any table.
ASSIGN lo_data->* TO <lv_data>.
ev_result_json = /ui2/cl_json=>serialize( data = <lv_data> pretty_name = /ui2/cl_json=>pretty_mode-low_case ).
cl_salv_bs_runtime_info=>clear_all( ).
ENDFUNCTION.
How to get all columns?
User JozsefSzikszai gave me the needed hint to solve this.
This way I can read all columns from hierarchical ALV
Feedback and hints how to improve this are welcome.