02-06-2008 6:37 AM
Hi,
I have one Doubt please clarify me.
How to lock the record in table with perticular fields combination please give me example of code.
Thanks,
Hari.
02-06-2008 6:43 AM
hi,
You can lock a table using FM:' ENQUEUE_E_TABLE' or if you want to a particular record, then you need to find out the lock object and the corresponding FMs for that table.
Regards,
Nagaraj
02-06-2008 6:53 AM
Hi,
IT LIKE this....
This is the function mode that you have to create for locking the contents of you internal table.
CALL FUNCTION 'ENQUEUE_EZHFINDID'
EXPORTING
mode_zhfindid = 'E'
mandt = sy-mandt
ownid = w_display-ownid
X_OWNID = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 1.
w_flag_lock = c_x.
CLEAR w_okflag.
MESSAGE e265 WITH w_display-ownnum.
ENDCASE.
Jayant Sahu.
02-06-2008 6:56 AM
Use ENQUEUE_TABLEE to lock.
To lock a particular record, use parameter VARKEY in ENQUEUE_TABLEE.
Pass the unique key of the record to VARKEY
02-06-2008 6:59 AM
Hi,
You can not lock single record.
maintaining another table for the particular field combination you are talking about would do the job.
02-06-2008 7:27 AM
helo,
we can lock single entry by using lock mechanism.
i have done in one scenario.
req is batch creation at prduction order level(co01).
batch is of 10 digits.
so it was on condition for (pro year,crop code,pro location,staus code) like this.
for this we mantained one z field with some fields ok.so for this table we need to lock one user from generation one number with another user same number .
for this we created one lock object for that table in e mode.
and used the default function modules created by system it worked record level.
(enqeue and deque fm created by system)
IN THE LOCK PARAMETERS GIVE THE KEY FIELDS FOR WHICH U WANT TO LOCK FOR RECORD LEVEL