【单条记录锁】select single for update

示例:

DATA: wa_t001 type t001.

select single for update * into wa_t001 from t001 where bukrs = '1000'.

解释:

select single for update,where条件必须涵盖所有主键。

执行时,该语句会锁定满足条件的单条数据(在SM12中是看不到的)。

锁定退出条件:执行到commit或rollback。

补充:

如果有其他的select single for update访问到同样的数据,会一直等待直到被锁定的记录解锁。

----------------------------------------------

本博客所有原创文章,未经博主允许,请勿转载。

----------------------------------------------

原文地址:https://www.cnblogs.com/abap-ll/p/5012287.html