May 2019
Beginner to intermediate
548 pages
12h 39m
English
The FOR UPDATE statement can be used to set an exclusive lock for a selected row. However, if we have more than one entry with the same primary key, the result set will be empty. Consequently, it is really important to specify a full key. Furthermore, when our FOR UPDATE statement causes deadlock, an exception will be raised. When we use the FOR UPDATE statement, it is also important for the SELECT statement to bypass SAP buffering.
An example of SELECT SINGLE FOR UPDATE is as follows:
SELECT SINGLE FOR UPDATE carrid connid FROM sflight INTO CORRESPONDING FIELDS OF TABLE gs_sflight WHERE carrid EQ 'AA' AND connid EQ '0017' AND fldate GT '01.01.2015'.
Read now
Unlock full access