cancel
Showing results for 
Search instead for 
Did you mean: 

Query the current logged in user on SAP B1 HANA 9.3 PL05

0 Kudos

Hi Experts,

How can I get the current logged in user detail on SAP B1 HANA? I tried the following query but it was not work

SELECT "USER_CODE" from "OUSR" WHERE "USERID" = $[user]

SELECT $[user] FROM DUMMY

KennedyT21
Active Contributor
0 Kudos

Hi Akina,

Try this if you want the logged user from Sales order screen

SELECT T0."U_NAME" FROM OUSR T0 WHERE T0."INTERNAL_K" = $[ORDR."UserSign"]


Regards,

Kennedy

Accepted Solutions (0)

Answers (6)

Answers (6)

Select "UserCode" from USR5 T0 where T0."SessionID" = (SELECT top 1 connection_id FROM M_SESSION_CONTEXT WHERE connection_id=current_connection)

former_member724876
Discoverer
0 Kudos

Thank you @Trang Nguyen. Its very helpful. its work in SAP B1 HANA version in query Report.

dinesh-pn
Active Participant

Dear Akina,

Use the following menu option to check the current logged in users:

Modules - Administration - Utilities - Connected Clients

This will show you all the connected users and there system details

Hope this information is useful

Regards

Dinesh

Dear Dinesh,

Thanks for your feedback. But, I mean, i want to get Current user login, aims to write query or notification.

Ex: i login by account "manager". So, I want to know query to get account manager that login.

For SAP - SQL, i know query for that. But for Hana I don't know.

narayanis
Active Contributor
0 Kudos

Hi,

Try T0.Internal_k instead of Internal_K

ashishrbyadav
Explorer
0 Kudos

You can see the list of all logged in users in the "Connected Clients" so why there is the requirement of query.

rashantha
Participant
0 Kudos

Because you want to use the information from the current logged in user to run queries.

dinesh-pn
Active Participant
0 Kudos

Dear Akina,

It is a FMS you need to assign this in a field on any screen.

For example :

Save this query and select a field from any marketing data click Alt + Shift + F2 assign this query when you click it will display the user name.

dinesh-pn
Active Participant
0 Kudos

Dear Akina,

I have this FMS to get current user in SAP B1 HANA : check if its working for you :

SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]

Regards

Dinesh

Dear Dinesh,

i try your query but it don't work. Image below show error for this