Chapter 14 - Logical Locking
Chapter 14 - Logical Locking
Logical Locking
Objectives
Overview
Exit Update
Academy Awards
Year 1994
Category PIC
Winner Forrest Gump
Notes Great movie !!!
Critic Ellen Enter Name Currently, multiple users can edit
the same record at the same time.
Exit Update We will learn how to prevent this
occurrence.
Academy Awards
Year 1994
Category PIC
Winner Forrest Gump
Notes What about Pulp Fiction?!?
Critic Mark Enter Name
3 Logical Locking | Dec-2008 © 2005 IBM Corporation
IBM Global Services
Database ABAP
Table Program
Lock Objects
To use SAP’s logical locking mechanism, you need to define a lock object.
A lock object is an ABAP Dictionary object.
ABAP
ABAP Dictionary
Dictionary Lock
Object
Primary Lock
Table Arguments
AAYEAR
YMOVIE
CATEGORY
To use SAP’s logical locking mechanism, you need to define a lock object.
A lock object is an ABAP Dictionary object.
Lock
ABAP
ABAP Dictionary
Dictionary
Object
Primary Lock
Table Arguments
AAYEAR
YMOVIE
CATEGORY
Function Modules
Demonstration
Using lock objects for locking and unlocking data before and after database
updates.
Practice
Using lock objects for locking and unlocking data before and after database
updates.
Summary
Database locks on records are automatically created by the system. The system
releases a database lock at every database commit (i.e., at every screen
change).
Records are automatically “unlocked” at every screen change, we cannot rely on
database locks to prevent multiple users from editing the same record at the
same time in a multi-screen transaction.We can handle this problem with logical
locks.
To use SAP’s logical locking mechanism, you need to define a lock object. When
you activate a lock object, the system automatically generates two function
modules: “ENQUEUE_<lock object name>” and “DEQUEUE_<lock object
name>” .
It is important to understand that logical locks do not create locks at the database
level. Logical locks are maintained through entries in a lock table.
Transaction “SM12” will display the current entries in the lock table.
Questions
Screen 9000
Screen 9001