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: 

BAPI_CONTRACT_CREATEFROMDATA - Runtime Erorr: SAPSQL_ARRAY_INSERT_DUPREC

Former Member
0 Kudos

Hi All,

I have an upload program creating Sales Contract(VA41) using BAPI_CONTRACT_CREATEFROMDATA and follow all the guidelines on how to use it - Note 366265 (https://service.sap.com/sap/support/notes/366265). I ensure that I'm the UPDATEFLAG with 'U' if i'll be modifying the Sales Contract Data, otherwise it will be ' '. Moreover, I also ensure the fields that I'm updating is also flag with 'X' .

Scenario:

1. Create a Sales Contract

2. Reload data, using the same Sales Contract Number created from Step 1

Issue: The issue occurred after the BAPI_TRANSACTION_COMMIT.

Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC

Exception CX_SY_OPEN_SQL_DB

Termination occurred in the ABAP program "SAPLV05I" - in "SD_PARTNER_UPDATE".

The main program was "RSM13000 ".

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

of the (Include) program "LV05IU15".

The program "SAPLV05I" was started in the update system.

The termination is caused because exception "CX_SY_OPEN_SQL_DB" occurred

procedure "SD_PARTNER_UPDATE" "(FUNCTION)", but it was neither handled lo

nor declared

in the RAISING clause of its signature.

I inserted external breakpoint on the SD_PARTNER_UPDATE FM, but it does not stop there. I also looked for relevant OSS notes, but most of them are already implemented in our system.

Anyone who encountered this one?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

external debugging wont just trigger like that because this FM might be running in update task.. so start your debugger before the commit statement and in the debugger setting(menubar).. check all 3 debugging options.. then it will stop at the break point you intend to stop at.

and the error what you are referring to means you are inserting the same record twice.. check the key on the dump statement.. in ST22 itself you can see what are the key values .. no need to debug even..

3 REPLIES 3

Former Member
0 Kudos

external debugging wont just trigger like that because this FM might be running in update task.. so start your debugger before the commit statement and in the debugger setting(menubar).. check all 3 debugging options.. then it will stop at the break point you intend to stop at.

and the error what you are referring to means you are inserting the same record twice.. check the key on the dump statement.. in ST22 itself you can see what are the key values .. no need to debug even..

0 Kudos

Hi,

forgot to mention, yes I also enabled the Update debugging. but the catch here is that BAPI_CONTRACT_CREATEFROMDATA should not INSERT new record, but rather should UPDATE. Nonetheless, the BAPI was able to update fields in SD.

I'm just curious and would like to trace why that Runtime is occurring.

Thanks.

0 Kudos

for that you goto ST22... read the stack.. read the variables.. so that you know from where what is getting triggered,, you dont really have to debug always