Skip to Content
4
Former Member
Apr 16, 2014 at 08:31 AM

SAPUI5 - how to get loged User ID?

16105 Views

Hi experts,

I have problem, when I try to get the ID from the loged user in SAPUI5.

I have tried:

1.

var oUser = sap.ui2.shell.getUser();

var userId = oUser.getId();

Here I have error: Uncaught TypeError: Cannot read property 'shell' of undefined

2.

var oUser = new sap.ushell.services.UserInfo();
var userId = oUser.getId();

Here I have error: Uncaught TypeError: Cannot read property 'services' of undefined

I will appreciate if you can show me an example or to guide me, beacause I don't know what I'm doing wrong.

BR,

Simona