Skip to Content
0

Name of the current user SAP UI5

Jul 11, 2017 at 06:55 AM

157

avatar image

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

capture1.png (9.6 kB)
capture.png (7.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

saurabh vakil Jul 11, 2017 at 08:22 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 13, 2017 at 01:15 PM
0

Hi,

Try this

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

Share
10 |10000 characters needed characters left characters exceeded