‎2007 Apr 18 8:10 AM
hi can anyone explain me that what is the diff between update & modify.
whether i can modify the database table with modify statement .
if yes then how?
‎2007 Apr 18 8:13 AM
Sanjeev,
UPDATE is only for database tables updation.
But MODIFY can be used to Modify Database tables, Internal Tables, Output Lists, and also for changing screen attributes.
Regards,
Sujatha.
‎2007 Apr 18 8:13 AM
Sanjeev,
UPDATE is only for database tables updation.
But MODIFY can be used to Modify Database tables, Internal Tables, Output Lists, and also for changing screen attributes.
Regards,
Sujatha.
‎2007 Apr 18 8:18 AM
Hi,
<b>MODIFY:</b>
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.
For performance reasons, you should use MODIFY only if you cannot distinguish between these two options in your ABAP program.
<b>UPDATE:</b>
The Open SQL statement for changing data in a database table is:
UPDATE <target> <lines>.
It allows you to change one or more lines in the database table <target>. You can only change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table <target> either statically or dynamically.
Regards
Sudheer
‎2007 Apr 18 8:19 AM
From a DB perspective
Update updates a DB table record(s). It cannot be used for creating a new record
Modify updates a record if it finds one else it will create a DB record if no corresponding record(with a Primary key specified by the work area used for updating) exists.
Cheers
Kareem
‎2007 Apr 18 8:20 AM
Hi Sanjeev,
Both are same functionality. but the main differnece is..
UPDATE : when you update the records in dbase table , that record must be avilablein that table. otherwise .. it does not update that record.
MODIFY: when you MODIFY the records in dbase table , there is no required
that record must be there in that table.if that record is there it modify that record
otherwise it ADDS the new record into the table.
Rewards if it is helpful,
regards,
vijay.
‎2007 Apr 18 8:20 AM