06-22-2010 7:04 AM
Hi ,
we have requirement where we need to get the output of report A in report B. For example: all the values displayed after executing report A needs to be fetched in the internal table of report B.
I tried using SUBMIT REPORT
EXPORTING LIST TO MEMORY
But i could not get proper solution.
Please share your views.
Thanks in advance
Gowri
06-22-2010 7:41 AM
Hi
" Just Copy this and Test in
Report Ztest1.
data : listobject TYPE TABLE OF ABAPLIST." For More info Take F1 help on Export to Memory
SUBMIT ztest EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
EXPORTING
WRITE_ONLY = 'X'
TABLES
listobject = listobject
EXCEPTIONS
EMPTY_LIST = 1
OTHERS = 2 .
ENDIF.
Your ZTEST Program look as below
report ZTEST.
data : itab type standard table of sflight with header line.
select * from sflight into table itab.
if sy-subrc = 0.
loop at itab.
write 😕 itab-carrid, itab-connid. " This Write Statement is Must to generatet List
endloop.
endif.
Cheerz
Ram
06-22-2010 7:24 AM
Hi,
If you are executing Report A then
Export that internal table to a memory id and in the Report B import that internal table from the specified memory id.
So by doing like this you can get that internal table values of A in to B.
Hope you are familir with the Export and Import synatx. Other just do the F1 on this.
Other just have a look on the below coding.
This is in Report A.
data : itab type table of ekko,
itab1 type table of ekko.
itab1 = itab.
Export itab to itab1 memory id ' Report A'.
In Report B.
Data itab type table of Ekko.
Import Itab1 to itab from memory id ' Report A'.
With Regards,
Sumodh.P
06-22-2010 7:30 AM
Hi Sumodh,
Thanks for your reply.
Actually Report A is a Standard Report which we dont have any export ..import statements in it.
So I have tried using Submit report exporting list to memory in Report B(which is a custom report) and then using FM 'LIST_FROM_MEMORY' .
Thanks in advance,
Gowri
06-22-2010 7:41 AM
Hi
" Just Copy this and Test in
Report Ztest1.
data : listobject TYPE TABLE OF ABAPLIST." For More info Take F1 help on Export to Memory
SUBMIT ztest EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
EXPORTING
WRITE_ONLY = 'X'
TABLES
listobject = listobject
EXCEPTIONS
EMPTY_LIST = 1
OTHERS = 2 .
ENDIF.
Your ZTEST Program look as below
report ZTEST.
data : itab type standard table of sflight with header line.
select * from sflight into table itab.
if sy-subrc = 0.
loop at itab.
write 😕 itab-carrid, itab-connid. " This Write Statement is Must to generatet List
endloop.
endif.
Cheerz
Ram
06-22-2010 8:38 AM
Hi Ram,
Thanks for your reply.
I have tried as you have given.But if we mention 'write_list' then the output will be displayed after executing the custom report B.
I dont want that .I want to fetch the report A output in the internal table of report B and want to make some changes .
Thanks in advance
Gowri
06-22-2010 9:31 AM
06-22-2010 9:35 AM
06-22-2010 9:54 AM
Hi Sumodh,
Actually after calling FM 'LIST_FROM_MEMORY' , I have called FM 'LIST_TO_ASCI' and pssed table LISTASCI to receive the list in ASCII.
Thanks
Gowri.
06-22-2010 7:44 AM
Hi Friend
Use Below code.
SUBMIT (p_prog)
WITH p_rbukrs EQ t_email_add-bukrs
WITH p_budat EQ s_budat-low
WITH s_tpsif2-low EQ t_email_add-zztpsif2
WITH s_conso IN s_conso
WITH s_altkt IN s_rzza
TO SAP-SPOOL
SPOOL PARAMETERS s_pri_params
WITHOUT SPOOL DYNPRO
AND RETURN.
Thanks
Regards
I.Muthukumar.
06-22-2010 7:58 AM
Hi Muthu,
Thanks for your reply.
Can you please elaborate..
I dont have much idea on sap-spool.
where can we get the data in the internal table of custom report B , if we use the code given by u.
Thanks in advance,
Gowri