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

ABAP general

Former Member
0 Likes
443

Dear Experts,

What is the differnce b/w the INSERT, MODIFY, UPDATE ?

Thanx,

Sridhar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
422

Hi,

Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows

1:INSERT: Adding Lines to Database Tables

2:UPDATE: Changing Lines in Database Tables

3:MODIFY: Adding or Changing Lines

1:Insert statement

INSERT statement inserts a single record into the database table.

Syntax

Tables: sflight.

Sflight-carrid = ‘LH’.

Sflight-connid = ‘234’.

Insert sflight.

Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.

2:Update statement

To update database table UPDATE statement is used. This allows you to change either a single record or several records.

You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the

3:MODIFY statement.

The MODIFY statement changes existing lines and inserts lines which do not exist.

Sflight-carrid = ‘MN’.

Sflight-connid = ‘454’.

UPDATE SFLIGHT where CARRID = ‘LH’.

Or

TABLES SFLIGHT.

UPDATE SFLIGHT SET PRICE = 1100

WHERE CARRID = ‘LH’.

Here price of sflight will get updated with new price 1100.

Regards

Fareedas

Hi,

Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows

1:INSERT: Adding Lines to Database Tables

2:UPDATE: Changing Lines in Database Tables

3:MODIFY: Adding or Changing Lines

1:Insert statement

INSERT statement inserts a single record into the database table.

Syntax

Tables: sflight.

Sflight-carrid = ‘LH’.

Sflight-connid = ‘234’.

Insert sflight.

Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.

2:Update statement

To update database table UPDATE statement is used. This allows you to change either a single record or several records.

You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the

3:MODIFY statement.

The MODIFY statement changes existing lines and inserts lines which do not exist.

Sflight-carrid = ‘MN’.

Sflight-connid = ‘454’.

UPDATE SFLIGHT where CARRID = ‘LH’.

Or

TABLES SFLIGHT.

UPDATE SFLIGHT SET PRICE = 1100

WHERE CARRID = ‘LH’.

Here price of sflight will get updated with new price 1100.

Regards

Fareedas

2 REPLIES 2
Read only

Former Member
0 Likes
423

Hi,

Hope this will use for u, assig me points if use...Please read this brief desccription with examples as follows

1:INSERT: Adding Lines to Database Tables

2:UPDATE: Changing Lines in Database Tables

3:MODIFY: Adding or Changing Lines

1:Insert statement

INSERT statement inserts a single record into the database table.

Syntax

Tables: sflight.

Sflight-carrid = ‘LH’.

Sflight-connid = ‘234’.

Insert sflight.

Table sflight is inserted with the record. The SY_SUBRC is returned for this statement. If the entry already exists then the SY_SUBRC is set to non-zero value and you can do processing for existing record by giving some error message.

2:Update statement

To update database table UPDATE statement is used. This allows you to change either a single record or several records.

You can use UPDATE when you know which record you want to change. But if you do not know whether the primary key of the line you want to insert already exists or not, you can use the

3:MODIFY statement.

The MODIFY statement changes existing lines and inserts lines which do not exist.

Sflight-carrid = ‘MN’.

Sflight-connid = ‘454’.

UPDATE SFLIGHT where CARRID = ‘LH’.

Or

TABLES SFLIGHT.

UPDATE SFLIGHT SET PRICE = 1100

WHERE CARRID = ‘LH’.

Here price of sflight will get updated with new price 1100.

Regards

Fareedas

Read only

Former Member
0 Likes
422

Hi

UPDATE updates the existing record

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

INSERT insert new record between existing records