on 12-04-2007 10:28 PM
Hello,
I need to insert records into a custom table 'ZDATA' from a program.
The table fields are: KUNNR VBELN POSNR MATNR PRSDT ZDATE ZTIME.
Among these the key fields are: <b>KUNNR VBELN POSNR MATNR</b>.
For eg: the table already has the records like:
<b>
<u>KUNNR|VBELN|MATNR|POSNR|PRSDT|ZDATE|ZTIME|</u></b>
10001|12356|00001|14056|08/12/2006|12/04/2007|11:15:23
10001|12356|00002|14057|08/12/2006|12/04/2007|11:15:23
10001|12356|00003|14058|08/12/2006|12/04/2007|11:15:23
10001|12356|00004|14059|08/12/2006|12/04/2007|11:15:23
10001|12356|00005|14052|08/12/2006|12/04/2007|11:15:23
10001|12356|00006140563|08/12/2006|12/04/2007|11:15:23
Now, I want to insert more records into this table for the same KUNNR VBELN MATNR POSNR PRSDT ZDATE but with different and ZTIME.
Eg:
<b>
<u>KUNNR|VBELN|MATNR|POSNR|PRSDT|ZDATE|ZTIME|</u></b>
10001|12356|00001|14056|08/12/2006|12/04/2007|12:00:00
10001|12356|00002|14057|08/12/2006|12/04/2007|12:00:00
10001|12356|00003|14058|08/12/2006|12/04/2007|12:00:00
10001|12356|00004|14059|08/12/2006|12/04/2007|12:00:00
10001|12356|00005|14052|08/12/2006|12/04/2007|12:00:00
10001|12356|00006140563|08/12/2006|12/04/2007|12:00:00
Can anybody please let me know how can I insert these <b>"duplicates"</b>(although these are not duplicates, technically)?
Do I have to add more key fields?
FYI....The ZDATE and ZTIME are the SY-DATUM and SY-UZEIT.
Thanks much.
Hi,
Since the Key field combination is with only 4 fields, it accepts different values if any of the value of 4 fields is different that is not existing.
So add ZDATE and ZTIME also as the key fields and adjust the database first using the menu UTILITIES--> DATABASE OBJECT --> DATABASE UTILITY --> ACTIVATE AND ADJUST DATABASE.
Reward if it is useful.
Thanks,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Include your ZDATE and ZTIME into the key like:
<b> KUNNR VBELN POSNR MATNR PRSDT ZDATE ZTIME.</b>
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont think it will accept the duplicate records. use more key fields or delete from internal table if you dont want to insert. use delete adjusent duplicates to delete from itab. or like the other guy said, add key fields and then adjust the table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do this
INSERT ZDATA FROM TABLE ITAB ACCEPTING DUPLICATE KEYS.
Regards,
Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.