Thursday, November 17, 2016

Multiple Reports from One Single Report

One report can call multiple reports without any intervention. In the following example we have a program which calls ten different reports at single time. Those ten reports will be executed one by one without any interaction of users. The output of those reports execute when click on back button on the output pages.

REPORT zsr_test NO STANDARD PAGE HEADING.

DATAnumber           TYPE tbtcjob-jobcount,
      name             TYPE tbtcjob-jobname VALUE 'JOB_TEST',
      print_parameters TYPE pri_params.

START-OF-SELECTION.

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          name
    IMPORTING
      jobcount         number
    EXCEPTIONS
      cant_create_job  1
      invalid_job_data 2
      jobname_missing  3
      OTHERS           4.

  IF sy-subrc 0.
    SUBMIT zreport1 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport2 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport3 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport4 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport5 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport6 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport7 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport8 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport9 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    SUBMIT zreport10 TO SAP-SPOOL
           SPOOL PARAMETERS print_parameters
           WITHOUT SPOOL DYNPRO
           VIA JOB name NUMBER number AND RETURN.

    IF sy-subrc 0.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             number
          jobname              name
          strtimmed            'X'
        EXCEPTIONS
          cant_start_immediate 1
          invalid_startdate    2
          jobname_missing      3
          job_close_failed     4
          job_nosteps          5
          job_notex            6
          lock_failed          7
          OTHERS               8.

      IF sy-subrc <> 0.
        MESSAGE 'Report not Generated' TYPE 'I'.
      ENDIF.
    ENDIF.
  ENDIF.

12 comments:

sap videos said...


Thankyou for information excellent blog have a great possible. It was so nice Program sap video tutorials

sap videos said...

Thanks for the great information in your blog on It was so nice article sap video tutorials

sap videos said...


Good post! Thanks for sharing this Information.sap video tutorials

Shalini said...

Hi, This is shalini from Chennai learned SAP Training in Chennai from mr.karthick. The training really was good and i got selected in leading mnc company as SAP Consultant.

You can contact 8122241286 for Best SAP Training in Chennai or reach www.thecreatingexperts.com

sanayamohit said...

SAP Success Factors Real Time Hands on Training in Chennai...

Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trainer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

sushma said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Unknown said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

sanayamohit said...

Best SAP Success Factor Training in Chennai

http://thecreatingexperts.com/sap-training-in-chennai/
http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
http://thecreatingexperts.com/sap-mm-training-in-chennai/
http://thecreatingexperts.com/sap-fico-training-in-chennai/

simashree said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Priyasekar said...

Thanks for your info...Here THE CREATING EXPERTS provide hands on training with real time scenarios

http://thecreatingexperts.com/sap-abap-training-in-chennai/

contact +91-08122241286

ragu varan said...

Best SAP HANA Training in Chennai by leading HANA Consultant.
Reach at 9003085882
http://thecreatingexperts.com/category/sap-hana-training-in-chennai/

gilledashivani said...

Great information. the information provided is of great use as i got to learn new things. If you are looking for real time training in SAP ABAP, kindly contact sieve software
Sieve software offers real time training by industry experts with live projects and placement support.
SAP ABAP TRAINING IN HYDERABAD