30.12.10

SAP Note 16410 - Attaching to existing spool requests

Symptom:

When is data attached to spool requests and when is a new spool request created?

Cause and prerequisites

Not an error -- information requirement

Solution
When something is to be written to the spool, you can demand that a new spool request be generated:

At the C level:
rspoattb l_attb;
l_attb.rqnewid = TRUE;
...
rspospj_start_print_job( l_attb, ...

During interactive work:
Check off "New spool request"
(Affects both report output and SAPscript output.)

With NEW-PAGE PRINT ON:
NEW LIST IDENTIFICATION 'X'

With function module GET_PRINT_PARAMETERS:
EXPORTING NEW_LIST_ID = 'X'

With function module OPEN_FORM:
DATA BEGIN OF OPT. INCLUDE STRUCTURE ITCPO. DATA END OF OPT.
OPT-TDNEWID = 'X'.
...
CALL FUNCTION 'OPEN_FORM'
EXPORTING OPTIONS = OPT
...

When you do not demand a new spool request, the spool checks whether it can add the data to an existing spool request. That spool request must fulfill the following condition:
The attributes of the existing spool request (R_old) must be compared to the attributes of the current request (R_new):

R_old cannot be set to:
Closed (RQFINAL) *1

The following must be exactly the same:
Client (RQCLIENT)
Dataset name (RQ0NAME)
Suffix1 (RQ1NAME)
Suffix2 (RQ2NAME)
Owner (RQOWNER)
External mode (RQCMODE) *2
Number of writers (RQWRITER) *3
Planning2 (RQ2DISPO) automatic delete
Planning3 (RQ3DISPO) (in)direct printer selection
Ausgabegerät (RQDEST) (except w/indirect pr. sel.)
Number of copies (RQCOPIES)
Formatting (RQPAPER)
SAP title page sel. (RQSAPTITLE)
UNIX title page sel. (RQUNXTITLE)
Archiving mode (RQARCHTYPE) Printing and/or archiving

The following rules apply to the attributes below:
When R_new is empty, then R_old doesn't matter
When R_new is filled, then R_old must be identical
Recipient (RQRECEIVER) Title page
Department (RQDIVISION) Title page
Authorization (RQAUTH)
Phone country (RQTELELAN) for FAX
Phone number (RQTELENUM) for FAX

The following attributes apply to the attributes below:
When R_old is empty, then R_new doesn't matter
When R_new is empty, then R_new doesn't matter
When both are filled, both must be identical
Title (RQTITEL) Title page and SP01 display

When archiving is requested (with or without printing), then the archiving parameters must also all agree.

*1 Comment
A spool request is automatically "permanently closed" when the first output is started. In addition, it can be closed using transaction SP01.

*2 Comment
The external mode was used as an additional selection criteria to avoid having programs that a user is running in different windows from "stepping on each others' toes".

*3 Comment
The final effect of the test of the writers is that nothing is ever attached to a spool request that was just written. And when a writing program is cancelled in the middle (after the first NEW-PAGE and COMMIT WORK), then nothing can be attached immediatley either.

To simplify, all these conditions together mean that additions can only be made to "identical" spool requests.

If several suitable spool requests exist, the newest one is used.

This complicated logic was basically copied from R/2 and adapted to the different conditions in R/3. It is still necessary, however, because many transactions and reports depend on it.

No comments:

Post a Comment