Application Development and Automation 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: 
Read only

SAPSQL_ARRAY_INSERT_DUPREC using BAPI_CONTRACT_CHANGE

Former Member
0 Likes
1,350


Hi all,

I am using BAPI_CONTRACT_CHANGE to change  conditions of contract items.
It works well if I do not change the condition validity in parameter ITEM_COND_VALIDITY/ITEM_COND_VALIDITYX.

But if I want to create a new condition validity, the update request dumps with SAPSQL_ARRAY_INSERT_DUPREC.

Strangely enough, if I use the same data (that creates a dump in my program) in a test sequence in SE37 (BAPI_CONTRACT_CHANGE & BAPI_TRANSACTION_COMMIT), there is no update error and the contract is changed as wanted.

Can anybody help?

Thank you, Kathrin.

7 REPLIES 7
Read only

Former Member
0 Likes
1,104

Hi Kathrin,

Please check may be duplicate records exist in file  or  date related field length that you uploding.

OR

Similar Problem might be due to BALDAT/BALHDR tables as well,

these hold application/system logs.

Could you check some SAP Notes, for e.g. -

Note 656967 - Application log: SAPSQL_ARRAY_INSERT_DUPREC, BALDAT

Note 196113 - SAPSQL_ARRAY_INSERT_DUPREC, BALHDR.

Thank You

Best of luck

Read only

0 Likes
1,104

Hi Arindam,

thanks for your answer.

Currently, I am testing only with just one contract item, so the data I provide does not contain any duplicates.

The dumps occurs during in the update for table A016, function RV_KONDITION_SICHERN_V13A. I had already checked several OSS notes. There are some describing similiar Problems with BAPI_CONTRACT_CHANGE, but none of them is relevant for our release / patch level 😞

Any more suggestions?

Thank you! Regards, Kathrin!

Read only

fabio_passoni
Explorer
0 Likes
1,104

Assign a range to higher contract numbers!

And try again

Read only

0 Likes
1,104

Hi Fabio,

Thanks for your answer, but, I do not quite get it.
I need to change an existing contract, so using a different contract number will not do.

Are you referring to the serial id of the condition?

In a test sequence SE37 the update is working with whatever serial id I am providing in parameters ITEM_COND_VALIDITY  and ITEM_CONDITION - the BAPI always creates a new serial ID here.

I have tried the following:

'old' serial ID (the number determined with BAPI_CONTRACT_GETDETAIL)

new serial ID '0000000001'

temporary serial ids '$000000001'

All of these work fine in SE37, but as soon as I call the BAPI in my program instead of just in SE37, I receive the update error.

Any ideas?

regards, Kathrin.

Read only

Former Member
0 Likes
1,104

Can you attach the dump please?

Read only

0 Likes
1,104

Hi Runda,

I am attaching the dump.

Thanks for your advice, Kathrin!

Read only

0 Likes
1,104

Hi Kathrin,

Thanks.

From the dump it is clear we are trying to insert duplicate records in table A016 which in turn gets populated from ITEM_COND_VALIDITY.

Now since you are saying it works from SE37, I wonder if there is any issue in your program. Note A016 has got Valid-To-Date as Primary key. And Valid From date as a non primary field.

So there is no solution at this moment other than debugging your code. Check if the table ITEM_COND_VALIDITY has got any duplicate entry or blank entry or not.

R