如何提取被调用程序 RAZUGA01 的输出

How to extract the output of called program RAZUGA01

我的自定义报告必须调用标准报告 RAZUGA01 并提取其输出(以获取金额)。

以下指令不提取输出:

  SUBMIT razuga01
    WITH SELECTION-TABLE it_selection
    EXPORTING LIST TO MEMORY
    AND RETURN.
cl_salv_bs_runtime_info=>set( exporting display  = abap_false metadata = abap_false   data = abap_true ).
submit razuga01
    with #Here you parameters from selection screen
    and return.
try.
  "Get data from SALV model
  cl_salv_bs_runtime_info=>get_data_ref( importing r_data = lo_data ).
  assign lo_data->* to <outtab>.
  catch cx_salv_bs_sc_runtime_info.
endtry.
cl_salv_bs_runtime_info=>clear_all( ). 

尝试使用此代码,您将能够从标准报告

中获取 ALV table

对我来说这段代码有效:

DATA: lt_seltab  TYPE TABLE OF rsparams,
      ls_seltab  LIKE LINE OF lt_seltab,
      t_list     TYPE TABLE OF abaplist.

DATA: xlist TYPE TABLE OF abaplist.
DATA: xtext TYPE TABLE OF char200.

ls_seltab-kind    = 'S'.
ls_seltab-sign    = 'I'.
ls_seltab-option  = 'EQ'.

ls_seltab-selname = 'BERDATUM'.          " Name of parameter on submitted program
ls_seltab-low     = '20061231'.
APPEND ls_seltab TO lt_seltab.

ls_seltab-selname = 'BUKRS'.
ls_seltab-low     = '0005'.
APPEND ls_seltab TO lt_seltab.

SUBMIT razuga01 WITH SELECTION-TABLE lt_seltab EXPORTING LIST TO MEMORY AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = xlist.

CALL FUNCTION 'LIST_TO_TXT'
  EXPORTING
    list_index         = -1
  TABLES
    listtxt            = xtext
    listobject         = xlist.

如果它对您不起作用,可能是您在 seltab 中设置了一些错误的参数。

当然,您必须进行一些额外的解析才能将这些结果转换为人类可读的形式。