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

Insert Duplicate enteries in the table

Former Member
0 Likes
2,027

Hi gurus,

I want to add duplicate enteries in the table, Iam taking the data from the Selection screen and passing it to the table,

But its not accepting the duplicate enteries, so help me on this matter. my key fields are MATNR and WERKS.

What Statement i have to write for that.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,984

Hi Manish,

There is something called Data consistency, whcih ensures that the data is unique & consistent but your requirement seems to be violating these rule.

Why are you trying to add duplicate entry.

MATNR is a key field & it ensures that there wont be any duplicate entries in the table. This is not a feasible requirement.

Regards

Abhii

Edited by: Abhii on Dec 10, 2009 8:02 AM

Hi gurus,

I want to add duplicate enteries in the table, Iam taking the data from the Selection screen and passing it to the table,

But its not accepting the duplicate enteries, so help me on this matter. my key fields are MATNR and WERKS.

What Statement i have to write for that.

12 REPLIES 12
Read only

Former Member
0 Likes
1,985

Hi Manish,

There is something called Data consistency, whcih ensures that the data is unique & consistent but your requirement seems to be violating these rule.

Why are you trying to add duplicate entry.

MATNR is a key field & it ensures that there wont be any duplicate entries in the table. This is not a feasible requirement.

Regards

Abhii

Edited by: Abhii on Dec 10, 2009 8:02 AM

Read only

0 Likes
1,984

actually I have a FISCAL YEAR field in the table, So when the year change, its entries will remain same and its year will only be change. thats why i want to add duplicate fields in the table

Read only

0 Likes
1,984

You should than extend the primary key by that field and it will be possible to add your entries.

Read only

0 Likes
1,984

Hello

What table are you talking about ?

If it Z-table then make field Fiscal Year as KEY FIELD.

Read only

0 Likes
1,984

I am not getting u, plz give some example for it.

Iam using my own Z table

Edited by: Manish Sharma on Dec 10, 2009 8:10 AM

Read only

0 Likes
1,984

Hi Manish,

When you are trying to change only a particular field then go for update or modify statement.

update <dbtable>

set <fiscal field> = <vlaue>

where <condition>.

Regards,

Swarna Munukoti

Read only

0 Likes
1,984

Hi,

Check "key" in se11 for the field that repesents the year. This will extend your unique primary key by that field and will make it possible to save your entries.

Patrick

Read only

0 Likes
1,984

If you want to have multiples entries for MATNR+WERKS, one by YEAR, define YEAR as a primary key, primary keys define unique records. (Also use MANDT as the first key)

Regards,

Raymond

Read only

Former Member
0 Likes
1,984

To add duplicate entries try with APPEND

Regards,

Read only

patrick1905
Explorer
0 Likes
1,984

Hi Manish,

there is no way to save a entry that has the same key values as a other's entry primary keys. You have to alter / extend the primary key to do this.

The field you use to extend the primary key should be one that is different to the other entry and is unique in compination with your other key fields.

Primary Keys are unique and can not be used more than one time. Otherwise you data could not be structered efficent by the database engine and you could not select only one row for deleting etc.

Best regards,

Patrick

Read only

Former Member
0 Likes
1,984

if its Ztable then try to give another key field for serial no.

every time for same matnr increase srno by 1 and for another material again strt this counting from 1.

this key field should be your first field...

With regards

Pardeep Sharma

Read only

Former Member
0 Likes
1,984

HI manish,

your can add duplicate entries in your table by removing Key fileds.

keep all fileds as normal fields or non keyfileds. you can do it.

let me know if you still facing the problem.

~linganna