‎2008 Mar 10 4:45 AM
Hi All,
I have a report program that allows multiple users to save to the database tables.
How do I incorporate ENQUEUE and DEQUEUE statements to prevent concurrent write to ensure data integrity? Are there sample codes that I could refer to?
Thanks
‎2008 Mar 10 5:06 AM
hi,
Go to se11,
create a lock object with name starting fron E.
give the table names you want to lock.
after activating this will create two FM for enqueue and dequeue .
you can check names for these by following path in same window:
GOTO->LOCK MODULES
call these FM in your program.
Regards,
Talwinder
‎2008 Mar 12 12:46 PM
‎2008 Mar 10 5:08 AM
Hi,
here screen get locked
CALL FUNCTION 'ENQUEUE_EIQMEL'
EXPORTING
mandt = sy-mandt
qmnum = i_final_ap-qmnum -Notification number
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
*--Setting the task "PE03" for notification on screen
CALL FUNCTION 'IQS4_ADD_DATA_NOTIFICATION'
EXPORTING
i_qmnum = i_final_ap-qmnum
i_conv = ' '
i_post = c_x
i_commit = c_x
i_wait = c_x
TABLES
i_viqmsm_t = i_viqmsm_tmp
return = i_return.
CALL FUNCTION 'DEQUEUE_EIQMEL'
EXPORTING
mandt = sy-mandt
qmnum = i_final_ap-qmnum.
‎2008 Mar 12 12:43 PM
Hi thanks.
But I am referring to the locking of database records, so that when multiple users access the same record, they won't overwrite each other. How do I go about doing it?