2006 Oct 30 12:23 PM
Hi,
how to know whether the table has been locked or not when we are executing and modifying the DB table.
I created the program and used the enqueue and dequeue fm for respective tables. But how do i know whether the table is locked at runtime
regards
Mac
2006 Oct 30 12:27 PM
Hi,
how to know whether the table has been locked or not when we are executing and modifying the DB table.
I created the program and used the enqueue and dequeue fm for respective tables. But how do i know whether the table is locked at runtime
regards
Mac
2006 Oct 30 12:27 PM
2006 Oct 30 1:08 PM
2006 Oct 30 1:09 PM
Hi,
I have tried the t.code and given the table name but it does not show any locked tables.
I want to know that the table is been locked while executing the program.
my code is in this manner. If found any thing wrong please help me
CALL FUNCTION 'ENQUEUE_E_EASTE'
EXPORTING
MODE_EASTE = 'E'
MANDT = SY-MANDT
LOGIKZW = p_logikz
AB = p_ab
X_LOGIKZW = ' '
X_AB = ' '
_SCOPE = '2'
_WAIT = 'X'
_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.
*MODIFY consuption value with new consumption
w_easte-perverbr = p_pervbr .
MODIFY easte FROM w_easte .
IF SY-SUBRC NE 0.
MESSAGE s968(/vfs/biljett) WITH 'EASTE' .
ELSE.
MESSAGE s969(/vfs/biljett) WITH 'EASTE'.
ENDIF.
*UNLOCK the TABLE EASTE.
CALL FUNCTION 'DEQUEUE_E_EASTE'
EXPORTING
MODE_EASTE = 'E'
MANDT = SY-MANDT
LOGIKZW = p_logikz
AB = p_ab
X_LOGIKZW = ' '
X_AB = ' '
_SCOPE = '3'
_SYNCHRON = 'X'
_COLLECT = ' '
.
Commit Work
COMMIT WORK.
regards
mac
2006 Oct 30 1:12 PM
Hello
I know how to create and use the lock objects .
I want to find out is my table getting locked during runtime of my program
Mac
2006 Oct 30 1:16 PM
Hi, put a break point after the ENQUEUE function module and before the DEQUEUE.
CALL FUNCTION 'ENQUEUE_E_EASTE'
EXPORTING
MODE_EASTE = 'E'
MANDT = SY-MANDT
LOGIKZW = p_logikz
AB = p_ab
* X_LOGIKZW = ' '
* X_AB = ' '
* _SCOPE = '2'
_WAIT = 'X'
* _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.
<b>BREAK-POINT.</b>
*MODIFY consuption value with new consumption
w_easte-perverbr = p_pervbr .
MODIFY easte FROM w_easte .
IF SY-SUBRC NE 0.
MESSAGE s968(/vfs/biljett) WITH 'EASTE' .
ELSE.
MESSAGE s969(/vfs/biljett) WITH 'EASTE'.
ENDIF.
*UNLOCK the TABLE EASTE.
CALL FUNCTION 'DEQUEUE_E_EASTE'
EXPORTING
* MODE_EASTE = 'E'
MANDT = SY-MANDT
LOGIKZW = p_logikz
AB = p_ab
** X_LOGIKZW = ' '
** X_AB = ' '
** _SCOPE = '3'
_SYNCHRON = 'X'
** _COLLECT = ' '
.
** Commit Work
COMMIT WORKNow when the program stops in debug mode, open another session and to to SM12, Enter you user id in the field on the screen and hit enter, your lock should be there.
Regards,
Rich Heilman
2006 Oct 30 1:17 PM
ENQUEUE_READ would give the list of objects that are currently locked by a specific user.
Regards,
ravi