‎2014 Mar 12 6:29 AM
Hi all,
I am facing one issue..
There are two tables, one is the header amd the other is transaction table..
I have assigned a primary key to one field in the header table and assigned the same field as foreign key in the transaction table.
The issue is in the transaction table. I have 3 records with same number. But the system allows only one record to get inserted.
Foreign key concept is not applicable to this.
Any solution?
‎2014 Mar 12 6:48 AM
Hi Yash,
I don't think this has to do with the foreign key settings.
You probably have only that number as the primary field in your item table.
Mark the item number or line number or whatever the field is to distinguish between the records with same number also as a primary field. Then you will be able to insert more records for the same number.
‎2014 Mar 12 6:35 AM
Hi, It should be combination with item number then only it will allow you create the multiple records in the item table , means your item table should of two primary key one is main field + item as primary key, For Refernce check in VBAK and VBAP table.
‎2014 Mar 12 6:58 AM
‎2014 Mar 12 6:48 AM
Hi Yash,
I don't think this has to do with the foreign key settings.
You probably have only that number as the primary field in your item table.
Mark the item number or line number or whatever the field is to distinguish between the records with same number also as a primary field. Then you will be able to insert more records for the same number.
‎2014 Mar 12 7:28 AM
Hi,
Please tell us what the primary key is in the transaction table. Are the primary key and foreign key the same in the transaction table? If yes, you should add one new field (for example, a sequence number field ) to the primary key in the transaction table.
‎2014 Mar 12 7:35 AM
If you require zero to many items for a single header (not very original, isn't it) you must add a significantfield or a counter-type number in the item table. Look at any similar transaction tables like EKKO/EKPO, MKPF/MSEG or many other header/detail couples.
Remember the primary key implies uniqueness (and not-null too)
Regards,
Raymond
‎2014 Mar 12 7:48 AM
primary key will not accept duplicate entry..
to solve this problem you have to add one more primary key..
assume you have two primary keys RECORD and SERIAL_NO, & you have records with same number number, then you can enter it like..
RECORD SERIAL_NO
record1 1
record1 2
record1 3