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: 

Table data entry error

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.,

prasanth_kasturi
Active Contributor
0 Kudos

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

0 Kudos

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.