Post transferred from
Http://scnblogs.techweb.com.cn/frankyue2001/archives/546.html
Reference
Http://scnblogs.techweb.com.cn/abap/archives/6.html
In SAP, when you use the modified (new) Transaction code to maintain data, the system locks the data-related table to prevent other users from simultaneously storing the data.
For example, if user a is maintaining factory data for material 1001 at the factory 1000, and user B is also maintaining material 1001 at the factory 1000, the system will prompt that, prompt User B that the material has been locked under factory 1000.
According to the current operation, the system will lock the specific entries in the table.
In the following example, table entries are locked.
1.1.1 operating instance
In client 820, user s821 uses the transaction code mm02 to modify the sales view of the T-ASA02's material master data.
Execute the transaction code sm12.
Field "User Name": Enter s821 in the user name. If you do not enter s821, all the users in the current system are locked.
Field "lock parameter"
If you want to query a specific object (for example, WHO has locked the material AAA), you can enter the specific object and object Value in the lock parameter. Wildcards can be used, such as * AAA *.
Execute the transaction code and view the result as shown in.
The field "time" indicates the time when the user starts to lock, in this example, that is, the user s821 uses the transaction code mm02 to modify the start time of the material T-ASA02, in general, you can use the transaction code to modify the start time of an object, that is, the lock time.
Field "table name" and "lock parameter": indicates the locked table. In this example, the user modifies the sales view and other information of the material master data. Therefore, the related tables of the four materials are locked, specifically
Mara is the basic view of the material master data table, the lock parameters represent 820 client material T-ASA02 respectively
Marc is the factory view table of material master data, lock parameters represent 820 client material T-ASA02 factory 1200 respectively
Mbew is a table of factory evaluation views of material master data, with locking parameters representing 820 client material T-ASA02 evaluation type (factory) 1200 respectively
Mvke is the sale view chart of material main data, its lock parameters represent 820 client material T-ASA02 sales organization 1000, Distribution Channel 10
Field: Lock mode)
There are three lock Methods
S (shared lock, read lock)
E (exclusive lock, write lock)
X (exclusive lock, extended write lock, cannot be cumulated)
Mode e: This mode is set when data is changed.
Mode S: No data needs to be changed, but the data to be displayed is not changed by others.
Mode X: similar to E, but not accumulative, exclusive.
Double-click any row and you can see what transaction code (mm02) is used by the user s821 to lock the table record.
1.2 invoice verification and table locking
Normally, when we enter the service data maintenance interface, the system locks the tables related to the service data until the user launches an operation to stop the table entry locking.
For some operations, such as when the invoice verification system can configure table locking
As shown in, the transaction code Miro places two purchase orders for material zmto (4500017313
4500017348) invoice verification
At this time, the transaction code sm12 is used to view the table entry lock.
The system locks three tables.
Ekpo: Procurement Order line project table
Ekko: Purchase Order header table
Because invoice validation may affect the material evaluation price, the system will lock the table mbew: The evaluation view chart of the material master data.
Modify background Configuration
Transaction code srpo> Material Management General settings for materials management set up material block for invoice verification
During invoice verification, how does the system lock the table (mbew) of materials at the beginning of the invoice verification, or when the invoice verification is transferred or simulated.
When it is changed to "locked" when the invoice is transferred, and then viewed through "sm12" again, we can see that during invoice verification, the table "mbew" will not be locked before the invoice is transferred.
1.3 move materials and lock tables
Transaction code srpo> Material Management General settings for materials management set material block for goods movements
You can also set how to lock the table when moving the materials and goods in the background.
You can set two locking mechanisms.
Locking Mechanism 1: exclusive block (exclusive lock)
This mechanism is the same as the mechanism in most cases. when you enter a certain item on the goods moving interface, the tables (MARC and mbew) about the factory and Evaluation View Of the item are locked ).
Locking Mechanism 2: Late block for goods movements
The lock is performed only when the data is actually to be saved. The lock is as late as possible to ensure the lock time is as short as possible.
The advantage is that by setting the shared lock, several users can simultaneously move the goods to the item, that is, when user a moves the goods to the interface, the table will not be exclusive, other users can still access the table. When the data is finally saved, the system actually locks the table.
The disadvantage is that the material master data will be read multiple times, which will have a negative impact on the system load.
1.4 custom table and table lock
For custom tables that may be maintained by multiple personnel, you should also set the table entry locking mechanism to prevent different persons from simultaneously modifying the same record of the table.
The implementation process is also relatively simple.