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: 

Can we combine multiple spools?

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

Thanks Sheelesh , your reply was quite helpful.

I have managed it with some changes.

Thanks.

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

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