2008 Mar 10 3:29 PM
Hi ,
When we use table maintenance transaction the entire table is locked , even if the user resticts the records .
Is there some way by which only that set of records get locked which are being used by the user , so that other users can modify the balance data.
Regards,
Arun
Hi ,
When we use table maintenance transaction the entire table is locked , even if the user resticts the records .
Is there some way by which only that set of records get locked which are being used by the user , so that other users can modify the balance data.
Regards,
Arun
2008 Mar 10 6:57 PM
Arun
It is not possible.
The only solution is to create a simple report with table for showing data and additional screen for entering and changing data. This way you can lock only the record that user is currently editing.
Rgds
Mat
2008 Mar 11 4:00 AM
Hai.
Use enque ,deque functionality in your program.
Use
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = C_E
TABNAME = C_INTERM
varkey =
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.
in above for a table take what are the primary and foreign key comination and concatenate the values and pass ir to varkey .then that particular records will be locked.
regards.
sowjanya.b
2008 Mar 11 4:12 AM
Hi
try if this code can help u.
&----
*& Report ZLOCKING *
*& *
&----
*& *
*& *
&----
REPORT zlocking .
DATA : tab_emp TYPE TABLE OF zemp_51772,
wa_emp TYPE zemp_51772.
wa_emp-emp_no = '102'.
wa_emp-emp_id = '157'.
wa_emp-emp_name = 'SIVA'.
wa_emp-emp_dept = 'SAP'.
APPEND wa_emp TO tab_emp.
CLEAR wa_emp.
wa_emp-emp_no = '128'.
wa_emp-emp_id = '138'.
wa_emp-emp_name = 'RAMA'.
wa_emp-emp_dept = 'SAP'.
APPEND wa_emp TO tab_emp.
CLEAR wa_emp.
wa_emp-emp_no = '133'.
wa_emp-emp_id = '121'.
wa_emp-emp_name = 'KRISHNA'.
wa_emp-emp_dept = 'SAP'.
APPEND wa_emp TO tab_emp.
CLEAR wa_emp.
CALL FUNCTION 'ENQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'X'
tabname = 'ZEMP_51772'
varkey =
X_TABNAME = ' '
X_VARKEY = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3
.
IF sy-subrc EQ 0.
INSERT zemp_51772 FROM TABLE tab_emp.
ENDIF.
CALL FUNCTION 'DEQUEUE_E_TABLEE'
EXPORTING
mode_rstable = 'X'
tabname = 'ZEMP_51772'
VARKEY =
X_TABNAME = ' '
X_VARKEY = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
.
IF sy-subrc EQ 0.
WRITE:/ 'Unlocked the Table'.
ENDIF.
Thanks & Regards,
Sravani.
2008 Mar 11 8:10 AM
Hi ,
Thanks for the reply , but my issue is in table maintenance the entire table gets locked , i want to restrict the locking only to records selected by the user.
Regards
Arun
2008 Mar 11 9:41 AM
when one table is edited or maintained other users dont have the previledge to modify the table contents for the entire table. Hence in this case i hope that u cannot restrict the authroization at record level
2008 Mar 13 10:42 AM
What you are asking is possible but not feasible.Database generally contains millions of records under different table
The time taken to keep track of a record level lock and authenicate query involving that particular table is very huge.Performance wise the system will become unusable to say the least.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |