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

ACCEPTING DUPLICATE KEYS

Former Member
0 Likes
890

Hello, I can use

INSERT ZPEDIDOSCAB CLIENT SPECIFIED FROM TABLE IT_AUXCAB ACCEPTING DUPLICATE KEYS.

but it only insert one line.why??

SY-SUBRC = 4 AND SY-DBCNT =1. So only insert one row.

How can I change that?

Thanks

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
790

Hi Ana,

This may be the casue "If, for one or more of the rows to be inserted, a row with the same primary key or the same unique secondary key already exists and the ACCEPTING DUPLICATE KEYS addition is specified, the rows are not inserted and sy-subrc is set to 4. If, in this case, the addition ACCEPTING DUPLICATE KEYS is not specified, no rows are inserted. Prior to Release 6.10, this raises an exception that cannot be handled; as of Release 6.10, this raises the exception that can be handled CX_SY_OPEN_SQL_DB. "

Rgds,

Sandeep

Read only

Former Member
0 Likes
790

Hi,

ACCEPTING DUPLICATE KEYS addition never inserts duplicate records into table it only avoids system dump when trying to insert duplicate.

reward if solved*

Read only

Former Member
0 Likes
790

Hi,

How many records you got in IT_AUXCAB?

Only those many records will get inserting by deleting the duplicates.

Reward if it helps,

Satish

Read only

Former Member
0 Likes
790

I changed the key fields.