Application Development and Automation 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: 
Read only

How to create a standard spool???

Former Member
0 Likes
1,283

Hi all,

I have been give the requirement to create a standard spool and save the output

of a report when it is executed in the background.

Please guide me how to do it.

Thanks in advance.

syed

3 REPLIES 3
Read only

Former Member
0 Likes
1,030

Hi

You can use the TCODe SP01 for this. In your selection screen instead of pressing Execute you can press 'F9' or you can Goto

'Program -> Execute It in Background.

Then Goto SM37 here you can see the status , if the status idf showing as 'Finished' then you can Goto the Menu -> System Services -> Output Control.

It will directly lead to SP01 transaction and you can see your spool output here. Fro here you can Save Or You can PRINT your report directly..

Hope tis will help you, get back if you have some doubts..

Reward All Helpfull Answers...............

Read only

Former Member
0 Likes
1,030

Hi ....

You execute any report in the background it will create a spool .... so need not to do any thing in your report ...

just execute in SE38 .... place the selection parameters and in the menu

Goto to MENU-> Programs -> execute background ...

it will give you the pop which is output device (printer name) give LOCL or give which ever printer was configured to your sap server ask BASIS he only adds the printer to the sap ...

then click on ok .... again one pop there press on Immedaite so that your program will executed immediately or else you can schedule it later also by placing the date/time...etc ..

your program is executed in the back ground and spool was created ... with that output device ...DON'T worry it will not print only the spool will be created and saved in the spool table " TSP01 ".

Goto transcation SP01 ..execute with your user id and date ...

it will display the all the spool's list

by selecting the check box in the list of of spool you can see the data inthe spool and you can take printout also ...

reward points if it is usefull .

Girish

Read only

Former Member
0 Likes
1,030

even you can use background directly ,

and also programtically you can do when they run foreground ,if they want to see in spool

DATA: d_suffix1(4) TYPE n.

DATA: d_suffix2 LIKE ssfcompop-tdsuffix2.

d_suffix1 = " you can give main document number'.

CONCATENATE sy-datum+2 sy-uzeit INTO d_suffix2.

SELECT * FROM tsp01 WHERE

rq0name = sy-repid AND

rq1name = d_suffix1 AND

rq2name = d_suffix2 AND

rqowner = sy-uname.

WRITE:/ 'Spool request issued',

/ 'Spool Number:', tsp01-rqident,

/ 'Spool Name :', tsp01-rq0name,

/ 'Suffix 1 :' , tsp01-rq1name,

/ 'Suffix 2 :', tsp01-rq2name,

/ 'Owner :', tsp01-rqowner,

/ 'Device :',tsp01-rqdest,

/ 'Copies :', tsp01-rqcopies,

/ 'Processed :', tsp01-rqpjreq.

SKIP.

ENDSELECT.

IF sy-subrc EQ 0.

CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'

EXPORTING

spool_request_id = tsp01-rqident

EXCEPTIONS

archive_dest_invalid = 1

archive_dest_not_found = 2

archive_dest_no_right = 3

cannot_archive = 4

change_archdest_no_right = 5

change_copies_no_right = 6

change_dest_no_right = 7

change_devtype_no_right = 8

change_prio_no_right = 9

change_telenum_no_right = 10

change_title_no_right = 11

dest_invalid = 12

dest_not_found = 13

dest_no_right = 14

internal_problem = 15

invalid_fax_attribute = 16

invalid_parameters = 17

non_owner_no_right = 18

no_layout = 19

no_spool_request = 20

out_again_no_right = 21

spooler_problem = 22

OTHERS = 23.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.