‎2006 Jul 20 8:32 AM
i have 5 rows with matnr lgort........
i create ztable that matnr lgort ---key
but only 1 row is entered why?????
‎2006 Jul 20 8:37 AM
Hi,
If the entries are duplicate it wont enter in DB table with primary keys.
Rgds,
Prakash
‎2006 Jul 20 8:34 AM
Hello Rani,
You cannot have entries with duplicate keys in the database table. can you specify the values you are trying to enter into your Z-Table?
Regards,
Anand Mandalika.
‎2006 Jul 20 8:35 AM
i
look at this
INSERT INTO ztab VALUES ztab.
<b>data:itab like table of ztab</b> . (an internal table of the type of the Z table into which we want to insert.
Now we have to populate required data into this internal table. For inserting these values into the table ZTAB we can go by 2 different syntax.
1)insert ZTAB from table ITAB or
2)modify ZTAB from tabel ITAB.
‎2006 Jul 20 8:37 AM
Hello RANI.
Before using the insert statement add
SORT ITAB BY MATNR.
DELETE ADJACENT DULPICATES FROM ITAB COMPARING MATNR.
INSERT INTO ZTABL FROM ITAB.
If useful reward.
Vasanth
‎2006 Jul 20 8:37 AM
Hi,
If the entries are duplicate it wont enter in DB table with primary keys.
Rgds,
Prakash
‎2006 Jul 20 8:40 AM
i have matnr
1111111111 lgort 20
1111111111 lgort 10
1111111111 lgort 30
‎2006 Jul 20 8:41 AM
‎2006 Jul 20 8:44 AM
‎2006 Jul 20 8:47 AM
Inserting or Changing Lines
To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following:
MODIFY <target> <lines>.
If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.
If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, that is, the line is changed.
The first syntax inserts the values into the table and if there occurs some duplication you will end in error.
The second syntax inserts into the table the values in ITAB if it is not already present or if already present the existing value is modified with the new value.
Instead of internal table you can also use a workarea where the syntax will be
data: WA type ZTAB.
insert into ZTAB values WA.
hope this helps
‎2006 Jul 20 8:51 AM
‎2006 Jul 20 8:52 AM
Hi,
As others have said, using INSERT statement when there's an existing record will result in error. You can use the MODIFY statement. To know more about the said commands, press F1 while it is highlighted on the command.
Regards!
P.S. Please award points for useful answers
‎2006 Jul 20 8:56 AM
Hi Rani,
U can do it making the third entry of ztable as a key field.
Not Sure but atleast u can have a try.
Thanks
-
Sachin Dhingra
‎2006 Jul 20 9:01 AM
Hi Rani,
Can this way help you.
LOOP AT zins.
UPDATE ztable SET <fields to be updated> = <values>
WHERE matnr = zins-matnr AND
lgort = zins-lgort.
ENDLOOP.
Regards,
Arun Sambargi.
‎2006 Jul 20 9:17 AM
Hi rani,
1. along with mandt,
matnr,
lgort,
<b>u will have to add one more field
as a part of primary key.</b>
(for the values 10,20,30 etc)
2. u can keep this as
ZEILE (like MBLPO Item in Material Document)
( see table MSEG)
3. Then things would get allright.
regards,
amit m.
‎2006 Jul 20 9:04 AM
‎2006 Jul 20 9:15 AM
icant do it i need my ztable because i need to download the data
‎2006 Jul 20 9:19 AM
‎2006 Jul 20 9:17 AM
another problem maybe ir's the solution
i create the key of lgort and the lgort was the no 6 in se11
now it's no 3 mandt,matnr,lgort
if i make se16 i still see it no 6