SAP MODIFY DBTAB ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for MODIFY_DBTAB

MODIFY dbtab

Short Reference
• MODIFY dbtab ABAP Statement


ABAP Syntax MODIFY target FROM
source.

What does it do? The MODIFY statement inserts one or more rows specified in source in the database table specified in target, or overwrites existing rows.

System Fields The statement MODIFY sets the values of the system fields sy-subrc and sy-dbcnt. sy-subrcMeaning 0When a work area was declared in source, the specified row was inserted or modified. When an internal table was specified in source, all specified lines were inserted, modified, or the internal table is empty. 2When a LOB handle structure was specified with a component for writer streams, the non-LOB handle components were not yet written to the database, but instead are passed when the stream is clased, at the latest. Whether this situation occurs or not depends on the database. Refer to LOB handles. 4When a work area was specified in source, no rows were processed, or when an internal table was specified in source, not all specified rows were processed because there is already a row with the same unique secondary index in the database table.

The statement MODIFY sets sy-dbcnt to the number of processed rows. If an overflow occurs because the number or rows is greater than 2,147,483,647, sy-dbcnt is set to -1. If sy-subrc is 2, sy-dbcnt is also set to the value -1 (for undefined).

Latest notes:The changes are committed to the database by the next database commit. Until that point, they can still be undone using a database rollback The statement MODIFY sets a database lock until the next database commit or rollback. If used incorrectly, this can produce a deadlock . The number of rows that can be inserted or modified 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.

...More SAP MODIFY Examples

Return to menu