Skip to Content

Hy all,

i had the requirement to find out, which theme the current logged on user has in the fiori launchpad. I’ve searched a little and would like to share the code with u.

1) First Step: Get UserInfo

var UserInfo = sap.ushell.Container.getService(“UserInfo”)

2) Second Step: Get User

var User = UserInfo.getUser();

3) Third Step: Get Them

User.getTheme();

Or in Shortform:

sap.ushell.Container.getService(“UserInfo”).getUser().getTheme();

The 3 Method calls will give you the current Theme ID of the logged on User:

/wp-content/uploads/2016/06/console_sapui5_theme_968448.png

This helped me for my custom development.

I wish you a nice day & thanks for any rewards / feedbacks.

Kind regards,

Michael

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Yogesh Beria

    The ushell services actually have a lot to offer.

    Its feels like no one really finds it in the documentation to use it where required. Or may be the documentation needs some improvement.

    I recently stumbled upon user Personalization which has helped me enhance my applications.

    (0) 
  2. Jacques-Antoine Ollier

    Thank you for this nice piece of info Michael!

    I saw this ushell service in the documentation just before and I could find your blog with the userinfo tag. 🙂

    Do you think this works with the portal service (former HANA Cloud Portal) to retrieve the logged in user info?

    To be noticed, it is SAP Cloud Identity that manages the user in the portal.

    I would need this this info in order to restrict my OData queries, specifically for the lists. I want to filter the list on only the documents corresponding to the logged in user.

    Thank you for your attention.

    Best regards.

    Jacques-Antoine Ollie

    (0) 

Leave a Reply