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

时间:2019-04-30 16:42:16

标签: sap abap

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

以下指令不会提取输出:

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

2 个答案:

答案 0 :(得分:0)

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表

答案 1 :(得分:0)

对我来说,这段代码有效:

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

TYPES: BEGIN OF tt,
        line(202),
       END OF tt.

DATA: xlist TYPE abaplist OCCURS 0 WITH HEADER LINE.
DATA: xtext TYPE tt OCCURS 0 WITH HEADER LINE.

ls_seltab-selname = 'BERDATUM'.          " Name of parameter on submitted program
ls_seltab-kind    = 'S'.
ls_seltab-sign    = 'I'.
ls_seltab-option  = 'EQ'.
ls_seltab-low     = '20061231'.
APPEND ls_seltab TO lt_seltab.

ls_seltab-selname = 'BUKRS'.
ls_seltab-kind    = 'S'.
ls_seltab-sign    = 'I'.
ls_seltab-option  = 'EQ'.
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
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.

CALL FUNCTION 'LIST_TO_TXT'
  EXPORTING
    list_index         = -1
  TABLES
    listtxt            = xtext
    listobject         = xlist
  EXCEPTIONS
    empty_list         = 1
    list_index_invalid = 2
    OTHERS             = 3.

enter image description here

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

当然,您将不得不进行一些额外的解析,才能将这些结果转换为易于理解的形式。