cancel
Showing results for 
Search instead for 
Did you mean: 

How to check whether a user is logged in through logon group or directly

Former Member
0 Kudos

Hi,

Is there a way to find out whether a user is connected to R/3 system through SAP Logon group or directly to dispatcher.

Thanks,

Giri

Accepted Solutions (0)

Answers (3)

Answers (3)

markus_doehr2
Active Contributor
0 Kudos

Here's some example code where you can create a table whose users may directly logon to application servers. All others are kicked out:

*DATA: it_zsbc_lm_config LIKE zsbc_lm_config OCCURS 1,
* wa_zsbc_lm_config LIKE LINE OF it_zsbc_lm_config,
* it_logondata TYPE bapilogond,
* it_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,
* bapi_username TYPE xubname,
* can_logon TYPE c,
* errmessage(128) TYPE c.
*
*can_logon = u2018Nu2019.
*
*SELECT
* *
*FROM
* zsbc_lm_config
*INTO TABLE
* it_zsbc_lm_config
*WHERE
* server = sy-host.
*IF sy-subrc = 0.
* u201CAt this point, we know that a logon group restriction has been
* u201Centered for this server
* bapi_username = sy-uname.
* CALL FUNCTION u2018BAPI_USER_GET_DETAILu2019
* EXPORTING
* username = bapi_username
* IMPORTING
* logondata = it_logondata
* TABLES
* return = it_return.
* LOOP AT it_zsbc_lm_config INTO wa_zsbc_lm_config.
* IF wa_zsbc_lm_config-ugroup = it_logondata-class.
* can_logon = u2018Yu2019.
* ENDIF.
* ENDLOOP.
* IF can_logon = u2018Nu2019.
* CONCATENATE
* u2018You are not authorized to log on to this server. Pleaseu2019
* u2018choose a different server.u2019
* INTO
* errmessage
* SEPARATED BY
* space.
* CALL FUNCTION u2018POPUP_TO_INFORMu2019
* EXPORTING
* titel = u2018ERROR!u2019
* txt1 = errmessage
* txt2 = u2018You will now be logged off.u2019.
*
* CALL u2018SYST_LOGOFFu2019.
* ENDIF.
*
*ENDIF.

Former Member
0 Kudos

Check out

[http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a64c1505211d189550000e829fbbd/frameset.htm]

Former Member
0 Kudos

The connection is always opened to the dispatcher, no matter if you initially used the message server to connect. All the message server does is find a suitable dispatcher to start the connection.

One way to see a user connection over the message server is to increase the trace level of the message server to 2 (transaction SMMS). In the dev_ms file you can see the connect, for example

[Thr 01] MsSClientHandle: client name = <client>

But the output is kind of hard to read, also be sure that you set the trace level back to 1 after your investigations.

Best regards, Michael

Former Member
0 Kudos

Hi,

Thanks for your reply.

Just want to give more details on what i am looking for.

I see more number of users in one of the four app servers that we have for our production system. Some of the users have an entry in their saplogon pad pointing to that appserver which is having more number of users logged in. They also have a Logon group entry in their saplogon.

So, i just want to know if there is a way to see how many users were connected through SAPLogon group and how many were connected directly. If there is no such possibility within SAP then your previous answer is quiet helpful.

Thanks for the help.

Thanks,

Giri

Former Member
0 Kudos

I don't know any way to see it when the users are already logged in. Maybe someone else here does, but i doubt it is possible at all.

Two more thoughts:

- maybe it is possible to verify the client side, maybe you have a software deployment or monitoring tool, that let you check the settings in the saplogon.ini and sapmsg.ini

- you could change the logon group temporarily (transaction SMLG), say some users connect directly to server A, some use loadbalancing and thus connect either to A or B. Now set the logon group to B, all users connecting to A obvioulsy do not use the loadbalancing...

Regards, Michael

JPReyes
Active Contributor
0 Kudos

Unfortunately (As far as I know) SAP does not record that info during the logon at least as standard.

One way to correct problems, is by deploying changes via SAP Frontend Installation Server, So basically you create a new package and distribute the changes automatically.

Regards

Juan

markus_doehr2
Active Contributor
0 Kudos

> Unfortunately (As far as I know) SAP does not record that info during the logon at least as standard.

It can be catched during logon time.

I remember at the times of the old OSS - when you tried to logon directly to one of the application servers - you got the error message: Please don't use a direct logon but rather the group logon - and you got logged of.

There's a user exit for that:

Note 37724 - Customer exits in SAP logon

You may be able to modifiy the exit according to

Note 609863 - How to lock out users using GUIs of wrong version

Markus