Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAPSQL_ARRAY_INSERT_DUPREC on table OBJK - after WS_DELIVERY_UPDATE (FM)

Former Member
0 Kudos

Hi fellow SAP dudes,

Got a pretty big problemo.

I am using the BAPI - BAPI_OUTB_DELIVERY_CHANGE to create batch splits and add serial no's to an outbound delivery (type H)

I then call the FM - WS_DELIVERY_UPDATE to post goods issue the delivery.

Problem being is that Im hitting a short dump - See Below:

Has anyone hit this before? I pretty sure it has to do with the Serial Numbers (they are updating in table OBJK).

Any help would be ace.

cheers,

Todd

Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC

Except. CX_SY_OPEN_SQL_DB

Date and Time 25.08.2009 15:06:20

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 "SAPLIPW1" 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 "OBJK_POST_UPDATE_N" "(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.)

cheers,

Todd

1 ACCEPTED SOLUTION

jaideepsharma
Active Contributor
0 Kudos

Hi,

If you are calling the function module in the loop then Check if you are clearing all the variables after each iteration of loop before passing to WS_DELIVERY_UPDATE. You can use function modules like LE_DELIVERY_REFRESH_BUFFER to clear buffer areas.

KR Jaideep,

8 REPLIES 8

Former Member
0 Kudos

Hi Todd,

Looks like an entry is already present in table 'OBJK' (which is being updated here) for the OBKNR(Object list number) & OBZAE(Object list counters) combination for the serial numbers that are being added.

Please check if the data being added is already present in that table.

Hope it helps.

jaideepsharma
Active Contributor
0 Kudos

Hi,

If you are calling the function module in the loop then Check if you are clearing all the variables after each iteration of loop before passing to WS_DELIVERY_UPDATE. You can use function modules like LE_DELIVERY_REFRESH_BUFFER to clear buffer areas.

KR Jaideep,

0 Kudos

Dhanya - Thanks for your reply but that is the whole problem. Im not putting anything in that table the SAP standard FM's are.

Jaideep - That's exactly what I thought, and I have tried the buffer refresh to no avail.

Really stuck on this. Anyone?

0 Kudos

I've found a way around it.

Called the WS_DELIVERY_UPDATE in a seperate program via a SUBMIT call.

Not the best solution - but it works.

Former Member

I had the same problem. I solved it by calling SERIAL_INTTAB_REFRESH before WS_DELIVERY_UPDATE.

I found the solution by looking the the IDoc handler for DELVRY : Function module IDOC_INPUT_DELVRY

0 Kudos

Thanks Kim.

You solved my issue!!

former_member314224
Discoverer

When a Delivery is created using Bapi and if updating Serial numbers , use the FM

CALL FUNCTION 'SERIAL_INTTAB_REFRESH'

EXPORTING objects_status_refresh = 'C'. This resolves the issue while doing PGI.

Or else call fm WS_DELIVERY_UPDATE2 using DESTINATION 'NONE'

PS: For reference I am updating this thread.

0 Kudos

it resolved my problem.

Thank you Meghasyam.