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

WHAT IS THE DIFFERENCE BETWEEN MODIFY AND UPDATE

Former Member
69,357

HI

WHAT IS THE DIFFERENCE BETWEEN MODIFY AND UPDATE

HI

WHAT IS THE DIFFERENCE BETWEEN MODIFY AND UPDATE

13 REPLIES 13
Read only

Former Member
21,949

Hi,

Modify means it going to modify the record if it exists. If record is not there it going to add that record. Update means it is only modify the record.

Thanks

Sarada

Read only

0 Likes
21,949

hi,

this is paramesh .

i agrree with your ans

thanks

Read only

Former Member
0 Likes
21,949

Hi,

UPDATE Is used to modify a existing record,

where as modify fulfills both the requierment.

it modifys the record if it is already present.

or creates a new record if it is not present already.

reward points if its helpfull

regards

Chandrra

Read only

Former Member
0 Likes
21,949

Hi,

MODIFY for Lists

Changes a list line.

Syntax

MODIFY LINE <n> [INDEX <idx>] [OF CURRENT PAGE|OF PAGE <p>]

|CURRENT LINE

LINE FORMAT <option1> <option2>...

FIELD VALUE <f1> [FROM <g1>] <f2> [FROM <g2>]...

FIELD FORMAT <f1> <options1> <f2> <options2>.

Changes either line <n> on the current or specified list (or page), or the last line to be chosen. The exact nature of the change is specified in the additions

MODIFY SCREEN

Changes the SCREEN table.

Syntax

MODIFY SCREEN...

Like changing an internal table. The system table SCREEN contains the names and attributes of all of the fields on the current screen.

UPDATE

Changes entries in database tables.

Syntax

UPDATE <dbtab> SET <si> = <f>

|<si> = <s i> + <f>

|<si> = <s i> - <f> [WHERE <cond>].

The value in the column <si> is set to the value <f>, increases it by <f>, or decreases it by <f> for all lines selected. The WHERE clause specifies the lines that are changed. If you omit the WHERE clause, all lines are changed.

Syntax

UPDATE <dbtab> FROM <wa>.

UPDATE <dbtab> FROM TABLE <itab>.

This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length and alignment as the lines of the database table.

Hope it will be useful.

Regards,

Priya.

Read only

Former Member
0 Likes
21,949

This message was moderated.

Read only

Former Member
0 Likes
21,949

Lastly to modify the contents of the list, the modify command can be used. There are two approaches to this.

modify line <n> [index <idx>|of current page|of page <p>] [<modifications>].

This command is used to specify the list number, page and line that needs to be modified with the new values.

Modify current line [modifications].

This modifies the line last selected.

Tip : To avoid having to specify the modifications, make the changes to the variable SY-LISEL. These changes will be reflected in the list.

The format of a line can also be changed using the MODIFY..FORMAT command.

Eg:

Modify current line format color = 6.

update

if the record is already existing then the record is updated otherwise the record is added.

Read only

Former Member
0 Likes
21,949

with modify option we can do the modifications to the already existing one.

with update we can do the update to the already existing one.if that is not there at that time it creates new one.

modify is onle modify the record if exists.

update is update the record.if not creates new one.

Read only

Former Member
0 Likes
21,949

HI

UPDATE updates the existing record

MODIFY updates the existing record if record not found it creates new record

Edited by: Jyothsna M on Feb 26, 2008 5:43 AM

Read only

Former Member
0 Likes
21,949

hi,

refer to the thread

With Modify Option, If the current record is already available in the

database, it will update the

Changes. If it not available it will insert as a new record.

INSERT - Add a new record into the database table.

MODIFY - If record is available it modifies otherwise it wont modify.

UPDATE - If record is available its update the record otherwise it creates a new record.

insert-used to insert the records modify-used for alter the table field names update-used for modify the data

insert:Insert a set of new data’s into database table., update:Chance the existing data field in data base table., modify:If the record is present then you how to Update the data’s otherwise,Insert the new data.,

Regards,

sreelakshmi

Read only

Former Member
0 Likes
21,948

Hi Jyotsna,

The syntax for modify database table

MODIFY target FROM source.

The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.

UPDATE target source

The statement UPDATE changes the content of one or more lines of the database table specified in target. The entries in source determine which columns of which lines are changed, and how they are changed.

Thanks,

Meghana

Read only

Former Member
0 Likes
21,948

MODIFY AND UPDATE hae different meainings in terms of database tables nd internal tables.

In the case of database tables modify will update and record if it is already existing.if the record does not exixt then modify will insert the record in the database table.

In the case of internal tables modify will change the record only if it exists and update will also change the record of an internal table.

Read only

Former Member
0 Likes
21,948

hi,

These UPDATE is used only in database table... MODIFY is used in both DB and internal tables.

Modify:The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines

Update:The statement UPDATE changes the content of one or more lines of the database table.

Thanks

Arunprasad.P

Read only

Former Member
0 Likes
21,948

MODIFY - Change a database table

Variants

1. MODIFY dbtab. or

MODIFY *dbtab. or

MODIFY (dbtabname) ... . .

2. MODIFY dbtab FROM TABLE itab. or

MODIFY (dbtabname) FROM TABLE itab.

3. MODIFY dbtab VERSION vers. or

MODIFY *dbtab VERSION vers.

Effect

Inserts new lines or updates existing lines in a database table . If a line with the specified primary key already exists, an INSERT is executed. Otherwise, an UPDATE is performed. You can specify the name of the database table either in the program itself in the form MODIFY dbtab ... or at runtime as the contents of the field dbtabname in the form MODIFY (dbtabname) ... . In both cases, the database table must be defined in the ABAP/4 Dictionary.

UPDATE

Variants

1. UPDATE dbtab SET s1 ... sn.

2. UPDATE dbtab. or

UPDATE *dbtab. or

UPDATE (dbtabname) ... .

3. UPDATE dbtab FROM TABLE itab. or

UPDATE (dbtabname) FROM TABLE itab.

Effect

Updates values in a database table (see Relational database ). You can specify the name of the database table either directly in the form dbtab or at runtime as contents of the field dbtabname . In both cases, the table must be known to the ABAP/4 Dictionary . If you specify the name of the database table directly, the program must also contain an appropriate TABLES statement. Normally, lines are updated only in the current client. Data can only be updated using a view if the view refers to a single table and was created in the ABAP/4 Dictionary with the maintenance status "No restriction".

UPDATE belongs to the Open SQL command set.

Hope this helps.

Thanks,

Balaji