cancel
Showing results for 
Search instead for 
Did you mean: 

Name of the current user SAP UI5

meenakshi_raina
Advisor
Advisor
0 Kudos

Hi All,

How can we get the name of the user who has currently logged in. In my model, the field 'sUser' is undefined.

I have used the below code :

In debug mode, sUser is undefined.

Regards

Meenakshi

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member402052
Discoverer
0 Kudos

Hi,

Try this

sap.ushell.Container.getService("UserInfo").getUser()

saurabh_vakil
Active Contributor
0 Kudos

If you are wanting to retrieve the user info of the logged in user in your UI5 app then refer to the blog How to get UserName and other login info in SAP UI5 application. However this works only if you deploy your app to the ABAP repository.