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: 

How to create Spool through ABAP program

Former Member
0 Kudos

How to create spool request for Smartforms through program. So I can go in TCODE SP01 and see the output of my smartforms.

4 REPLIES 4

Former Member
0 Kudos

Hi,

To generate a spool req for a smartform you can generate from the standard Tcode of the application for which you are generating smartform.

Example :For invoice you can got ot VF03 provide the invoice no then go with Billing Document->Issue output ,select the output type and go with the Print option.

This will generate the spool request.

But,

If you want a program for generating the same then you can record the above procedure and write a BDC .

so that it will generate the spool request.But this will be application dependent,i.e you need to record depending on

the application for which you want the spool request.

if you want for invoice record vf03 as said above ,code accordingly.

Reward points if useful.

Edited by: K.R.Reddy on Apr 8, 2008 9:18 AM

Former Member
0 Kudos

Include the below code in ur program .......

DATA: PRINT_PARAMETERS TYPE PRI_PARAMS,

VALID_FLAG TYPE C LENGTH 1.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

IMMEDIATELY = 'X' "C_IMMEDIATELY

*LAYOUT = 'Z_48_144'

*LINE_COUNT = '48'

LINE_SIZE = '255'

*NEW_LIST_ID = C_NEW_LIST_ID

NO_DIALOG = 'X'

RELEASE = 'X'

IMPORTING

OUT_PARAMETERS = PRINT_PARAMETERS

VALID = VALID_FLAG

EXCEPTIONS

ARCHIVE_INFO_NOT_FOUND = 1

INVALID_PRINT_PARAMS = 2

INVALID_ARCHIVE_PARAMS = 3

OTHERS = 4 .

G_PDEST = PRINT_PARAMETERS-PDEST.

NEW-PAGE PRINT ON PARAMETERS PRINT_PARAMETERS

NO DIALOG.

List of write statements to be output.......

NEW-PAGE PRINT OFF.

Reward if useful..............

0 Kudos

From the program, how ill get the spool number ??

0 Kudos

The smartform function module will return the parameter JOB_OUTPUT_INFO. This parameter will contain a component called SPOOLIDS which will have contain the spool ID.

The above is based on the assumption that you are using the  function module of your smartform to print it. If you are trying to print differently give more information on how you are printing.