cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation Error when using fiori launch pad - Could not open App, Try again later

Former Member
0 Kudos

Hello Experts,

I develop a SAP FIORI Custom Application, this is working fine without any issue when we run it directly by its URL.

But problem is that when I am running it by FIORI Launch Pad I am getting the following error (still functionality working fine) when navigate from one view to another.

And getting following errors in Console –

2015-10-26 11:11:31 Illegal new hash - cannot be parsed: 'page|{"id":"Detail"}|0' - sap.ushell.renderers.fiori2.Shell.controller         core-min-0.js:85

core-min-0.js:85 2015-10-26 11:11:31 Could not open app. Try again later. -                                                                              core-min-0.js:85

I am using getEventBus() Method for navigation so the bus subscription code is in App.view.Controller as following.

       onInit: function() {

var bus = sap.ui.getCore().getEventBus();

bus.subscribe("nav", "to", this.navHandler, this);    

},

navHandler : function(channelId, eventId, data) {

if (eventId === "to") {

if (!data.id) {

jQuery.sap.log

.error("'nav to' event cannot be processed. data.id must be given");

}

this.navTo(data.id, data.data, true);

} else if (eventId === "back") {

if (!data.step) {

data.step = 1;

}

if (data.home) {

jQuery.sap.history.backToHash("");

} else if (data.step > 0) {

jQuery.sap.history.back(data.step);

} else {

jQuery.sap.log

.error("'nav back' event cannot be processed. At least one from [data.step, data.home] must be given with valid value");

}

} else if (eventId === "virtual") {

jQuery.sap.history.addVirtualHistory();

} else {

jQuery.sap.log

.error("'nav' event cannot be processed. There's no handler registered for event with id: "

+ eventId);

}

},

navTo : function(id, data, writeHistory) {

if (id === undefined) {

// invalid id

jQuery.sap.log

.error("navTo failed due to missing id");

} else {

// load view on demand

var app = this.getView().app;

if (app.getPage(id) === null) {

var type = ("Home" === id) ? "JS" : "XML";

var page = sap.ui.view({

id : id,

viewName : "com.abc.view." + id,

type : type

});

app.addPage(page); 

jQuery.sap.log

.info("app controller > loaded page: "

+ id);

}

// navigate in the app control

var transition = ("Update" === id) ? "show"

: "slide";

app.to(id, transition, data);

// write browser history

if (writeHistory === undefined || writeHistory) {

var bookmarkable = false;

var stateData = {

id : id

};

jQuery.sap.history.addHistory("page",

stateData, bookmarkable);

}

// log

jQuery.sap.log.info("navTo - to page: " + id);

}

},

And navigation code from one to other is as below –

       handleListItemPress : function (evt) {

var cust_no = evt.getSource().mProperties.title;

var cust_name = evt.getSource().mAggregations.attributes[0].mProperties.text;

var cust_city = evt.getSource().mAggregations.attributes[1].mProperties.text;

var bus = sap.ui.getCore().getEventBus();

bus.publish("nav", "to", {

id : "Detail",

data : {

cust_no : cust_no,

cust_name : cust_name,

cust_city : cust_city

}

}), sap.ui.getCore().getEventBus().publish("app", "RefreshDetail", {

context : evt.getSource().getBindingContext(),

cust_no : cust_no,

cust_name : cust_name,

cust_city : cust_city

});

},

I don’t know where I am wrong, if you find any solution for it please help me.

Thanks  & Regards,

Imran Ali

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Imran,

There are few design guide lines for Fiori like apps development. Until and unless we follows those, our custom apps will not work as standard SAP apps.

First principle is to use component.js file to decide the navigation and context parameters within Fiori like app. Because in Fiori only Fiori launchpad.html is the html file which will be acts as shell to hold all fiori apps. So your responsibility is to just add component.js file with all possible routes and link your component file in your launchpad through lpd_cust transaction SAPUI5.Component=Custom UI Component name.

Fiori apps launch process happens through semantic object navigation so please make sure that you have created a custom semantic object through the transaction /UI2/SEMOBJ to launch your application.

Please verify above points.

Regards,

Arun.

Former Member
0 Kudos

Hi Arun,

Thanks for reply .

I verified my semantic object names and target mapping they all seems right. I attach some screen shots of these settings in above comment (Sarbjeet's Reply). Please find them and if it seems any mistake please ensure me.

Former Member
0 Kudos

Hi Imran,

Are you using component based structure for your custom app ? If yes, from your attached screenshots for LPD_CUST role SAPUI5.Component value seems to be set to some incorrect component value. You need to give actual name of component.js with complete namespace to resolve the path. From your error screenshots also, It is showing problem with your component  file path. Please verify one more time.

Regards,

Arun.

Former Member
0 Kudos

Thanks Arun,

As per my knowledge we have to give "Name Space" in SAPUI5.Component = (XYZ)NameSapce And i am passing correct namespace here. I checked it in my Component.js file.

Former Member
0 Kudos

This message was moderated.

gill367
Active Contributor
0 Kudos

Hi Imran;

Could you please share your Target mapping settings and LPD_CUST settings using screenshots.

Seems like an issue with type of application selected in target mapping.

Make sure "SAPUI5.Component=" parameter is mentioned correctly in LPD_CUST

Regards,

Sarbjeet Singh

Former Member
0 Kudos

Hi Sarbjeet,

Thanks for reply...

I checked my all setting related to my custom applications twice, here i am sharing attached configuration, please check it.

Target Mapping -

LPD_CUST Role -

Semantic Object -

gill367
Active Contributor
0 Kudos

Hi Imran;

Thanks for the information.

You could try one thing.

We should not use globaleventbus for the applications running in fiori launchpad as the same event could be handled by some other evenhandler present in the FLP.

nav as the channel name and to as the event name could be creating the problem. try using some other event name and channel name like Znav and Zto and try again.

Important link explaining wht all we need to take care while developing applications running inside FLP is as below

Regards,

Sarbjeet Singh

Former Member
0 Kudos

Thanks Sarbjeet,

I will go through your suggested link . Hope this will help me .

gill367
Active Contributor
0 Kudos

Hi Imran;

Have you tried changing the channel and event name?

Regards,

Sarbjeet Singh

Former Member
0 Kudos

Hi Sarbjeet,

I did try with changing the event names (i.e- nav replaced by znav, to replaced by zto).

But didn't get success yet now , still facing same problem.

gill367
Active Contributor
0 Kudos

Hi Imran;

Expand the errors in browser console to find out the line in your controller which triggered the error.

Regards,

Sarbjeet Singh

Former Member
0 Kudos

Hi Sarbjeet,

I already checked with console error but the error is not in my controller, this error is coming from core-min-0.js . Can be do anything for this type of error ?