09-06-2006 6:34 PM
Hi all,
I am trying to updtae the entries of the table KNMT . To make sure thta no body else is modifyng the enroes from VD52 I want to lock the table . For this I am using the FM <b>ENQUEUE_E_TABLE</b> . But when I check in SM12 for any locked objects I couldn't see any . Can you tell me what could be the reason . I am posting my code .
REPORT ZLOCK_CHECK .
data : varkey like RSTABLE-VARKEY .
varkey = sy-mandt .
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'KNMT'
VARKEY = varkey
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
* EXCEPTIONS
* FOREIGN_LOCK = 1
* SYSTEM_FAILURE = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
break-point .
write : sy-subrc .
This stops in debugging mode . But no entry ids found in SM12 but sy-subrc is ZERO .
Can anyone please help me with this .
Regards,
Vijay .
09-06-2006 6:40 PM
Instead of locking at the table level, try the FM ENQUEUE_EVKNMT and see if it meets your requirements. I guess you will be updating one record any given time so this might help you in what you are trying to accomplish.
hith
Sunil Achyut
09-06-2006 6:42 PM
Hi Sunil,
I tried this and this is giving other problems so I am trying to use the above said FM .
Regards,
Vijay .
09-06-2006 7:08 PM
What problems are you having when you tried locking it at the record level? Its better to go at a record level than at a table level. You can check the system messages (msgid, msgno) to see why it dint lock.
hith
Sunil Achyut
Message was edited by: Sunil Achyut
09-06-2006 7:27 PM
Try the following and see,
concatenate sy-mandt VKORG VTWEG KUNNR MATNR into varkey.
The above is assuming you have all the primary keys of the record.
hith
Sunil Achyut
09-06-2006 7:37 PM
Hi all,
I did not make any changes to the code . But now I can see the lock entry in SM12 .
Thank you all guys for yuor quick replies .
Regards,
varun .
09-06-2006 6:42 PM
09-06-2006 6:49 PM
Hi Max,
Were you able to see an enrty in SM12 ??
Rich ,
I wrote a call transaction program for that but it is not getting executed in background mode so we are tryinmg to updtae the table .
Regards,
Vijay .
09-06-2006 6:52 PM
09-06-2006 6:57 PM
Hi Max,
I am also using 4.6C but not able to see the entry in SM12 . I dont know why .
Regards,
Vijay .
09-06-2006 7:05 PM
Hi Vijay,
I ran the progtram and see the lock entry in SM12. I am on 4.7.
here is the entry when i saw in SM12.
cl. user Time Mode Table Lockargument
_____________________________________________________________________
020 Dev_id 13:55:16 E RSTABLE KNMT
Regards,
Vivek
09-06-2006 6:46 PM