2023 Nov 08 4:44 AM
I have a custom ABAP report.
There are situations when user was running the program and suddenly his session was terminated due to network issue or system downtime. Then this session should be locked somewhere right?
In the next run of this program i want to check if the user executing the program has any session for the same program locked already.
From which table i can find if the session for the user was already locked?
Please help!
2023 Nov 08 9:56 AM
Then this session should be locked somewhere right?
Maybe. Not always. What exactly do you mean "session locked"?
2023 Nov 08 10:05 AM
Did you already look in transaction SM21, System Log, for messages such as 'Delete session & after error &'
2023 Nov 08 3:24 PM
(Locked or logged, that is the question)
For SM04, look at
2023 Nov 09 4:08 AM
If a user has opened a webdynpro(ABAP) and doing table edit. Suddenly network issue happened, Then is there any way to determine that this user is not active? In SM04 the user session still shows "Logged On".
2023 Nov 08 1:09 PM
Check SM12(Lock entries) or SM04 (Sessions). There must be standard FM to get the details.
2023 Nov 08 2:01 PM
Let me explain better.
When a user say TEST01 runs the ABAP webdynpro in browser then the system creates an entry in SM04 for the user with State "Logged On".
Next Another user TEST02 also runs the same webdynpro then the system again creates an entry for this user in SM04.
So SM04 has now 2 entries
TEST01 Logged On
TEST02 Logged On
After sometime if the TEST01 has some sudden network disconnection then original entry for the user remains in SM04 with state :Logged On".
So SM04 still has 2 entries
TEST01 Looged On <-- this one actually not running the program because his connection was terminated
TEST02 Logged on <-- this one is actually running program currently
Now looking at the SM04 how do i find which user is logged in and currently running the program in reality.
The problem is that both the users have same State value : Logged On.
Is there any other Table where i can get more info of the current state of the user?
Thanks & Regards
Gopal
2023 Nov 09 4:43 PM
Then SM21 is only option. Check the logs at that time. I don't think of any other tcode for this kind logs.
2023 Nov 08 1:18 PM
Let me explain better.
When a user say TEST01 runs the ABAP wendynpro in browser then the system creates an entry in SM04 for the user with State "Logged On".
Next Another user TEST02 also runs the same webdynpro then the system again creates an entry for this user in SM04.
So SM04 has now 2 entries
TEST01 Looged On
TEST02 Logged on
After sometime if the TEST01 has some sudden network disconnection then original entry for the user remains in SM04 with state :Logged On".
So SM04 still has 2 entries
TEST01 Looged On <-- this one actually not running the program because his connection was terminated
TEST02 Logged on <-- this one is actually running program currently
Now looking at the SM04 how do i find which user is logged in and currently running the program in reality.
The problem is that both the users have same State value : Logged On.
Is there any other Table where i can get more info of the current state of the user?
Thanks & Regards
Gopal
2023 Nov 09 4:08 AM
If a user has opened a webdynpro(ABAP) and doing table UI edit. Suddenly network issue happened, Then is there any way to determine that this user is not active? In SM04 the user session still shows "Logged On".
2023 Nov 09 9:50 AM
I never ever had to worry about "if last user session was terminated unexpectedly" because any update is automatically rollbacked, leaving a clean database state, all locks are removed, etc.
Why do you have to worry about "if last user session was terminated unexpectedly"?
2023 Nov 09 11:36 AM
I'm not sure, but I think the you're saying that a user has an enqueue lock on some data, then their session terminates unexpectedly, which can leave the lock on the data. You're trying to write a program that detects this situation, and thought of using SM04 (or what's behind it) to see if there are enqueue locks but the user isn't actually logged on. But SM04 shows the user logged on.
In which case, I think the answer is - you can't. Because when a user is seen to be logged off, then any enqueued locks are automatically deleted. The whole problem with the unexpected termination is that the backend system doesn't know about it. There's no signal.