02-07-2012 10:43 AM
Dear ABAP-Specialists,
actually i am building up a report for running RKGALKSU5 multiple times for different variants.
This works well fort starting and having the reports run by using the statement:
submit (LV_PROG) using selection-set LV_VARID
exporting list to memory
and return.
The issue is that this created different separated spools, which are not transfered into the acutal spool by using:
--
call function 'LIST_FROM_MEMORY'
tables
LISTOBJECT = GT_LIST
exceptions
NOT_FOUND = 1
others = 2.
if SY-SUBRC = 0.
--
call function 'WRITE_LIST'
tables
LISTOBJECT = GT_LIST.
Now my question is, how can i manage to get the content of all the separate spools collected together and displayed / stored in the spool of my own report.
Any ideas or solutions for this issue?
Thanks a lot in advance
Best regards
Carsten Klatt
02-07-2012 12:22 PM
Hallo Carsten,
look F1 to submit
and
try to use addition : SPOOL PARAMETERS pri_params and here field PRNEW
here onyl helps trial and error...
hope taht helps
Andreas
02-07-2012 12:40 PM
Hi,
Get all the variants and within the LOOP you submit .
Best Regards,
M.Vimala
Edited by: vimala on Feb 7, 2012 1:40 PM
02-07-2012 1:09 PM
Well how the program should work in general is clear, but it does not work for the mentioned program as in this case the result is created by a program which is generated and run in background from the first one which is started via submit.
The actual coding of this idea was following:
----
Data definitions and Select-Options
----
DATA: gt_list TYPE TABLE OF abaplist,
valid_flag TYPE c LENGTH 1.
DATA: lv_prog TYPE rs38m-programm,
lt_prog TYPE TABLE OF rs38m-programm,
lv_varid TYPE rsvar-variant,
lt_varid TYPE TABLE OF rsvar-variant,
lv_index TYPE integer.
SELECT-OPTIONS: so_prog FOR lv_prog,
so_varid FOR lv_varid.
----
Start of Report
----
--
LOOP AT so_varid INTO lv_varid.
lv_varid = lv_varid+3.
APPEND lv_varid TO lt_varid.
ENDLOOP.
--
LOOP AT so_prog INTO lv_prog.
lv_prog = lv_prog+3.
lv_index = sy-tabix.
--
READ TABLE lt_varid INDEX lv_index INTO lv_varid.
SELECT SINGLE variant FROM varit INTO lv_varid WHERE report = lv_prog
AND variant = lv_varid.
--
IF sy-subrc NE 0.
WRITE: 'Error: Variant does not exist for the selected report:', ' ', lv_varid, ' ', lv_prog, ' ', 'Execution skipped!'.
ELSEIF sy-subrc = 0.
--
WRITE: 'Start of Report' color COL_TOTAL, ' ',
lv_prog color COL_TOTAL, ' ',
'with Variant' color COL_TOTAL, ' ',
lv_varid color COL_TOTAL.
Uline.
SUBMIT (lv_prog) USING SELECTION-SET lv_varid
EXPORTING LIST TO MEMORY
AND RETURN.
--
IF sy-subrc NE 0.
EXIT.
ENDIF.
--
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gt_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
--
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = gt_list.
ENDIF.
ENDIF.
--
Uline.
WRITE: 'End of Report' color COL_TOTAL, ' ',
lv_prog color COL_TOTAL, ' ',
'with Variant' color COL_TOTAL, ' ',
lv_varid color COL_TOTAL.
Uline.
ENDLOOP.
But this still does not help to get the result of the started reports into the Spool.
This happens due to the used FM K_ALLOCATIONS_RUN, which is creating a new Report and runs it.
Edited by: Carsten Klatt on Feb 7, 2012 2:42 PM