cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Approve timesheet

aakash_neelaperumal2
Active Participant
0 Kudos
262

I am trying to extend the approve timesheet V2.0 app and I when trying to test locally using apache server, I am getting below error.

Uncaught Error: failed to load 'zhcm/approve/timesheet/Component.js' from /ZHCM_TSH_APV/Component.js: Error: failed to load 'hcm/approve/timesheet/Component.js' from ../../../../../resources/hcm/approve/timesheet/../HCM_TSH_APV/Component.js: 404 - Not Found

Below is the component.js file. Do you see any error here ? Please help.

jQuery.sap.declare("zhcm.approve.timesheet.Component");

// use the load function for getting the optimized preload file if present

sap.ui.component.load({

  name: "hcm.approve.timesheet", 

  url: jQuery.sap.getModulePath("hcm.approve.timesheet") + "/../HCM_TSH_APV" // provide parent project url

  // we use a URL relative to our own component; might be different if

  // extension app is deployed with customer namespace

});

hcm.approve.timesheet.Component.extend("zhcm.approve.timesheet.Component", {

  metadata: {

  version : "1.0",

  config : {

  "sap.ca.i18Nconfigs": {

  "bundleName":"zhcm.approve.timesheet.i18n.i18n"

  },

    "sap.ca.serviceConfigs": [{ 

               name: "HCM_TIMESHEET_APPROVE_SRV", 

               masterCollection : "TIME_PENDING", 

               serviceUrl: URI("/ZHCM_TSH_APV/proxy/sap/opu/odata/sap/HCM_TIMESHEET_APPROVE_SRV/")

               .directory(),

               isDefault :true, 

               countSupported : true, 

               useBatch : true, 

               mockDataSource : jQuery.sap.getModulePath("zhcm.approve.timesheet") + "/model/metadata.xml" 

          }] 

  },

  customizing: {

  }

  }

});

View Entire Topic
gill367
Active Contributor
0 Kudos

Hi Aakash;

The issue could be in your index.html.

please check the resourceroot parameter. It should be like below for working fine.

Make sure parent project is also published on the tomcat server.

Regards,

Sarbjeet Singh