2007 Jun 27 4:25 PM
Hi Guys,
I have a query regarding inserting data records to the table. I have created the data base table and simultaneously more than one user can never enter the records to the table via table entries in SE16. I have already found a solution for this via module pool. Please let me know whether any better option available for inserting the records to the data base table simultaneously by multiple user.
regards,
Shankar
Hi Guys,
I have a query regarding inserting data records to the table. I have created the data base table and simultaneously more than one user can never enter the records to the table via table entries in SE16. I have already found a solution for this via module pool. Please let me know whether any better option available for inserting the records to the data base table simultaneously by multiple user.
regards,
Shankar
2007 Jun 27 4:46 PM
hi Shankaran,
That is not always a better option to insert records simultaneous by multiple users. It would be betetr to lock the table programmatically when each one of you are trying to insert records by using ENQUEUE_E_TABLE and unlock by using DEQUEUE_E_TABLE FM
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = C_E
TABNAME = C_INTERM
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
CASE SY-SUBRC.
WHEN 1.
MESSAGE E000 WITH 'Table'(021) C_INTERM
'is locked by other user'(022).
WHEN 2.
MESSAGE E000 WITH 'Table'(021) C_INTERM
'can not be updated due to sytem failure'(023).
WHEN 3.
MESSAGE E000 WITH 'Table'(021) C_INTERM
'can not be updated due to unknown error'(024).
ENDCASE.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = C_E
TABNAME = C_INTERM.
ENDFORM. " UNLOCK_TABLE