2008 Nov 14 6:11 PM
Hi All,
I have module pool program in which table control is used. I would like to know whether it is possible to lock a particular row in the table so that another person will not be able to edit it until the first user completes his work. It should be only for that particular record which is being currently edited in the table.
Hi All,
I have module pool program in which table control is used. I would like to know whether it is possible to lock a particular row in the table so that another person will not be able to edit it until the first user completes his work. It should be only for that particular record which is being currently edited in the table.
2008 Nov 14 6:16 PM
Hi,
Yes you can lock particular row in a table control..
In the flow logic..
PROCESS BEFORE OUTPUT.
LOOP AT itab INTO wa WITH CONTROL tc.
MODULE disable_row.
ENDLOOP.
MODULE disable_row.
* call the Enqueue function module..If the
IF sy-subrc NE 0.
LOOP AT screen.
SCREEN-INPUT = 0. " Disable for input
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.Thanks
Naren
2008 Nov 15 6:01 AM
You cannot do it at Table control's record level, but you can do it at Database Table's record level as follows:
Go to SE11 and create a lock:
>Create a lock with name starting with EZ* or EY*
>Enter name of table, whose record is to be locked
>Make lock type to be exclusive
>In lock parameters, give all primary keys of the table
>On saving, activating two Function Modules are created names EZxxx_ENQUEUE, EZxxx_DEQUEUE
Now If you want to lock a particular record
>Call FM EZxxx_ENQUEUE and pass primary key values of the record to be locked
To unlock table record
>Call FM EZxxx_DEQUEUE and pass primary key values of the record to be unlocked
Edited by: Amit Gupta on Nov 15, 2008 6:14 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |