2009 Jun 28 10:00 PM
Hi All,
i have program that update some Z tables with data on run time (process that run all the day - every call update one row on the table) and i want also to give to the admin the option to update the table (i create maintenance view for that) ?
What is the best way to do so and of course ignore locking problem,i.e. that the admin can't lock all of the tables just specific row,
or other idea that can help?
Best Regards
Nina
2009 Jun 29 2:43 AM
HI,
Dont create Mantanace veiw to update Z table. becase maintanance view will not accept open SQL statement(select, update and modify) on mantanance view.So through the maintanace veiw we can able to insert and update the records manually.
If you want to update Z table by means of program; just create lock object and lock modules(Enque and Deque) and call lock module in your appication program. For locking perticular row of the table just pass lock argument to lock module.
Refer for creating lock object and lock module
CALL FUNCTION 'ENQUEUE_EZTESTLOCK'
EXPORTING
MANDT = SY-MANDT
mblnr = p_mbelnr -
>pass Lock arguments to lock perticular table entry insted of locking entire table
mjahr = p_mjahr
zeile = p_zeile
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3 .
Hope it will resolve your problem......
Regards,
Peranandam
HI,
Dont create Mantanace veiw to update Z table. becase maintanance view will not accept open SQL statement(select, update and modify) on mantanance view.So through the maintanace veiw we can able to insert and update the records manually.
If you want to update Z table by means of program; just create lock object and lock modules(Enque and Deque) and call lock module in your appication program. For locking perticular row of the table just pass lock argument to lock module.
Refer for creating lock object and lock module
CALL FUNCTION 'ENQUEUE_EZTESTLOCK'
EXPORTING
MANDT = SY-MANDT
mblnr = p_mbelnr -
>pass Lock arguments to lock perticular table entry insted of locking entire table
mjahr = p_mjahr
zeile = p_zeile
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3 .
Hope it will resolve your problem......
Regards,
Peranandam
2009 Jun 29 2:43 AM
HI,
Dont create Mantanace veiw to update Z table. becase maintanance view will not accept open SQL statement(select, update and modify) on mantanance view.So through the maintanace veiw we can able to insert and update the records manually.
If you want to update Z table by means of program; just create lock object and lock modules(Enque and Deque) and call lock module in your appication program. For locking perticular row of the table just pass lock argument to lock module.
Refer for creating lock object and lock module
CALL FUNCTION 'ENQUEUE_EZTESTLOCK'
EXPORTING
MANDT = SY-MANDT
mblnr = p_mbelnr -
>pass Lock arguments to lock perticular table entry insted of locking entire table
mjahr = p_mjahr
zeile = p_zeile
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3 .
Hope it will resolve your problem......
Regards,
Peranandam
2009 Jun 29 5:23 AM
Hi,
If you are sure that you always update a single line, then no need to use Enqueue/Dequeue just use SELECT SINGLE statement with FOR UPDATE addition while selecting the row, it will set a exclusive lock only on that line of database table.
See F1 help for For Update for more details.
Hope this helps you.
Regards
Karthik D
2009 Jun 29 8:33 AM
HI Karthik,
Thanks ,
I always update one row for one user but this can be done in parallel for many users (calling to the FM that done the update),
e.g. users have button on the frontend and when the user push on it ,this will update data on my table. many users can do that is same time.
if i have table with 10.000 users and this table can be updated for instance for 50 (that push the button on the same time) the process can be called from 50 different caller and update user specific row table row at one time,
so what would u suggest to do?
BR
Nina
2009 Jun 29 9:33 AM
>
> I always update one row for one user but this can be done in parallel for many users
I hope that is what the Lock concept is for, so what i feel is you can go ahead and it will not affect the record updation.
Regards
Karthik D
2009 Jun 29 2:11 PM
HI ,
Does in maintenance view i can lock just one line,
i.e. if admin want to update user data he lock just the user specific line and not all the table .
if so, how?
Regards
Nina
Edited by: Nina C on Jun 29, 2009 6:51 PM
2009 Jun 30 3:54 AM
Hi,
Why not you check this by opening the maintenance view screen one screen and try updating a single record from the program ?
Regards
Karthik D
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |