cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameter from fiori launchpad to the app in sapui5

Former Member
0 Kudos

Hi All,

I have a requirement to pass a parameter from Fiori launchpad to the application. Then i have to use that parameter to construct the OData service URL and read the data. So how can we pass the parameters from Fiori launchpad tile to app? Thank you in advance.

Regards,

Seshu

Tags edited by: Michael Appleby (but please start doing this on your own)

Accepted Solutions (0)

Answers (2)

Answers (2)

RMueller-Cajar
Explorer
0 Kudos

Hello Seshu,

have you read the following documentation?:

Embedding SAPUI5 Applications into the Fiori Launchpad Application Container - User Interface Add-On...

In your case you simply have to use the following Coding in your component.js

var sScenario = this.getComponentData( ).startupParameters.BUS_SCENARIO[0];

If you have more startup Parameters they will all be in

this.getComponentData( ).startupParameters;

(Note: you will have to use a component in your UI5 App to do so)

Regards,

Robin

Former Member
0 Kudos

Hi,

good reply but in my case, I need to jump directy the the 3rd view of the destination app.

How can I "tell" the app to get directly there.

(my first view is a field search page, then the second the client list, and the third is the clients's products.Resuming: with a click on the product ID on the first app, I aim to jump directly to the selected clients's product).

I do have a component.js and can grab the sartupParameters.GUID[0] (that has the product ID).

The documentation here (Handling Startup Parameters - User Interface Add-On for SAP NetWeaver - SAP Library) doesn't give a good explanation on how does it work or how to implement it.

Any help is welcome.

Many thanks,

Marc

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Seshu,

It is static value or dynamic value? Where is the value stored?

Please share examples and use case scenarios.

Regards, Masa

SAP Customer Experience Group - CEG

Former Member
0 Kudos

Hi Masa,

I will explain my scenario:

I have to make two tiles in Fiori launchpad. These two tiles have to open the same app. But the data that should be displayed on app when I click on tile 1 is different from tile 2. The data that should be read in the app is based on the parameter that I send from launchpad tile.

Coming to your questions:

It is a static value that should be passed to the app. And I think we have to store it in Fiori Launchpad tile configuration.

Thanks & Regards,

Seshu

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Seshu,

Do you have any issue when you set parameter in the tile?

Static App Launcher Tiles - User Interface Add-On for SAP NetWeaver - SAP Library

Regards, Masa

SAP Customer Experience Group - CEG

Former Member
0 Kudos

Hi Masa,

I will explain scenario:

I have Main.view.xml and Main.controller.js in my App. I read the data in Main.controller.js using the following statement.

var bus_scenario="Lead to Deal Approval";

oModel.read("BusScnCollection('"+bus_scenario+"')?$expand=BusinessProcess",null, null, true,function(data,response)

Now my requirement is to get the value for bus_scenario variable from Fiori launchpad configuration.

What I did in Fiori launchpad configuration:

Then, When I launch my app by clicking on tile, the URL appears in the following way.

https://<server>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html#ZCIO_DASHBOARD-display?BUS_SCENARIO = "ORDER TO CASH"

So I can read this parameter in Main.controller.js and assign to bus_scenario variable. But it is possible that user can change the parameter (from ORDER TO CASH to LEAD TO DEAL) directly in the URL, So that he can get the data corresponding to LEAD TO DEAL (which he should not get). Because when he clicks on ORDER TO CASH Tile, he should get only the data corresponding to it.

So, is there any other way to send parameters from launchpad configuration to app, so that we can use those parameters in app (Main.controller.js) ?

is there any way to hide parameters in the URL and send them?

Thanks & Regards,
Seshu

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Seshu,

How about checking authorization in the backend? The user should not see the data lead to deal. So I guess SAPGUI transaction has already some checks and you can re-use the check logic logic.

Regards, Masa

SAP Customer Experience Group - CEG