09-06-2008 2:30 PM
Hi,
I created lock object in se11 with name ELOC. In program Called FM ENQUEUE & DEQUEUE .
But it not working properly. What might be the reason. Can any one give here 1 sample program.
Thanks.
09-06-2008 4:03 PM
First were you really able to create Lock object ELOC ?????
Because all cutomer lock objects should start with EZ , so i m taking EZLOC as your lock object name to proceed further.
Once you have created lock object in se11 SAP system automatically creates two FM
ENQUEUE_EZLOC - For locking
DENQUEUE_EZLOC - For unlocking
You have to use the above FM to lock the table and unlock while you do any DML operation in database.
Based on your lock object creation the exporting fields are created in the FM .
CALL FUNCTION 'ENQUEUE_EZLOC'
EXPORTING
XXXXXXX = 'E' ( Lock Type )
XXXXXXX = XXXXXXX
XXXXXXX = XXXXXXX
_SCOPE = '2'
_wait = 'X'
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
DML Operation of the database
Update XXXXXXXXXXXXXXXXX
CALL FUNCTION 'DEQUEUE_EZLOC'
EXPORTING
XXXXXXX = 'E'
XXXXXXX = XXXXXXX
XXXXXXX = XXXXXXX .
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
Thanks,
Karthik
09-06-2008 3:52 PM
hi,
check this.
[http://help.sap.com/saphelp_nw70/helpdata/en/a2/3547360f2ea61fe10000009b38f839/content.htm]
09-06-2008 4:03 PM
First were you really able to create Lock object ELOC ?????
Because all cutomer lock objects should start with EZ , so i m taking EZLOC as your lock object name to proceed further.
Once you have created lock object in se11 SAP system automatically creates two FM
ENQUEUE_EZLOC - For locking
DENQUEUE_EZLOC - For unlocking
You have to use the above FM to lock the table and unlock while you do any DML operation in database.
Based on your lock object creation the exporting fields are created in the FM .
CALL FUNCTION 'ENQUEUE_EZLOC'
EXPORTING
XXXXXXX = 'E' ( Lock Type )
XXXXXXX = XXXXXXX
XXXXXXX = XXXXXXX
_SCOPE = '2'
_wait = 'X'
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CHECK sy-subrc EQ 0.
DML Operation of the database
Update XXXXXXXXXXXXXXXXX
CALL FUNCTION 'DEQUEUE_EZLOC'
EXPORTING
XXXXXXX = 'E'
XXXXXXX = XXXXXXX
XXXXXXX = XXXXXXX .
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
Thanks,
Karthik
09-07-2008 5:49 AM