‎2014 Jan 21 3:19 AM
Hi,
Row level locking by creating lock objects is working but entire table level locking is not working.
I have used Function module ENQUEUE_E_TABLE and DEQUEUE_E_TABLE which is not working for locking the entire table
Since I am doing insertion alone in the table always.
Please let me know if any function module exists.
Thanks & Regards,
Priya
‎2014 Jan 21 4:27 AM
‎2014 Jan 21 5:43 AM
Hi Ram,
Even after passing action as E, its same.
After executing function module, sy-subrc eq 0 ( its enqued ) but diectly able to add entries in table in other session.
@Sanjeev,
row level locking is working.
but i need table level locking.
‎2014 Jan 21 4:35 AM
‎2014 Jan 21 5:57 AM
Hi Priya,
It should work in this way!
call function 'ENQUEUE_E_TABLE'
exporting
mode_rstable = 'E'
tabname = p_table
exceptions
foreign_lock = 1
system_failure = 2
others = 3.
if sy-subrc = 0.
* Modify the database table with these changes
modify (p_table) from table <dyn_tab_temp>.
refresh <dyn_tab_temp>.
* Unlock the table
call function 'DEQUEUE_E_TABLE'
exporting
mode_rstable = 'E'
tabname = p_table.
endif.
‎2014 Jan 21 6:13 AM
Hi Kiran,
I have followed the same thing but not working.
after 'ENQUEUE_E_TABLE'
In if sy-subrc = 0. ( yes sy-sub rc is 0)
In another session I have opened the table in SE 11 , Utilities -> Table contents -> Create entries
Its allowing to create entries eventhough dequeue is not executed.
Please let me know if am doing wrong.
‎2014 Jan 21 6:34 AM
Hi,
tested, it is working fine for me! cehck the table name, how you are passing
call function 'ENQUEUE_E_TABLE'
exporting
mode_rstable = 'E'
tabname = 'ZAAK_CONTACTS'
exceptions
foreign_lock = 1
system_failure = 2
others = 3.
‎2014 Jan 21 6:37 AM
hi Priya,
U tried to check or you actually created an entry. if not try creating bcoz it shud work.
regards,
‎2014 Jan 21 6:48 AM
Hi Karan,
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'ZMM_KANBAN_HIST'
* VARKEY =
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF sy-subrc EQ 0.
refresh gt_zmm_kanban_hist.
CLEAR gs_zmm_kanban_hist_c.
SELECT * FROM zmm_kanban_hist
INTO TABLE gt_zmm_kanban_hist.
IF sy-subrc EQ 0.
SORT gt_zmm_kanban_hist BY zrecord DESCENDING.
CLEAR gs_zmm_kanban_hist_c.
READ TABLE gt_zmm_kanban_hist INTO gs_zmm_kanban_hist_c INDEX 1.
IF sy-subrc EQ 0.
gs_zmm_kanban_hist-zrecord = gs_zmm_kanban_hist_c-zrecord + 1.
INSERT zmm_kanban_hist FROM gs_zmm_kanban_hist.
ENDIF.
ELSE.
gs_zmm_kanban_hist-zrecord = 1.
INSERT zmm_kanban_hist FROM gs_zmm_kanban_hist.
ENDIF.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'ZMM_KANBAN_HIST'.
* VARKEY =
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
ENDIF.
I have used the same like you but am not getting popup with locked message.
‎2014 Jan 21 6:56 AM
Hi Kiran,
Created entry with my code changes.
In another session ,
Utilities -> Table contents -> Create entries
Its allowing to create entries even dequeue function module is not executed.
‎2014 Jan 21 7:15 AM
Hi Priya
When you execute your program did you put a breakpoint at sy-subrc if it returns zero then you open another session and try to maintain entry it will show error
Nabheet
‎2014 Jan 21 7:02 AM
Hi Priya,
Please follow what ever is suggested by Kiran Kumar. Once you have locked, I suggest you to try closing all other sessions and reopen a new session or even try logging off and logging in.
Hope this helps!
Happy Coding,
Santhosh Yadav