-1

My custom report has to call the standard report RAZUGA01 and extract its output (to get the amounts).

The following instruction does not extract the output:

  SUBMIT razuga01
    WITH SELECTION-TABLE it_selection
    EXPORTING LIST TO MEMORY
    AND RETURN.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
stella
  • 51
  • 2
  • 5
  • 13
  • 3
    did you call function module LIST_FROM_MEMORY to get the output? Can you show us your code (more than just that one line)? – Dirk Trilsbeek May 01 '19 at 07:28
  • Thank's @Dirik. Next I have CALL FUNCTION 'LIST_FROM_MEMORY but I have Exceptions 1. – stella May 02 '19 at 08:16
  • 1
    then please extend your code example and add the exception details (message id, message number, error text if available) – Dirk Trilsbeek May 02 '19 at 08:36
  • Excpetions is file not found. The standard report returns data with write, the submit statement is correct to access the data? – stella May 02 '19 at 12:32

2 Answers2

1
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( ). 

Try this code you will be able to get ALV table from standard report

fixeln
  • 34
  • 4
1

For me this code works:

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.

enter image description here

If it doesn't work for you, probably you have some erroneous parameters in seltab.

Of course you will have to do some additional parsing to transform these result into human-readable form.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90