Just check the documentation in INSERT and MODIFY.
INSERT dbtab
INSERT { {INTO target VALUES source }
| { target FROM source } }.
Effect
The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
System Fields
The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc | Meaning |
0 | At least one row was inserted. |
4 | At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index. |
- The INSERT statement sets sy-dbcnt to the number of rows inserted.
Note
- The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
- The statement INSERT sets a database lock until the next database commit or rollback. If used incorrectly, this can lead to a deadlock.
- The number of rows that can be inserted in the tables of a database within a database LUW is limited, since a database system can only manage a limited amount of locks and data in the rollback area.
Example, INSERT INTO ztable VALUES wa_ztable
MODIFY dbtab
Effect
The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
System fields
The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
sy-subrc | Meaning |
0 | All lines were inserted or changed. |
4 | At least one line could not be processed as there is already a line with the same unique name secondary index in the database table. |
The MODIFY statement sets sy-dbcnt to the number of processed lines.
Note
The changes are finally transferred to the database table with the next database commit. Up to that point, they can be reversed with a database rollback.
- The MODIFY statement sets a database lock until the next database commit or database rollback; incorrect usage can result in a deadlock .
- The number of rows that can be inserted into or changed in the tables of a database within a database LUW is restricted database-specifically by the fact that a database system can only manage a limited amount of locks and data in the rollback area.
EXAMPLE : MODIFY ztable FROM wa_ztable.
UPDATE dbtab
Syntax
Effect:
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.
System fields
The statement UPDATE sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc | Meaning |
0 | At least one line has been changed. |
4 | At least one line was not able to be changed, either because no appropriate line was found, or because the change would generate a line that leads to double entries in the primary key or a unique secondary index in the database table. |
The statement UPDATE sets sy-dbcnt to the number of changed lines.
Note
The changes are definitively copied to the database with the next database commit. Until that point, they can still be undone using a database rollback
- The statement UPDATE sets a database lock up to the next database commit or rollback, which may lead to a deadlock if used incorrectly.
- For the specific database, the number of rows that can be changed within a database LUW in the database table is restricted by the fact that a database system can only manage a certain amount of data in the rollback area and from locks.