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: 

Write to spool.

Former Member
0 Kudos

Hi experts,

I have a requirement wherein i have few records in internal table, i have to call a transaction using these records. The transaction accepts only one record at a time and generates an output,then using the PRINT option i can generate a spool of the output for that particular record.

My requirement is that i have to submit multiple records from the internal table to the transaction and get the output for every record into a single spool. On top of it for every new record in the internal table i have to insert a page break in the spool.

Plz Help.

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Why dont you try this out.Instead of calling the transaction you can use a submit program if possible and then export the list to memory. this can be done for each record in the internal table.

What you then need to do is take the output and put it all into another internal table with which you will create the spool

SUBMIT <program> EXPORTING LIST TO MEMORY

WITH SELECTION-TABLE i_rsparams

AND RETURN.

  • Get the List from Memory

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = i_listobject

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF i_listobject[] IS NOT INITIAL.

  • Write the List to Char Format

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = i_ascii

listobject = i_listobject

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

here the i_ascii will contain the output of your program. call these statements within a loop of your internal table and you will be able to get all the outputs for each line in the internal table.

Just check out if you can take the program of the transaction in SE93 and do a submit on it.

Hope this helps.

Check out this thread on how to create spools

Message was edited by:

Dominic Pappaly

1 REPLY 1

Former Member
0 Kudos

Hi

Why dont you try this out.Instead of calling the transaction you can use a submit program if possible and then export the list to memory. this can be done for each record in the internal table.

What you then need to do is take the output and put it all into another internal table with which you will create the spool

SUBMIT <program> EXPORTING LIST TO MEMORY

WITH SELECTION-TABLE i_rsparams

AND RETURN.

  • Get the List from Memory

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = i_listobject

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF i_listobject[] IS NOT INITIAL.

  • Write the List to Char Format

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = i_ascii

listobject = i_listobject

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

here the i_ascii will contain the output of your program. call these statements within a loop of your internal table and you will be able to get all the outputs for each line in the internal table.

Just check out if you can take the program of the transaction in SE93 and do a submit on it.

Hope this helps.

Check out this thread on how to create spools

Message was edited by:

Dominic Pappaly