Application Development 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: 

Link sessions and locks way

Former Member
0 Kudos
237

Hi guys,

I need to close sessions of some user that is locking one object previous to trigger a job(i need to make this by program not handly),  but this user can have several sessions of same transaction and locking sveeral objects. I don´t know how to link the locks and the sessions. Does anybody have the same problem?.

Thanks in advance.

1 ACCEPTED SOLUTION

Jelena_Perfiljeva
Active Contributor
0 Kudos
210

The locks are not related to the session, only to the user ID and key fields. You can easily see the locks in SM12 and come to such conclusion on your own.

Forcefully closing the sessions and removing locks is not the best practice in SAP (or any ERP system I suppose), so it's not a "problem", as you're suggesting. Problem is what you are likely to get by simply removing the locks in a program.

4 REPLIES 4

Jelena_Perfiljeva
Active Contributor
0 Kudos
211

The locks are not related to the session, only to the user ID and key fields. You can easily see the locks in SM12 and come to such conclusion on your own.

Forcefully closing the sessions and removing locks is not the best practice in SAP (or any ERP system I suppose), so it's not a "problem", as you're suggesting. Problem is what you are likely to get by simply removing the locks in a program.

0 Kudos
210

Hi Jelena,

My problem comes when the user is locking an object that is going to be needed by a night job(It is not normal, but sometimes it happens). I know that locks are linked to key and user, but i have checked that when i close a session by sm04 i get the session closed and the locks released. So i need the user out of this transaction previous to my job. If you need a better way please share it.

Thanks in advance.

Best regards

0 Kudos
210

Dear Carl

Your problem is locks but going one level next you shall understand from the user why he is locking it. It is very common scenario when jobs run people will be working on some of objects in parallel. Removing locks is not the solution.  First is to understand what is the user always doing at same time when your jobs run.

Thanks

Nabheet

0 Kudos
210

I'm confused - does your SAP Production system have no time-out? Our users get booted out after about 15 minutes of inactivity and "night jobs" usually start way past the office hours, at 7-8 pm.

It seems to me this rather needs to be taken up with the management. There should be no need whatsoever to have a transaction open in change mode for extended period of time. Essentially you are trying to do the time-out's job here and it doesn't seem to make much sense.