cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime errors SAPSQL_ARRAY_INSERT_DUPREC

Former Member
0 Kudos

Hi Team,

We are facing daly batch jobs failure while planned to production order conversion (Programe-PPIO_Entry).I can found following analysis in ST22.Pleas help me to solve this problem.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in

procedure "HEADER_POST" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

If you use an ABAP/4 Open SQL array insert to insert a record in

the database and that record already exists with the same key,

this results in a termination.

(With an ABAP/4 Open SQL single record insert in the same error

situation, processing does not terminate, but SY-SUBRC is set to 4.

Can anybody suggest what corrective action do i need to take.

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207609
Contributor
0 Kudos

Hi

The dump may happen due to incorrect current number in the number range interval.

e.g. the number range of produciton order, the highest number in the order table, e.g. AKFO, is 1000, but the current number assigned to the number range interval is 900, then the system will assign a new number 901 = 900 + 1 to the new order then the dump comes as the number 901 already exist in table AFKO. Please change the current number to the one higher than the highest number of table, e.g. 1001 then no dump will happen.

While creating the produciton order, several number range objects other than order number is called so you need check them as well. The SAP note 24097 includes a report which can get the hightest number of tabls for the objects can be checked.

Here is the detail of the note and the report for your reference.

*******************************************************************************************************

Long text

Symptom

When you create a production order, the system generates error message:

"ERROR DURING STATUS_UPDATE" The update was canceled

ABAP processor: SAPSQL_ARRAY_INSERT_DUPREC;

The termination occurred in the ABAP/4 program "SAPLBSVU"

Additional key words

CO01, CO40, CO41, MD04, VA01, COR1, Create order

Cause and prerequisites

The copying of sales order data between clients means that objects were

transferred with numbers that are higher than the current status of the

respective number range objects in the target client. When a new order

is created, number assignment according to the status of the number

range objects results in double entries.

Solution

You must adapt the status of the number range objects according to the

copied data: In the configuration menu of Master Planning (Transaction

OLPF) under Master Data -> Order -> Number ranges (Transactions CO80,

CO81, CO82, CO83, CY89).

You can transport the statuses of the number range objects from the

source client of your copied sales order data into the target client.

However, you should always be careful when changing the number ranges

since multiple assignment of the same numbers can result in IRREPARABLE

inconsistencies in your system.

You should only ever INCREASE the current status of a number range

object !!!

You can determine the highest number status of the respective objects

with attached selection report. For the order numbers, you must note

that the highest current number status can only be determined correctly

if no external number assignment was used.

REPORT DETMAXNO.

************************************************************************

  • This report determines the highest numbers of order dependent number *

  • ranges like order number, confirmation number, reservation number, *

  • operation number, capacity requirement number. *

  • Attention: the maximum order number determined by this report is *

  • only valid if you only use internal numbers

************************************************************************

TABLES: AUFK, AFKO, AFVC, RESB, KBED.

DATA: ORD_MAX LIKE AUFK-AUFNR,

CONF_MAX LIKE AFKO-RUECK,

CONF_MAX1 LIKE AFKO-RUECK,

RSNUM_MAX LIKE RESB-RSNUM,

AUFPL_MAX LIKE AFVC-AUFPL,

BEDID_MAX LIKE KBED-BEDID.

Page 3

  • maximum order number

SELECT MAX( AUFNR ) FROM AUFK INTO ORD_MAX.

IF SY-SUBRC IS INITIAL.

WRITE: / 'Max. of order numbers: ', ORD_MAX.

ENDIF.

  • maximum confirmation number

SELECT MAX( RUECK ) FROM AFVC INTO CONF_MAX. "operation conf.

SELECT MAX( RUECK ) FROM AFKO INTO CONF_MAX1. "header conf.

IF SY-SUBRC IS INITIAL.

IF CONF_MAX1 > CONF_MAX.

CONF_MAX = CONF_MAX1.

ENDIF.

WRITE: / 'Max. of confirmation numbers: ', CONF_MAX.

ENDIF.

  • maximum reservation number

SELECT MAX( RSNUM ) FROM RESB INTO RSNUM_MAX.

IF SY-SUBRC IS INITIAL.

WRITE: /'Max. of reservation number: ', RSNUM_MAX.

ENDIF.

  • maximum operation number

SELECT MAX( AUFPL ) FROM AFVC INTO AUFPL_MAX.

IF SY-SUBRC IS INITIAL.

WRITE: /'Max. operation number: ', AUFPL_MAX.

ENDIF.

  • maximum capacity requirement number

SELECT MAX( BEDID ) FROM KBED INTO BEDID_MAX.

IF SY-SUBRC IS INITIAL.

WRITE: /'Max. capacity requirement number: ', BEDID_MAX.

ENDIF.

...

Former Member
0 Kudos

Hi Leon,

Thanks for your information.This batch jobs sometime finished as well,say two times in a week.If it is cancelled always then it should have problem with number range but 2 out of 5 times it gets finished.

Any thing else where i should check.

Thanks in advance.