09-12-2006 11:59 AM
1. does 'Print' always require a spool to be generated?
2. Is a Spool only generated by a 'background job'
Thanks.
09-12-2006 12:10 PM
Hi,
a) Your First question....Basically whenver you want to take print outs at a later stage, say for e.g after the entire batch of documents get generated, then settings can be done at the BASIS level, so that all the documents getting posted creates a spool request.
Once after this process is completed, all the spool requests created can be viewed and data in it can be printed. All these monitoring activities can be done through transaction SP01/SP02.
b) Your second question....spool is not only created by a background job. Its also created by a foreground job. For e.g, the user says he need to download an output program to a PDF format. So in order to create this feature in ABAP, you need to manually create a spool request. Once this spool is created, this no is passed on to a function Module to generate the PDF download.
p.s. Mark all helpful answers for points.
JLN
09-12-2006 12:02 PM
1. does 'Print' always require a spool to be generated?----> No , If u select IMMEDIALTY then no spool request is generated
2. Is a Spool only generated by a 'background job' -
> No like that,Spool is only for later printing.
regards
prabhu
09-12-2006 12:03 PM
Hi,
I am not sure about the first one but I guess yes there should always be.
As for second case there need not be a background job to generate.
In report 'NEW-PAGE PRINT ON'
'NEW-PAGE PRINT OFF'
trigger a spool to be created.
Regards
Nishant
09-12-2006 12:10 PM
Hi,
a) Your First question....Basically whenver you want to take print outs at a later stage, say for e.g after the entire batch of documents get generated, then settings can be done at the BASIS level, so that all the documents getting posted creates a spool request.
Once after this process is completed, all the spool requests created can be viewed and data in it can be printed. All these monitoring activities can be done through transaction SP01/SP02.
b) Your second question....spool is not only created by a background job. Its also created by a foreground job. For e.g, the user says he need to download an output program to a PDF format. So in order to create this feature in ABAP, you need to manually create a spool request. Once this spool is created, this no is passed on to a function Module to generate the PDF download.
p.s. Mark all helpful answers for points.
JLN
09-12-2006 12:22 PM
So is it that
only when the output is required in a perticular 'output type' eg. print, fax, mail, form etc.
that a Spool is generated or to be created?
thanks.
09-12-2006 12:24 PM
yes..
If your query has been answered, please mark points for all the helpful answers.
JLN
09-12-2006 12:27 PM
Hello,
1.Ya spool is required for print.
2.To generate spool u have to use function module.
Example:
FORM write_to_spool.
DATA : l_f_list_name LIKE pri_params-plist,
l_f_destination LIKE pri_params-pdest,
l_f_spld LIKE usr01-spld,
l_f_layout LIKE pri_params-paart,
l_f_line_count LIKE pri_params-linct,
l_f_line_size LIKE pri_params-linsz,
l_f_out_parameters LIKE pri_params,
l_f_valid.
l_f_line_size = 255.
l_f_line_count = 65.
l_f_layout = 'X_65_255'.
l_f_list_name = sy-repid.
to get defult spool device for the user
SELECT SINGLE spld INTO l_f_spld FROM usr01 WHERE bname = sy-uname.
IF sy-subrc = 0.
MOVE l_f_spld TO l_f_destination.
ENDIF.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_ID = C_CHAR_UNKNOWN
ARCHIVE_INFO = C_CHAR_UNKNOWN
ARCHIVE_MODE = C_CHAR_UNKNOWN
ARCHIVE_TEXT = C_CHAR_UNKNOWN
AR_OBJECT = C_CHAR_UNKNOWN
ARCHIVE_REPORT = C_CHAR_UNKNOWN
AUTHORITY = C_CHAR_UNKNOWN
COPIES = C_NUM3_UNKNOWN
COVER_PAGE = C_CHAR_UNKNOWN
DATA_SET = C_CHAR_UNKNOWN
DEPARTMENT = C_CHAR_UNKNOWN
destination = l_f_destination
EXPIRATION = C_NUM1_UNKNOWN
immediately = 'X'
IN_ARCHIVE_PARAMETERS = ' '
IN_PARAMETERS = ' '
layout = l_f_layout
line_count = l_f_line_count
line_size = l_f_line_size
list_name = l_f_list_name
LIST_TEXT = C_CHAR_UNKNOWN
MODE = ' '
NEW_LIST_ID = C_CHAR_UNKNOWN
NO_DIALOG = C_FALSE
RECEIVER = C_CHAR_UNKNOWN
RELEASE = C_CHAR_UNKNOWN
REPORT = C_CHAR_UNKNOWN
SAP_COVER_PAGE = C_CHAR_UNKNOWN
HOST_COVER_PAGE = C_CHAR_UNKNOWN
PRIORITY = C_NUM1_UNKNOWN
SAP_OBJECT = C_CHAR_UNKNOWN
TYPE = C_CHAR_UNKNOWN
USER = SY-UNAME
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = l_f_out_parameters
valid = l_f_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF l_f_valid NE space.
NEW-PAGE PRINT ON PARAMETERS l_f_out_parameters.
WRITE : /5 'Material No.',
25 'Message Type',
40 'Message Issued'.
ULINE.
LOOP AT g_t_message_table WHERE type = 'E'.
WRITE : / g_t_message_table-matnr UNDER 'Material No.',
g_t_message_table-type UNDER 'Message Type',
g_t_message_table-message UNDER 'Message Issued'.
ENDLOOP.
NEW-PAGE PRINT OFF.
ENDIF.
ENDFORM.
regards