Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

diff between update & modify

Former Member
0 Likes
3,389

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,802

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.

5 REPLIES 5
Read only

Former Member
0 Likes
1,803

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.

Read only

Former Member
0 Likes
1,802

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

Read only

Former Member
0 Likes
1,802

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

Read only

Former Member
0 Likes
1,802

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.

Read only

Former Member
0 Likes
1,802

thanks