cancel
Showing results for 
Search instead for 
Did you mean: 

How to get details of logged in user in SAPUI5

former_member243729
Participant
0 Kudos
2,528

Not a FIORI launchpad application but just in a SAPUI5 application, how can we get the logged in user details ?

The below API provided by SAP is not helpful. Any other options? or Am I doing anything wrong with this API ?

This method MUST be called by the Unified Shell's container only, others MUST call 

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

Constructs a new instance of the user information service.

new sap.ushell.services.UserInfo()

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member553417
Participant
0 Kudos

Hi Venkata,

If you are not launching the application in any of the portal you can use the below link to get the user id currently logged in

https://blogs.sap.com/2015/04/16/using-the-hcp-user-api-in-web-ide/

Thanks,

Drushya

maheshpalavalli
Active Contributor
0 Kudos

Hi Venkata Sunil Naidu Chennam,

if not in launchpad, then check the below blog:

https://blogs.sap.com/2015/04/06/how-to-get-username-and-other-login-info-in-sap-ui5-application/

I would prefer to have an entityset which returns my user details in case if I want some additional details, which the above service in the link might not provide.

BR,

Mahesh