Example - Suppose I locked a order number in a program and there is no dequeue logic and the program is running for long hours in the background. So that order number is locked and no one can use that. It will be a deadlock situation.
Hi Sir, When a user is running a report and another user tries to run the same report at the same time, we need to restrict the second user from running the report. Can we achieve this through a lock mechanism? If yes, please provide a reference code. It would be very helpful.
Hello Firoz - In this case, locking concept will not help you as you want a lock at the program level. You can use this approach. 1) Create a custom table which has single column like User name. 2)" Whenever any user run the program check the entry into this table, if the entry is not there, it means that is the first user and insert the record to this table. 3) If the entry is there, it means other user is running the program and provide the error. 4) At the end of the program, delete the entry from this table.
Plss clarify . The doubts WRITE LOCK MEANS MORE USER CAN ACCESS THE TCODE ..BUT CANNOT CHANGE THE PARTICULAR INPUT ORDERNO. ENHANCED WRITE LOCK ...OTHER USER CANNOT ACCESS THE TCODE SIR
We create lock for data not for T-codes. Suppose simple example - You are changing a order number 1 through a program, then firstly you need to lock that order number then go for changes. When your changes are going on, other users can not change the order number 1 as it is locked by you. Write lock means - you can lock order number 1 multiple times. With the help of this We can create a dead-lock situation. Enhanced write lock means - you can not lock order number 1 multiple times in the same program. With the help of this we can avoid dead lock situation.
Thank you rahul sir
dear sir can you help me to understand possibility of deadlock scenario in this technique and how to handle it.
Example - Suppose I locked a order number in a program and there is no dequeue logic and the program is running for long hours in the background. So that order number is locked and no one can use that. It will be a deadlock situation.
Hi Sir,
When a user is running a report and another user tries to run the same report at the same time, we need to restrict the second user from running the report. Can we achieve this through a lock mechanism? If yes, please provide a reference code. It would be very helpful.
Hello Firoz - In this case, locking concept will not help you as you want a lock at the program level. You can use this approach.
1) Create a custom table which has single column like User name.
2)" Whenever any user run the program check the entry into this table, if the entry is not there, it means that is the first user and insert the record to this table.
3) If the entry is there, it means other user is running the program and provide the error.
4) At the end of the program, delete the entry from this table.
Plss clarify . The doubts
WRITE LOCK MEANS MORE USER CAN ACCESS THE TCODE ..BUT CANNOT CHANGE THE PARTICULAR INPUT ORDERNO.
ENHANCED WRITE LOCK
...OTHER USER CANNOT ACCESS THE TCODE SIR
We create lock for data not for T-codes. Suppose simple example - You are changing a order number 1 through a program, then firstly you need to lock that order number then go for changes. When your changes are going on, other users can not change the order number 1 as it is locked by you.
Write lock means - you can lock order number 1 multiple times. With the help of this We can create a dead-lock situation.
Enhanced write lock means - you can not lock order number 1 multiple times in the same program. With the help of this we can avoid dead lock situation.