2008 May 17 11:16 AM
I have a custom transaction , which edits a perticular table entries and allows to modify them. I wanted it to be locked if somebody is already using it.
Could somebody suggest me how the locking should be done ?
2008 May 17 11:18 AM
Hi,
the possible solution of using the lock object
'E_DSVAS_TRDIR' to lock a program
Reward if helpfull...
Cheers,
Sowjanya.
2008 May 17 11:27 AM
at initialization event
you can use lock function module
prg = sy-repid.
CALL FUNCTION 'ENQUEUE_ESINDX'
EXPORTING
MODE_INDX = 'E'
MANDT = SY-MANDT
RELID = 'ZZ'
SRTFD = prg
SRTF2 =
X_RELID = ' '
X_SRTFD = ' '
X_SRTF2 = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
message e000(yw) WITH sy-msgv1 'Is Already Executing The Program' prg
.
ENDIF.
this will help u out..its workin..i mean i m using this..