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

Calling Spool while running in Foreground

Former Member
0 Likes
1,459

Hi,

If I run a classical report in background, the output of this automatically goes to the Spool, which I can see using SP01/SP02.

But, the user wants to send the output of the report while running in Foreground too.

Customer's Says: "in the foreground, the user must be prompted to send the output to the spool".

Please help me with the logic.

Thanks in advance,

Ishaq.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
991

Use the below code to create a spool request:

NEW-PAGE PRINT ON

LINE-SIZE 220

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

NEW LIST IDENTIFICATION 'X'

NO DIALOG.

WRITE:/.........code all the WRITE steps

NEW-PAGE PRINT OFF.

Before the above code use the function module POPUP_TO_CONFIRM to prompt the customer and if he interested for spool go for the above code else not.

*******Reward points if useful

Regards,

Kiran Bobbala

3 REPLIES 3
Read only

Former Member
0 Likes
991

Hi,

The code for calling spool in foreground running is in the following link,

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf2.htm

Regards,

Jagadish

Read only

Former Member
0 Likes
992

Use the below code to create a spool request:

NEW-PAGE PRINT ON

LINE-SIZE 220

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

NEW LIST IDENTIFICATION 'X'

NO DIALOG.

WRITE:/.........code all the WRITE steps

NEW-PAGE PRINT OFF.

Before the above code use the function module POPUP_TO_CONFIRM to prompt the customer and if he interested for spool go for the above code else not.

*******Reward points if useful

Regards,

Kiran Bobbala

Read only

0 Likes
991

Hi,

I have tried your code for generating spool in foreground(below). The spool no gets generated but I am not getting the data in spool.

NEW-PAGE PRINT ON

LINE-SIZE 220

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

NEW LIST IDENTIFICATION 'X'

NO DIALOG.

PERFORM header.

PERFORM output USING wa_final.

NEW-PAGE PRINT OFF.

Then after I have to send mail with a PDF attachment.

Please suggest.

Regards,

Binay.