UPDATE dbtab - set_expression

Syntax

... [col1 = f1 col2 = f2 ... ]
    [col1 = col1 + f1 col2 = col2 + f2 ...]
    [col1 = col1 - f1 col2 = col2 - f2 ...]
    [(expr_syntax1) (expr_syntax2) ...] ... .


Extras:

1. ... col = f

2. ... col = col + f

3. ... col = col - f

4. ... (expr_syntax)

Effect

Change-expressions for the addition SET for the statement UPDATE.

Addition 1

... col = f

Effect

Assignment of a value. For col, columns of the database table given in target or in the stated view dbtab can be specified through a column identifier comp or dbtab~comp. For f, data objects of the ABAP program or a column identifier dbtab~comp of another column in the database table can be used.

The statement UPDATE assigns the content of f to the columns col in all the rows defined by the WHERE condition. If the data types are not compatible, conversion is as follows:

if, for f, a column is specified, changes to this column that are made in the same UPDATE statement are not taken into consideration during the assignment.

If a column col appears in several change-expressions, the last corresponding change-expression takes effect.

Addition 2

... col = col + f

Effect

Addition of a value. For col and f, the same applies as for the assignment of a value. col must have a numeric data type, however.

The statement UPDATE adds - in all the rows defined by the WHERE condition - the value of f to the content of the column col. Otherwise, the same rules apply as for the assignment of a value.

Addition 3

... col = col - f

Effect

Subtraction of a value. For col and f, the same applies as for the assignment of a value. However, col must have a numeric data type.

The statement UPDATE subtracts - in all the rows defined by the WHERE condition - the value of f from the content of the column col. Otherwise, the same rules apply as for the assignment of a value.

Addition 4

... (expr_syntax)

Effect

Dynamic specification of change-expressions. A change- expression can be specified as a bracketed data object expr_syntax that - at execution of the statment - either contains the syntax of one or several static change-expressions or is initial. The data object expr_syntax can be a character-type data object or an internal table with character-type data type. The syntax in expr_syntax is - as in the ABAP Editor - independent of uppercase/lowercase lettering. In the specification of an internal table, the syntax can be split up into several lines.

If expr_syntax is initial at execution of the staement, the change-expression is ignored.

Note

If expr_syntax is an internal table with a header line, not the header line but the table body is evaluated.