Skip to Content

Passing userid dynamically to oDataservice in dynamic tile in fiori

Jun 01, 2017 at 01:39 AM


avatar image


We have a dynamic tile in fiori launchpad , where we are using a service which takes userid as input,which shows count of materials based on userid.

My system arch is like we have HANA as backend and xsodata is created out of it and registered in gateway system, which is then consumed by fiori. The connection setting between gateway and HANA is using service username and password and users are not maintained in HANA.

Now the issue is how do I pass user id dynamically to my service which i am using in tile. Since dynamic tile is a configuration I could not write any code to get the logged in userid.

So what are the ways I can pass the logged in userid to my service?

Please advise.

Thanks, Swarnaprakash

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sarah Lottman
Jun 01, 2017 at 12:50 PM

To give a bit more context - there are no named users in HANA, only a service user, so XSJS to get the user ID is not an option. Also, there is no Web Dispatcher in the Landscape, so calling native HANA directly from UI5 is not an option.

10 |10000 characters needed characters left characters exceeded
Jamie Cawley
Jun 02, 2017 at 01:54 AM

The username should be available in gateway as SY-UNAME. So you should be able add some coding in gateway to pass it to the service and filter the data accordingly.



10 |10000 characters needed characters left characters exceeded