‎2008 Apr 01 11:42 AM
Hi
I have a requirement where I have to give message in the program that if the project number(PROJ-PSPID) entered on the selection screen is opened by another user in CJ02(Change project ) the i should give message 'Project 'X' is blocked by the user'. How to do this?
Thanks
‎2008 Apr 01 12:04 PM
Call FM CJDW_ENQUEUE to check if the project is locked.
Values to be passed:
OBJECT_ID = PROJ-PSPID
OTYPE = H
If this FM returns sy-subrc = 1 then the project is locked in some other session
‎2008 Apr 01 11:50 AM
‎2008 Apr 01 12:04 PM
Call FM CJDW_ENQUEUE to check if the project is locked.
Values to be passed:
OBJECT_ID = PROJ-PSPID
OTYPE = H
If this FM returns sy-subrc = 1 then the project is locked in some other session
‎2008 Apr 01 12:28 PM
Create a lock object in se11.
eg: E_LockObj.
Call function Enqueue_E_LockObj.
pass ur Field value which has to be locked here.
Call Funcition Dequeue_E_LockObj.
Unlock the field value here(ie when ever u press exit/back button this FM can be called).
Reward if useful
‎2008 Apr 01 12:28 PM
Hi,
GO TO SE11
SELECT LOCK OBJECT NAME IT AS
'EZXXXXXXXX' - FIRST LETTER SHOULD BE 'E' AND SECOND MUST BE 'Z' OR 'Y'
REST IS AS U FEEL.
GIVE TABLE NAME U WANT 2 LOCK AND SELECT : EXCLUSIVE,CUMULATIVE AND ACTIVATE
FUNCTION MODULE WILL BE GENERATED WITH NAME
*ENQUEUE_EZXXXXXXX*
*DEQUEUE_EZXXXXXXX*
USE THE BELOW CODE IN UR PROGRAM
call function 'ENQUEUE_EZMIGO_LOCK'
exporting
* MODE_ZG1_MKPF = 'E'
mandt = sy-mandt
g1sno = pg1sno
* X_G1SNO = ' '
* _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.Regards,
V.Balaji
Reward if Usefull...