08-26-2009 10:46 AM
Hi All,
Can we combine multiple spools in one spool?
My custom program is calling a standard SAP program inside a loop using SUBMIT with 'parameter' and RETURN statement.
As a result, if it is submitted six times, six spools are generated.
Is there any way I can have a single spool which contains output of all six spools?
Please suggest.
Thanks in Advance,
Rekha
08-26-2009 11:18 AM
Read data of all spools and take this data into a internal table and create a spool with this data.
You can get the spool number from table tsp01.
Exapmle
Select spool number from tsp01 into g_t_data
where............(specify ur condition)
Take spools data into a internal table
Loop at g_t_data.
Call program to read spool as follows
SUBMIT rspolst2 EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = g_t_data-rqident (spool number)
WITH first = '1'
Read memory where spool data is stored
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = mem_tab
Convert spool data to Ascii
IF NOT mem_tab[] IS INITIAL.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = g_t_text1 (table type c length 2000)
listobject = mem_tab (LIKE TABLE OF abaplist)
APPEND LINES OF g_t_text1 TO g_t_text.
ENDIF.
ENDLOOP.
create spool with this internal table data
NEW-PAGE PRINT ON
KEEP IN SPOOL l_keep(variable type c default u2018Xu2019)
LINE-SIZE 300
LIST NAME l_list (variable(30) )
NO DIALOG.
LOOP AT g_t_text.
WRITE: g_t_text-data.
ENDLOOP.
NEW-PAGE PRINT OFF.
COMMIT WORK.
Now you can get the final spool number from table TSP01
Hope this will help you
08-27-2009 7:59 AM
Thanks Sheelesh , your reply was quite helpful.
I have managed it with some changes.
Thanks.
08-27-2009 8:00 AM
07-25-2016 5:58 AM
Hi Rekha sing,
I have one requiremnt, please help me out.
I have two spools
one spool having pdf data and another spool having word document data.
How can i combine these spool in one spool or
How can i print thses spools seqentially local printer using one spool.
Thanks & Regards,
M Surendra Babu