23.1.11

SAP Note 18674 - Spooler: RT_INSERT reports error 128 in table TSP02

Symptom:

A new output request is to be created for a spool request after several output requests have already been processed (Transaction SP01).
When you press the "PRINT" button, an error message is displayed: PO105: E: Error 20 ( 8 ) when generating the print request.

At the same time, an entry is written to the system log with the message:
Spooler: RT_INSERT reports error 128 in table TSP02.
The addressed spool can no longer be addressed.

Cause and prerequisites

Duplicate key, i.e. the number of output requests for a spool request in TSP01 no longer agrees with the number of requests in TSP02. When you make a new output request and TSP01 contains a fewer spool requests than TSP02, a key with is generated. This key already exists in TSP02.

Solution
The following report solves the problem:

REPORT zspkor.
TABLES: tsp01, tsp02.
DATA: counter TYPE i VALUE 0,
tsp01_buf LIKE tsp01 OCCURS 1000 WITH HEADER LINE.

SELECT * FROM tsp01 INTO TABLE tsp01_buf ORDER BY PRIMARY KEY.
LOOP AT tsp01_buf.
SELECT SINGLE FOR UPDATE * FROM tsp01
WHERE rqident = tsp01_buf-rqident.
counter = 0.
SELECT * FROM tsp02 WHERE pjident EQ tsp01-rqident.
ADD 1 TO counter.
ENDSELECT.
IF counter <> tsp01-rqpjreq.
UPDATE tsp01 SET rqpjreq = counter
WHERE rqident = tsp01-rqident.
WRITE: / 'correcting number', tsp01-rqident.
ENDIF.
COMMIT WORK.
ENDLOOP.
IMPORTANT: This report only solves the problem if an entry already exists in TSP01. If this is not the case, but entries are available in TSP02, the same error may occur in the syslog as a result of this inconsistency.
Therefore, you should always also run an additional consistency check for the spooler (Note 48400).

No comments:

Post a Comment