cancel
Showing results for 
Search instead for 
Did you mean: 

SAPSQL_ARRAY_INSERT_DUPREC CX_SY_OPEN_SQL_DB

former_member222381
Participant
0 Kudos

Hi,

As we are getting dump errors as SAPSQL_ARRAY_INSERT_DUPREC CX_SY_OPEN_SQL_DB almost 100 times a day.

when the job is getting failed as

:Job started

Step 001 started (program RSN3_STAT_COLLECTOR, variant , user

Internal session terminated with a runtime error (see ST22)

Job cancelled.

Below is the full report of the above dump error. Please help me to solve this, i tried to reset the number buffer range, then also its not working.

Short text

    The ABAP/4 Open SQL array insert results in duplicate database records.

What happened?

    Error in the ABAP Application Program

    The current ABAP program "SAPLSBAL_DB_INTERNAL" had to be terminated because it

     has

    come across a statement that unfortunately cannot be executed.

What can you do?

    Note down which actions and inputs caused the error.

    To process the problem further, contact you SAP system

    administrator.

    Using Transaction ST22 for ABAP Dump Analysis, you can look

    at and manage termination messages, and you can also

    keep them for a long time.

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 "BAL_DB_INTERNAL_NO_UPDATE_TASK" "(FUNCTION)", 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.)

to correct the error

Use an ABAP/4 Open SQL array insert only if you are sure that none of

the records passed already exists in the database.

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"SAPSQL_ARRAY_INSERT_DUPREC" "CX_SY_OPEN_SQL_DB"

"SAPLSBAL_DB_INTERNAL" or "LSBAL_DB_INTERNALU02"

"BAL_DB_INTERNAL_NO_UPDATE_TASK"

3. If the problem occurs in a problem of your own or a modified SAP

program: The source code of the program

    In the editor, choose "Utilities->More

Utilities->Upload/Download->Download".

4. Details about the conditions under which the error occurred or which

actions and input led to the error.

The exception must either be prevented, caught within proedure

"BAL_DB_INTERNAL_NO_UPDATE_TASK" "(FUNCTION)", or its possible occurrence must

  be declared in the

RAISING clause of the procedure.

To prevent the exception, note the following:

SAP-Release 701

Application server... "XXX-QUA-SRV"

Network address...... ""

Operating system..... "Windows NT"

Release.............. "6.1"

Hardware type........ "2x AMD64 Level"

Character length.... 16 Bits

Pointer length....... 64 Bits

Work process number.. 16

Shortdump setting.... "full"

Database server... "XXX-QUA-SRV"

Database type..... "DB6"

Database name..... "XXX"

Database user ID.. "xxxxx"

Terminal.......... " "

Char.set.... "C"

SAP kernel....... 721

created (date)... "Mar 6 2015 21:18:19"

create on........ "NT 6.1 7601 S x86 MS VC++ 14.00"

Database version. "DB6_81 "

Patch level. 402

Patch text.. " "

Database............. "DB6 09.*, DB6 10.*"

SAP database version. 721

Operating system..... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2, Windows

  NT 6.0, Windows NT 6.1, Windows NT 6.2, Windows NT 6.3"

Memory consumption

Roll.... 0

EM...... 16759168

Heap.... 0

Page.... 32768

MM Used. 2002704

MM Free. 2184416

User and Transaction

Client.............. 0

User................ "xxx"

Language key........ "E"

Transaction......... " "

Transactions ID..... "x"

Program............. "SAPLSBAL_DB_INTERNAL"

Screen.............. "SAPMSSY0 1000"

Screen line......... 6

Information on where terminated

    Termination occurred in the ABAP program "SAPLSBAL_DB_INTERNAL" - in

     "BAL_DB_INTERNAL_NO_UPDATE_TASK".

    The main program was "SWNCCOLL ".

    In the source code you have the termination point in line 64

    of the (Include) program "LSBAL_DB_INTERNALU02".

    The program "SAPLSBAL_DB_INTERNAL" was started as a background job.

    Job Name....... "SAP_COLLECTOR_FOR_PERFMONITOR"

    Job Initiator.. "ESPLBASIS"

    Job Number..... 08450300

    The termination is caused because exception "CX_SY_OPEN_SQL_DB" occurred in

    procedure "BAL_DB_INTERNAL_NO_UPDATE_TASK" "(FUNCTION)", but it was neither

     handled locally nor declared

    in the RAISING clause of its signature.

    The procedure is in program "SAPLSBAL_DB_INTERNAL "; its source code begins in

     line

    1 of the (Include program "LSBAL_DB_INTERNALU02 ".

Source Code Extract

Line  SourceCde

   34

   35 *********************************************************************

   36 * set dbversion for all logs to current version

   37 *********************************************************************

   38   LOOP AT c_s_db_tables-balhdr_u ASSIGNING <l_s_balhdr>.

   39     <l_s_balhdr>-db_version = const_bal_db_ver_current.

   40   ENDLOOP.

   41   LOOP AT c_s_db_tables-balhdr_i ASSIGNING <l_s_balhdr>.

   42     <l_s_balhdr>-db_version = const_bal_db_ver_current.

   43   ENDLOOP.

   44

   45

   46 ***********************************************************************

   47 * delete data tables

   48 ***********************************************************************

   49   IF NOT c_s_db_tables-baldat_d IS INITIAL.

   50     DELETE baldat CLIENT SPECIFIED FROM TABLE c_s_db_tables-baldat_d.

   51   ENDIF.

   52

   53

   54 ***********************************************************************

   55 * insert all tables

   56 ***********************************************************************

   57 * first the data table ...modify

   58   IF NOT c_s_db_tables-baldat_i IS INITIAL.

   59     MODIFY baldat CLIENT SPECIFIED FROM TABLE c_s_db_tables-baldat_i.

   60   ENDIF.

   61 * and then the header table (otherwise another mode might find a

   62 * log header whose data are not completely written on the database)

   63   IF NOT c_s_db_tables-balhdr_i IS INITIAL.

>>>>>     INSERT balhdr CLIENT SPECIFIED FROM TABLE c_s_db_tables-balhdr_i.

   65   ENDIF.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182967
Active Contributor
0 Kudos

Hello RKR,

Check if note 1041894 - SAPSQL_ARRAY_INSERT_DUPREC on BALDAT helps or not.

Regards,

Ning

former_member222381
Participant
0 Kudos

Hi Ning Tong

Thank you for your suggestion,

However this can't be implemented cause our SAP_basis component is 701 release.

In note it is valid from 700 to 700 and that to my source code error in BALHDR not in BALDAT

former_member182967
Active Contributor
former_member222381
Participant
0 Kudos

Hi Tong,

The above Note has been implemented successfully in our qty system.

The Note was implemented successfully and changes was made in program as mentioned in correction.

But still the dump was generating mainly for the job

1.SAP_COLLECTOR_FOR_NONE_R3_STAT

2.SAP_COLLECTOR_FOR_PERFMONITOR

thanga_prakash
Active Contributor
0 Kudos