Skip to Content

Name of the current user SAP UI5

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 11, 2017 at 08:22 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 13, 2017 at 01:15 PM

    Hi,

    Try this

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

    Add comment
    10|10000 characters needed characters exceeded