Skip to Content
author's profile photo Former Member
Former Member

Build report for looping Cycle-Runs

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:

--


Collect spool from report run to gt_list--

call function 'LIST_FROM_MEMORY'

tables

LISTOBJECT = GT_LIST

exceptions

NOT_FOUND = 1

others = 2.

if SY-SUBRC = 0.

--


Write output List to Screen (from table gt_list)--

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 07, 2012 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2012 at 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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

      ----


      --


      Fetch variant-ID from selection-table-structure--

      LOOP AT so_varid INTO lv_varid.

      lv_varid = lv_varid+3.

      APPEND lv_varid TO lt_varid.

      ENDLOOP.

      --


      Loop all entries of program selection table--

      LOOP AT so_prog INTO lv_prog.

      lv_prog = lv_prog+3.

      lv_index = sy-tabix.

      --


      Check if assigned variant is existing for report--

      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 variant is not existing skip processing--

      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.

      --


      If variant is existing create header and run report--

      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.

      --


      In case report can not be executed successfully stop-----

      IF sy-subrc NE 0.

      EXIT.

      ENDIF.

      --


      Collect spool from report run to gt_list--

      CALL FUNCTION 'LIST_FROM_MEMORY'

      TABLES

      listobject = gt_list

      EXCEPTIONS

      not_found = 1

      OTHERS = 2.

      IF sy-subrc = 0.

      --


      Write output List to Screen (from table gt_list)--

      CALL FUNCTION 'WRITE_LIST'

      TABLES

      listobject = gt_list.

      ENDIF.

      ENDIF.

      --


      Create foot note for each program output list--

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.