HI all,
I have written code for locking a field, the code is as below
FORM LOCK-RECORD.
CALL FUNCTION 'ENQUEUE_EZHEAT'
EXPORTING
MODE_YHEAT = 'E'
MANDT = SY-MANDT
ZHEAT = YHEAT-ZHEAT
X_ZHEAT = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
IF SY-SUBRC EQ 0.
V_USER = SY-UNAME.
SET PARAMETER ID 'USER' FIELD SY-UNAME.
ENDIF.
IF SY-SUBRC <> 0.
GET PARAMETER ID 'USER' FIELD V_USER.
MESSAGE E010(ZMSG) WITH 'This Transaction is Locked by' V_USER.
ENDIF.
when I am going to tcode for first time Iam locking the field and using
IF SY-SUBRC EQ 0.
V_USER = SY-UNAME.*
SET PARAMETER ID 'USER' FIELD SY-UNAME.
ENDIF.
when I open other session and try to modify I am getting the user name from get parameter as follows
IF SY-SUBRC <> 0.
GET PARAMETER ID 'USER' FIELD V_USER.
MESSAGE E010(ZMSG) WITH 'This Transaction is Locked by' V_USER.
ENDIF.
but second time it is not getting the user name into v_user. I am getting same problem when I am opening screen in oher client.
Can anybody please solve my problem
Thanks in Advance.