Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lock error

Former Member
0 Likes
2,713

Hello Everyone,

We have a situation where a product lock error happens every now and then.

When a batch job is running and if the user is using some allocation screen the product would be locked by the user.. the batch job waits for 10 minutes if its locked.. if its not unlocked within 10 mins then the job will ABEND.. after this we have to do the recovery..

Can anyone let me know if there is anyway to avoid this ABEND by making sure that the data of the file is uploaded properly and the data of the user entering in the screen will not be lost too..

Thank you for your suggestions in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
1,559

Hello,

I have two suggestions:

1. program will wait till it is unlocked rather than 10 minutes and then continues...but there is risk job is running for long time

2. send a mail to the person who has locked the product to the mail address maintained in user profile

Thanks..Krish

Read only

gaurab_banerji
Active Participant
0 Likes
1,559

I suppose the program is trying to use a BDC to input data in the program, but not limited to it. There should never be simultaneous access of the same data so you cannot expect both the user and the system to edit and save at the same time. This is against the lock concept and could lead to data inconsistancy.

For example if "the article is currently being edited by VCHADWA" comes up in the BDC message and the BDC tries to end abnormally, we need to write a logic to skip the current record and process to the next, saving into a backup internal table which will preserve the data for the locked records for later processing.

Once done, you can either choose to send mail using sap, external mail (if your system supports), or popup message (th_popup) asking them to exit the transaction saving their changes, while you continue to retry processing records from the backup internal table. By now, most of the processable records have been processed and what remains are the ones which were locked. Here you can put a 10 minute waiting time for each. This would speed things up. However, if it still is not able to process, we can save the data in an internal table for backup or create a mail and send it to someone about the unprocessed records.

Read only

0 Likes
1,559

Hello Gaurab,

The current logic is working as same. If the product is locked it moves to the next record. The locked records are then taken up again, it waits for 10 minutes and then an error message is thrown to the team that the error has occurred, we recover the data after this.

I do understand that a single data cannot be accessed at the same time, because it leads to inconsistency.

My question was whether we can put in something where the screen becomes a display mode from edit mode when the batch job is running and then again the screen becomes edit mode after the batch job is finished? The data which was entered by the user shouldnt be lost when the modes are changing.

Read only

0 Likes
1,559

since it is in edit mode, multiple tables are already locked by another person, so your program will need to override the locking process of another user session in order to update the table. this is not a good programming practice and might lead to data inconsistancy.

Also, overriding the screens of another user from change mode to display mode and then back to change mode, preserving the data changed by the end user, will give an incorect assumption to the end user. because in the database level, the data has been changed. moreover, i am not sure if such dynamic facility is available in sapgui.