cancel
Showing results for 
Search instead for 
Did you mean: 

Get User ID on logged UI5 App

Former Member
0 Kudos

Hi fórum

I have a SAP Ui5 App in SAP Hana Cloud Portal (developed with SAP Web IDE), i run this App from Success Factors (i have installed the SSO), Soi need to "get the user id" was logged..  how can i do that ?

Thnks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (2)

Answers (2)

kedarT
Active Contributor
0 Kudos

Hi Josue,

Try this - window.sap.ushell.Container.getUser().getId()

Hope this helps.

Former Member
0 Kudos

Hi Josue,

This is an example to fetch user from model

var createdByFullName='';

        var usersList=                      model.SystemDataMgr.getSystemUsers();   

            var foundUser='f';

            for (var j=0; j<usersList.length; j++){

                if(objectDetails.CREATEDBY==usersList[j].USER_ID){

                    foundUser='t';       

                    createdByFullName= usersList[j].NAME + " ("+usersList[j].USER_ID+")";

                }

                if(foundUser=='t'){

                    break;

                }

            }

For more help, refer to thread : SAPUI5 - how to get loged User ID? | SCN

Regards

Uday