‎2006 Nov 02 11:09 PM
hi to all,
help me in this issue
when a user is executing a program it should through a error messege to other user who entered the same transaction it must through an error that it is locked.
simoultanously no two users should run the transaction
thanks in advance
kiran kumar.
Message was edited by: kiran kumar
‎2006 Nov 03 9:24 AM
Hi,
lockobject is created using se11
by default enqueue_<lock objectname>
dequeue_<lock objectname> are created
by SAP.
you can create at table level or row level lock.
CALL FUNCTION 'ENQUEUE_EZPPX0010A'
EXPORTING
MODE_ZPPDORD = 'E'
MANDT = SY-MANDT
WERKS = S_WERKS
AUFNR = X_LOCK_LEVEL
EXCEPTIONS
OTHERS = 1.
delete lock after each insertion
or use call function 'DEQUEUE_ALL'
CALL FUNCTION 'DEQUEUE_EZPPX0010A'
EXPORTING
MODE_ZPPDORD = 'E'
MANDT = SY-MANDT
WERKS = S_WERKS
AUFNR = X_LOCK_LEVEL
EXCEPTIONS
OTHERS = 1.
Regards,
amole
‎2006 Nov 02 11:14 PM
Hi
U can create a ZTABLE where you store the program or transaction name and then create a lock object for that table.
In this way in the event INITIALIZATION you raise that lock and if SY-SUBRC <> 0 you raise an error message:
INITIALIZATION.
CALL FUNCTION 'ENQUEUE_EZFAGTO01'
EXPORTING
MODE_ZFAGTO01 = 'E'
MANDT = SY-MANDT
PROGRAMM = SY-REPID
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.Max
‎2006 Nov 02 11:17 PM
Hi,
Create a table with only one column say LOCKED ..
Get the column value and check if is ' '..
If so run the program..
If not raise an error message..
If the value is ' '..Then immediately set the value to 'X' and do COMMIT WORK..
Once the program is executed..Then modify the value as ' ' and update the table..
Thanks,
Naren
‎2006 Nov 03 9:24 AM
Hi,
lockobject is created using se11
by default enqueue_<lock objectname>
dequeue_<lock objectname> are created
by SAP.
you can create at table level or row level lock.
CALL FUNCTION 'ENQUEUE_EZPPX0010A'
EXPORTING
MODE_ZPPDORD = 'E'
MANDT = SY-MANDT
WERKS = S_WERKS
AUFNR = X_LOCK_LEVEL
EXCEPTIONS
OTHERS = 1.
delete lock after each insertion
or use call function 'DEQUEUE_ALL'
CALL FUNCTION 'DEQUEUE_EZPPX0010A'
EXPORTING
MODE_ZPPDORD = 'E'
MANDT = SY-MANDT
WERKS = S_WERKS
AUFNR = X_LOCK_LEVEL
EXCEPTIONS
OTHERS = 1.
Regards,
amole