2006 Apr 20 1:30 PM
Hi Experts,
I have an internal table itab with data.
i hace db table ztab.It has 0 entries.
if i want to populate data from itab..which is better method..is Insert or modify
in some cases i got short dump when using :
insert ztab from table itab.
this ztab is copied from ztable(in se11,copy option is there)
But when i use :
modify ztab from table itab..it is exicuting fine.
Can any body give me clarification on this?
Thanks in Advance.
2006 Apr 20 1:33 PM
Hi Jak,
THe insert will throw a short dump if you try to enter a row with same set of primry key field values..
modify will change the contents of the existing row if the set of key field values are same..
so it is better to use MODIFY as it updates if the entry is not found..
regards'
satesh
2006 Apr 20 1:31 PM
Use INSERT when you insert fields in the database.
MODIFY to change existing row or insert if not available.
You might have got error if you try to insert a record with the same key fields.
Message was edited by: Wenceslaus G
2006 Apr 20 1:33 PM
Hi Jak,
THe insert will throw a short dump if you try to enter a row with same set of primry key field values..
modify will change the contents of the existing row if the set of key field values are same..
so it is better to use MODIFY as it updates if the entry is not found..
regards'
satesh
2006 Apr 20 1:36 PM
Hi Jak,
MODIFY: Inserts new lines or updates existing lines of a database table.
The short dump with insert may be due to a duplicate entry.
If you are not sure if an entry with the same key exists or not it is better to use MODIFY always..
Regards,
Suresh Datti
2006 Apr 20 1:37 PM
Hi
I think it depends on what you really want to do.
Anyway if your trx have to create and not update the records, it's better to use INSERT.
The stament INSERT <TABLE> FROM TABLE <ITAB> can get a dump if there are several records with the same key.
Max
2006 Apr 20 1:37 PM
Hi
INSERT ....only inerts data into datadabe table
MOdify ... inserts data when no similar entry is present; it modify if similar entry is present.
According to me for ur case u should use
<b>INSERT dbtab FROM TABLE itab ACCEPTING DUPLICATE KEYS</b>
because when u insert into data base from internal table ;
it will give dump if similar record are present in internal table
i mean that data which ur inserting from itab is already present in database table hence ur getting dump.
please revert bach if solved.
reagards
manoj
Message was edited by: Manoj Gupta
2006 Apr 20 2:34 PM
Hi,
if u want to insert data into database tables use <b>INSERT</b> satetment by using <b>ACCEPTING</b> duplicate values.your program gives short dump because ur passing the primary key more than once.Try to see that primary key feild value in <b>ITAB</b> should exist once.If u want to modify database table u can use <b>MODIFY</b> satement.