cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 App not working on Front-end system

former_member207703
Active Participant
0 Kudos

Hi you all,

     I just started SAPUI5 App development. I am facing a strange problem, my app is working fine when i am running it on my Eclipse Neon. But when i import it to SAP Front end system, it jsut displaying blank page.

     I can't able to figure out what is actual problem with it.

   

     I created an indext.html file that calling Componet.js:-

          sap.ui.getCore().attachInit(function () {

            new sap.m.Shell({

            app: new sap.ui.core.ComponentContainer({

            name: "sap.ui.test.myFiori",

            height : "100%"

                })

              }).placeAt("content");

     I created a component.js where i use  metadata to call rootView, that is App.view.xml like this:

   

     metadata : {

       id: "sap.ui.test.myFiori",

       name : "{{appTitle}}",

            description : "{{appDescription}}",

       version : "1.0",

       includes : [],

       dependencies : {

       libs : [ "sap.m", "sap.ui.layout" ],

       components : []

       },

       rootView : "sap.ui.test.myFiori.view.App",......

   

     But view page is not accessible.

     May i have to use sap.ui.commons library, or  sap.m is enough to run a simple app?

    

     Have i require to change my view type from xml to js, or is it okay?


     Thanks and regards,

     Anoop Kumar Rai

Accepted Solutions (1)

Accepted Solutions (1)

anete
Participant
0 Kudos

What is SAPUI5 version you use in eclipse and what version do you have on SAP?

Regards,

Anete

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,

Can you please tell me how i check that.I have no knowledge about it.

I just use this link : SAP Development Tools for Eclipse - Neon Software Repository to download SAPUI5 on neon. And i have know knowledge about SAP's version.

Regards,

Anoop Rai

anete
Participant
0 Kudos

You can check versions by opening SAPUI5 Demo kit both on your local installation and on SAP server:

<host>/sap/bc/ui5_demokit/index.html#versioninfo.html

Regards,

Anete

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,


On local system i tried it. Eclipse generate a Web app preview with url http://localhost:61720/New_SAPUI5_Pro7/index.html

When i add #versioninfo.html app become blank.

And when i tried http://localhost:61720/sap/bc/ui5_demokit/index.html#versioninfo.html

, it give

HTTP ERROR: 404

Problem accessing /sap/bc/ui5_demokit/index.html. Reason:

    Not Found

Am i doing right or have to do something else.


Regards,

Anoop Rai

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,


Client system using 1.360 Version at there end. And i am developing SAPUI5 apps on Eclipse Neon.


But i cant able to trace my local system SAPUI5 Version.

How can i check version on eclipse?

Regards,

Anoop Rai

itsRahul
Participant
0 Kudos

Hi Anup

Are you trying to extend any existing App from FIORI launchpad?

If such is the case please check the parent component name in the extended component.js.

former_member207703
Active Participant
0 Kudos

Hi Rahul,

No its totally a new app. I am developed it on Eclipse Neon, where its's working fine. But on SAP Front end system its not working.

Regards,

Anoop Rai

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,


On Client system using 1.360 Version at there end. And i am developing SAPUI5 apps on Eclipse Neon with 1.380 Version.


Is there any issue due to this version difference?


Regards,

Anoop Rai

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,


On Client system using 1.360 Version at there end. And i am developing SAPUI5 apps on Eclipse Neon with 1.380 Version.


Is there any issue due to this version difference?


Regards,

Anoop Rai


anete
Participant
0 Kudos

Hi Anoop Rai,

Your SAPUI5 versions are OK. To figure out whats the actual problem is, have you tried to open your app on the server with Chrome browser and developer tools enabled?

Component-preload.js file error is not important, just ignore it. What are next errors?

Regards,

Anete

former_member207703
Active Participant
0 Kudos

Hi Bondzinska,


Thanks for your support.

Today i run my app on Eclipse Kepler that is running SAPUI5 version 1.24.2 and i got blank screen here.

When i see console it showing following error..

I check it, it is thrown by UIComponent.js from

I think there is something wrong with my Component.js. Because there only i written code for Routing, that not support by older versions.

My Component.js file code as following:-


sap.ui.define([

               "sap/ui/core/UIComponent",

               "sap/ui/model/json/JSONModel",

               "sap/ui/Device"

           ], function(UIComponent, JSONModel, Device) {

               "use strict";

return sap.ui.core.UIComponent.extend("sap.ui.test.myFiori.Component", {

  metadata : {

  id: "sap.ui.test.myFiori",

  name : "{{appTitle}}",

  description : "{{appDescription}}",

  version : "1.0",

  includes : [],

  dependencies : {

  libs : [ "sap.m", "sap.ui.layout" ],

  components : []

  },

  config : {

  resourceBundle : "i18n/i18n.properties",

  serviceConfig : {

                 serviceUrl : "proxy/http/services.odata.org/V2/(S(k42qhed3hw4zgjxfnhivnmes))/OData/OData.svc/"

             }

  },

  rootView : "sap.ui.test.myFiori.view.App",

  routing : {

  config : {

  routerClass : "sap.m.routing.Router",

  viewType : sap.ui.core.mvc.ViewType.JS,

  viewPath : "sap.ui.test.myFiori.view",

  controlID : "app",

  controlAggregation : "detailPages",

  clearTarget : false,

  transition : "flip"

  },

  routes : [ {

  pattern : "",

  name : "overview",

  target : [ "empty", "overview" ],

  }, {

  pattern : "",

  name : "empty",

  target : "empty"

  }, {

  pattern : "detail/{employeePath}",

  name : "detail",

  target : [ "overview", "detail" ],

  greedy : true

  } ],

  targets : {

  overview : {

  viewName : "Overview",

  controlAggregation : "masterPages"

  },

  detail : {

  viewName : "EmployeeDetail",

  controlAggregation: "detailPages",

  parent: "overview"

  },

  empty : {

  viewName : "Empty",

  controlAggregation: "detailPages"

  }

  }

  }

  },

  init : function() {

         UIComponent.prototype.init.apply(this, arguments);

         var mConfig = this.getMetadata().getConfig();

         // always use absolute paths relative to our own component

         // (relative paths will fail if running in the Fiori Launchpad)

         //var rootPath = jQuery.sap.getModulePath("sap.ui.demo.tdg");

         // set i18n model

         var i18nModel = new sap.ui.model.resource.ResourceModel({

             bundleUrl : [mConfig.resourceBundle].join("/")

         });

         this.setModel(i18nModel, "i18n");

        

         // Create and set domain model to the component

         var sServiceUrl = mConfig.serviceConfig.serviceUrl;

         var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true);

         this.setModel(oModel,"employee");

         console.log(oModel);

         // set device model

         var deviceModel = new sap.ui.model.json.JSONModel({

             isTouch : sap.ui.Device.support.touch,

             isNoTouch : !sap.ui.Device.support.touch,

             isPhone : sap.ui.Device.system.phone,

             isNoPhone : !sap.ui.Device.system.phone,

             listMode : sap.ui.Device.system.phone ? "None" : "SingleSelectMaster",

             listItemType : sap.ui.Device.system.phone ? "Active" : "Inactive"

         });

         deviceModel.setDefaultBindingMode("OneWay");

         this.setModel(deviceModel, "device");

         console.log("router iniciated");

         //this.getRouter().initialize();

         var router = this.getRouter();

         console.log(router);

         //this.routeHandler = new sap.m.routing.RouteMatchedHandler(router);

         router.initialize();

         console.log("router created" , router);

            

     }

  });

});

Please check and if some mistake is there inform me. I tried a lot, when i removing  routerClass : "sap.m.routing.Router", its not throwing this error but App just displaying split App with blank pages.

Regards,

Anoop Rai


Answers (2)

Answers (2)

fredericorocha
Explorer
0 Kudos

Hello,

It seems to me that you have a CORS issue. Go to your IE and enable CORS (change the setting "Access data sources across domains" to enabled).

Best regards,

Frederico

former_member207703
Active Participant
0 Kudos

Hi Rocha,

I able to get data on Eclipse Neon that is running on SAPUI5 version 1.38 and its working great as per requirement, but facing problem when i am running same app on Eclipse Kepler that is running on SAPUI5 version 1.24.

I uploaded this same app on Client Frontend SAP system, that is running on Version 1.36, showing nothing but a blank page.

If its just CORS issue it didn't run on vrs 1.38. I am now at office system, i will try your suggestion on my home PC and let you know.


Regards,

Anoop Rai

former_member227918
Active Contributor
0 Kudos

Hi Anoop,

Most probably this issue is coming due to version diff i guess, can u just change version in your app manually in project.json file and check, and also u can change the resource path from existing to online one like https://openui5.hana.ondemand.com/resources/sap-ui-core.js.

I am not sure whether it will solve your prob or not, but it may be a workaround to analyze the issue.

Regards,

Akhilesh

former_member207703
Active Participant
0 Kudos

Hi,

Thank you all and specially . Only due to your solution i go for versions.

Now problem is solved.

I used many UI5 API libraries that are not part of 1.36 like FormattedText, due to that i am getting blanks screen.

Thanks and regards,

Anoop Rai

former_member203031
Contributor
0 Kudos

Hi Anoop,

Please check in the inspect element the networks tab weather all the pages are getting called or

do u find any errors in the console tab?

Thanks,

Deepak.

former_member207703
Active Participant
0 Kudos

Hi Deepak,

Actually i have to run this app on a remote system, that have outdated IE browser only. So it's not possible for me to access console there.

But when i am running it on my current system i am getting following error:

         

    

I understand odata service is not public, due to that i am getting some errors but my app displaying initial screen here.

But when i am importing it to SAP Frontend server it just displaying a blank screen.

Thank you for your quick reply.

Regards,

Anoop Kumar Rai.

former_member203031
Contributor
0 Kudos

Hi Anoop,

I hope u cant run this application through local host.

You have to run the application with the client URL.

former_member207703
Active Participant
0 Kudos

Hi Deepak,

Yes i know it. Thats why i imported it to client and then test it. But its not working there. Only a blak page showing me. I think its just accessing Index file, and don't go to Component.js.

Regards,

Anoop Rai

former_member203031
Contributor
0 Kudos

exactly.

make sure the path of the component.js file in the index.html is correct or not?

once check the view path how u defined for the view names and in the compnent.js file.