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 and modify

Former Member
0 Likes
5,271

hi everyone,

plz help me in findind the difference between update and modify statements in open sql.

thakns

aafaq husain.

6 REPLIES 6
Read only

Former Member
0 Likes
4,619

go through this link...

Read only

Former Member
0 Likes
4,619

MODIFY - Will update the table, if the data already exists, if NOT inserts new rows.

UPDATE - Will update the table, errors out if the data is not found.

In case of MODIFY the sy-subrc is always 0 so you would't know whether the data is actually updated or not.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
4,619

hi,

modify means if record is not present it'll creat a new one.if record is present it'll modify it...

but update if record is present then only it modifies..

Read only

Former Member
0 Likes
4,619

Hi Husain!

Upadte: If the key record is existing in the DBtable the key record will update success fully then sy-subrc will eq 0 or else update fails and sy-subrc will non-zero.

Modify: if the key record is existing in the DBtable then the the record will update/modify else if the key record is not existing then it will insert the new record

in dbtable.

simply to say:

modify play two roles upadate and insert depends on record existing or not.

cheers

ganesh

Read only

Former Member
0 Likes
4,619

HI Hussain,

'Insert' will add a new record or a new row into the database table.

'Update' will modify a record in the DB table.

'Modify' it is a combination of both insert and update...

Also check these links

Regards,

Susmitha

Read only

Former Member
0 Likes
4,619

thanks