Skip to Content
avatar image
Former Member

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

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

error1.png (7.0 kB)
error2.JPG (21.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 26, 2015 at 08:43 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Sarbjeet Singh

      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 ?

      error2.JPG (51.8 kB)
  • Oct 26, 2015 at 09:43 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded