‎2007 Jun 26 11:10 AM
HI,
WHAT IS THE DIFF B/W MODIFY AND UPDATE
THANK YOU
ASHOK KUMAR
‎2007 Jun 26 11:16 AM
‎2007 Jun 26 11:12 AM
Hi Ashok,
Update:It will update the table records only if there is entry in the table.
Modify:It will update the table records ,if there is entry in the table.If not then it will insert that record.
‎2007 Jun 26 11:13 AM
hi,
Modify will update already exitsing record, create a new record if it not already exits in databse.(it work both functional create ,update)
Update will update if it already exits in databse.
Regards,
Richa
‎2007 Jun 26 11:22 AM
HI ,
I MY TABLE NO DATA IS FOUND . BUT IA USING UPDATE WHAT WILL HAPPENS
‎2007 Jun 26 11:36 AM
If there is no record, and you are using update
it will not update . ( Coz there is no entry )
here sy-subrc will be set other than zero .
Here you need to use 'modify'.
it will insert the same record .
modify = update + insert
~ Laxmi
Reward helpful answers
‎2007 Jun 26 11:36 AM
Hi Ashok,
If you are updating a table using <b>Update</b> statement and assume that no records is there in that table,then the update statement willl return sy-subrc = 4 which means that no record is updated or inserted.
‎2007 Jun 26 11:37 AM
Hi,
Data will be inserted.Sy-subrc eq 4.
If you use modify,data will inserted in such a situtation.
data : itab type standard table of mara,
wa type mara,
wa1 type mara.
select * from mara into table itab.
loop at itab into wa.
wa-matnr = '12345'.
modify mara from wa.
commit work.
exit.
endloop.
‎2007 Jun 26 11:14 AM
HI.
Modify:it will update already exitsing record,create new one if it not already exits in databse.(it work both functional create ,update)
Update:update if it already exits in databse.
Rewards all helpfull answers.
Regards.
Jay
‎2007 Jun 26 11:15 AM
Hi,
<b>Update</b>
It will update the table records only if there is entry in the table.
<b>Modify</b>
It will update the table records ,if there is entry in the table.If not then it will insert that record.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
‎2007 Jun 26 11:16 AM
‎2007 Jun 26 11:24 AM
Hi.
It will insert a new record.
Reward if helpful.
Regards,
Umasankar.
‎2007 Jun 26 11:35 AM
Update:It will update the table records only if there is entry in the table.
Modify:It will update the table records ,if there is entry in the table.If not then it will insert that record.
‎2007 Jun 26 11:39 AM
Hello Ashok,
update is to update table entries.
modify is also to update the table entries... if no record is there it will insert new record.
Regards
--
Sasidhar Reddy Matli.
‎2008 May 08 3:54 PM
‎2008 May 08 3:58 PM
sounds that MODIFY is better and should always be used, but that is not true. Why not?
‎2008 May 08 5:50 PM
Because MODIFY is a bit more expensive because it has to check whether the record exists or not before it tries to update or insert it? But I would have thought that the extra time taken would be miniscule and hardly noticeable. Though that would depend on the number of records you were updating..
In some situations, you need to do different things when you insert or update, and MODIFY wouldn't be any good then.
‎2008 May 08 6:23 PM
If the report you are creating will be used for changing values in a table and you aren't sure if the record exist in a table, you should user MODIFY. You have to be aware that MODIFY only changes values in fields that aren't key fields, otherwise the record would be inserted in the table instead of be updated.
But, if the report will be used only for changing values in a table, you should use UPDATE.