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

Table data entry error

Former Member
0 Likes
496

Friends,

There are two fields in the ztable: one field that is the primary key and one more field.

I am entering value for the primary key field and I get the error:

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

Please let me know what is missing.

Thanks and Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
469

this is self-explanatory problem. you're trying to insert with the same data in your primary key. put a checking in your prorgram if data exist dont update.,

3 REPLIES 3
Read only

Former Member
0 Likes
470

this is self-explanatory problem. you're trying to insert with the same data in your primary key. put a checking in your prorgram if data exist dont update.,

Read only

prasanth_kasturi
Active Contributor
0 Likes
469

hi,

As you know primary key is to avoid duplicate entries in the table,

I think you are entering records with same primary key.

I think its better to change your primary key, or take care duplicate entries are not inserted

regards

prasanth

Read only

0 Likes
469

Hi,

The error is because there is already a similar record existing in the database.

Check if sy-subrc = 0 just after the select statement, which will indicate that the record already exists.

You will have to give different name (primary key) for inserting a new record.

Hope this solves the problem.

Regards,

Darpana.