09-26-2013 8:29 AM
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.
09-26-2013 9:11 AM
09-26-2013 9:27 AM
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.
09-26-2013 9:13 AM
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
09-26-2013 11:26 AM
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.
09-26-2013 11:46 AM
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
09-26-2013 11:52 AM
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
09-26-2013 9:17 AM
Hi Gururaj Z,
Try like this,
SUBMIT ZSM13_REPORT AND RETURN.
SUBMIT ZSM58_REPORT AND RETURN.
SUBMIT ZSMLG_REPORT AND RETURN.
Regards,
RijuThomas.
09-26-2013 9:28 AM
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.
09-26-2013 10:40 AM
09-26-2013 9:31 AM
Hi,
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'
SUBMIT zreport AND RETURN.
SUBMIT zreport VIA SELECTION-SCREEN.
it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
I think you can use submit and return.
09-26-2013 9:31 AM
09-26-2013 11:49 AM
HI,,
Maybe you can use subscreens, Use screen container elements. to display the output in a single screen.
Regards,
Vamsi
09-26-2013 1:26 PM
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.
09-26-2013 1:58 PM
Hi,
you can use the following.
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'
and Return.
Thanks
Pavan.N
09-26-2013 2:01 PM
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
09-26-2013 2:11 PM
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.
09-27-2013 7:26 AM
Thanks Shahanaz., getting the desired solution as per your advice.
09-27-2013 8:35 AM