Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

To call multiple abap reports in one abap program

Former Member
0 Kudos

Hello,

I have created 10 -12 abap reports whose input data is same for all reports. Now i need to call all these reports in one program and display their outputs one below the other.So i used the multiple SUBMIT commands. But the output shows only first report output and anot all the outputs.

My code :

   SELECT-OPTIONS: s_date FOR sy-datum.

start-of-selection.

  SUBMIT ZSM13_REPORT.
  SUBMIT ZSM58_REPORT.

  SUBMIT ZSMLG_REPORT.

Please do help me out in priority.

Regards,

Gururaj.

18 REPLIES 18

Former Member
0 Kudos

Please try to add AND RETURN after SUBMIT.

0 Kudos

Hi Thanh,

Tried as per your advice, but on execution of the main report, only first SUBMIT command is excuted and displays the output, whereas next submit commands are not executed and no putput also. Plz do let me know.

Regards,

Gururaj.

Former Member
0 Kudos

Hi

You need to manage the output in the main program and not in the called program, so you can export the output after the subimt in order to display it.

SUBMIT <report> EXPORTING LIST TO MEMORY AND RETURN.

The you can use the fm LIST_FROM_MEMORY to get the output from memory and WRITE_LIST to show it.

Max

0 Kudos

Hi Max,

As per your advice, i have modified my code as per below:

   data: list type table of abaplist with header line,
      list1 type table of abaplist with header line.

SUBMIT ZSMLG_REPORT EXPORTING LIST TO MEMORY AND RETURN.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = list
    EXCEPTIONS
      not_found  = 1
      others     = 2.

*LOOP AT list.
*  write list.
*ENDLOOP.

SUBMIT ZSM13_REPORT EXPORTING LIST TO MEMORY AND RETURN.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = list1
    EXCEPTIONS
      not_found  = 1
      others     = 2.

*LOOP AT list1.
*  write list1[].
*ENDLOOP.

But on debugging i find some data in List like:

list[1]-RFCSIZE = 1000   and

list[1]-RFCRECORD = 0101000801020105040100020101010300040000020301030106000B040100020100020000002301060007001E00310030002E003200320032002E00310033003800

so even on looping at list, i'm not able to display the contents in List.

Let me know if my code is correct or need some modifications.

Thanks in advance.

Regards,

Gururaj.

0 Kudos

Hello ,

You need to call FM LIST_TO_ASCII also

CALL FUNCTION 'LIST_TO_ASCI'      " Conversion of data to ASCII

             TABLES

               listobject         = list1

               listasci           = TXTLINES

             EXCEPTIONS

               empty_list         = 1

               list_index_invalid = 2

               OTHERS             = 3.

For that

0 Kudos

But I guess still your main issue will persist i.e not able to call ABAP Reports multiple times in a Report using SUBMIT command.

http://scn.sap.com/thread/3341685

Still searching for the answer

Former Member
0 Kudos

Hi Gururaj Z,

Try like this,

SUBMIT ZSM13_REPORT AND RETURN.
SUBMIT ZSM58_REPORT AND RETURN.

SUBMIT ZSMLG_REPORT AND RETURN.

Regards,

RijuThomas.

0 Kudos

Hi Riju,

Tried as per your advice, but on execution of the main report, only first SUBMIT command is excuted and displays the output, whereas next submit commands are not executed and no putput also. Plz do let me know.

Regards,

Gururaj.

0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

  • Code used to populate 'parameters' & execute report

               SUBMIT zreport with p_param1         = 'value'

                                                   with p_param2 = 'value'

  • Submit report and return to current program afterwards

             SUBMIT zreport AND RETURN.

  •     Submit report via its own selection screen

               SUBMIT zreport VIA SELECTION-SCREEN.

  • Submit report but export resultant list to memory, rather than

        it being displayed on screen

       SUBMIT zreport EXPORTING LIST TO MEMORY.

I think you can use submit and return.

former_member220538
Active Participant
0 Kudos

This message was moderated.

0 Kudos

HI,,

Maybe you can use subscreens, Use screen container elements. to display the output in a single screen.

Regards,

Vamsi

Former Member
0 Kudos

Hi All,

Thanks....i'm able to display all the reports in one single report.

But still there is one major issue pending.

Issue :  For every reports called in the main program have "Date To and Date From" as an input data.

Based on this date range, the data will be fetched and displayed in indivual report.

Now the requirement is in main report i need to give the select-option as "Date To and Date From".

Based on this date range, the data must be fetched when it trigerrs the SUBMIT command for each abap report.

How cani handle this issue. Please let me know. thanks in advance.

Regards,

Gururaj.

0 Kudos

Hi,

you can use the following.

SUBMIT   zreport   with p_param1    = 'value'

                             with p_param2 = 'value'

            and Return.

Thanks

Pavan.N

0 Kudos

Hi,

Use Below code for each report. Check the additions of SUBMIT. It may help you.

SELECT-OPTIONS: s_date FOR sy-datum.

          SUBMIT <Report name>

                       WITH <reportdatefield>  IN s_date

          AND RETURN.

Regards,

Lokesh


Former Member
0 Kudos

Hi Gururaj,

In the program that has been called, use syntax

In Program 1:

EXPORT itab1(table that has the result) TO MEMORY ID 'M1'.

In Program 2.

EXPORT itab2(table that has the result) TO MEMORY ID 'M2'.

.

.

.

.

In program which calls all these reports declare the internal tables (itab1, itab2) that you export from other reports in the program where you import it.

Use the following syntax.

SUBMIT Program 1 AND RETURN.

SUBMIT Program 2 AND RETURN.

.

.

.

.

IMPORT itab1 FROM MEMORY ID 'M1'.

IMPORT itab2 FROM MEMORY ID 'M2'.

.

.

.

.

Regards,

Shahanaz.

0 Kudos

Thanks Shahanaz., getting the desired solution as per your advice.

0 Kudos

This message was moderated.