我有一个ABAP程序,该程序调用报告并将其输出转换为JSON。
不幸的是,这不适用于SAP Queries(参见相关问题:Result of SAP Query can't be extracted with r_data_line_descr of cl_salv_bs_runtime_info=>get_data_ref())。
如何检测报告是否为SAP查询?
我将报告的名称作为字符串。
例如:AQZZZMM=========ZME80FN=======
到目前为止,我这样称呼报告:
SUBMIT (IV_REPORT_NAME)
WITH SELECTION-TABLE selection_table
AND RETURN.
答案 0 :(得分:6)
You can use the function module RSAQ_DECODE_REPORT_NAME
, as in the following test report.
report zz_test_query_report.
parameters: p_repid type repid.
call function 'RSAQ_DECODE_REPORT_NAME'
exporting
reportname = p_repid
exceptions
no_query_report = 1.
if sy-subrc eq 0.
write: / p_repid, 'is a query report'.
else.
write: / p_repid, 'is not a query report'.
endif.