ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Write Accesses → 

UPDATE dbtab  Syntax Diagram

Short Reference

Syntax

UPDATE target source.

Effect

The statement UPDATE changes the content of one or more rows of the database table specified in target. The entries in source determine which columns of which rows 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 When SET was specified in source, at least one row was changed. When a work area was specified in source, the specified row was changed. When an internal table was specified in source, all specified rows were changed or the internal table is empty.
2 If a LOB handle structure with a component for writer streams or a reference variable for writer streams was specified after SET, the components which are not associated with writer streams were not yet written to the database, but instead are passed when the stream is closed at latest. Whether this situation occurs or not depends on the database. Refer to LOB handles.
4 When SET or a work area was specifed in source, no row was changed; or when an internal table was specified in source, not all specified rows were changed. This is either because no appropriate row was found, or because the change would generate a row that produces duplicate 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 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).

Notes




Continue
UPDATE dbtab - target
UPDATE dbtab - source
UPDATE dbtab - set_expression