3.1.11

SAP Note 16755 - SAPSQL_ARRAY_INSERT_DUPREC in SAPLKAIN

Symptom:

Description: An update termination occurs in transactions that
generate CO documents.
Program: SAPLKAIN
Termination: SAPSQL_ARRAY_INSERT_DUPREC

Cause and prerequisites

When a new CO document is generated, a new CO document number is assigned from an internal number range. If a CO document already exists with the assigned document number, the above update termination occurs. Possible causes:
1. The counter for the affected document number range was reset.
2. The counter reached the upper limit of the involved
document number range, and started again from the lower limit,
without the existing documents being deleted or archived in the
interim.

Solution
Clear out the number ranges for CO documents by:
- Setting the counters in the affected document number ranges so
high that no CO document exist between the upper limit and the
counter level, or
- Define new document number ranges (in previously unused areas)
and assign the affected operations to these new group.
The transaction for maintaining the CO document number ranges can be found in the Customizing menu for cost center accounting (for example) under "Environment -> No. rnge for CO doc."

To find out which document number ranges have an incorrect counter status, enter and run the following report:

REPORT ZCOBELNR.

TABLES: NRIV,
COBK.

DATA: FROM_BELNR(10) TYPE N,
TO_BELNR(10) TYPE N.

PARAMETERS: KOKRS LIKE COBK-KOKRS.

SELECT * FROM NRIV WHERE OBJECT = 'RK_BELEG'
AND SUBOBJECT = KOKRS
AND EXTERNIND = SPACE.
IF NRIV-NRLEVEL IS INITIAL.
FROM_BELNR = NRIV-FROMNUMBER.
ELSE.
FROM_BELNR = NRIV-NRLEVEL + 1.
ENDIF.
TO_BELNR = NRIV-TONUMBER.
SELECT * FROM COBK WHERE KOKRS = KOKRS
AND BELNR BETWEEN FROM_BELNR AND TO_BELNR
ORDER BY PRIMARY KEY.
ENDSELECT.
IF SY-SUBRC = 0.
WRITE: / NRIV-NRRANGENR, "Nummer des Intervalls
NRIV-FROMNUMBER, "Untergrenze
NRIV-TONUMBER, "Obergrenze
NRIV-NRLEVEL, "Nummernstand
COBK-BELNR. "Höchste Belegnummer im Intervall
ENDIF.
ENDSELECT.

No comments:

Post a Comment