on 02-25-2016 12:48 AM
Hi All,
I have extended CRM My appointments app in Web IDE. I modified the neo.json file in the Web IDE and added the below
{
"path": "/webapp/resources/sap/cus/crm",
"target": {
"type": "destination",
"name": "XXX",
"entryPath": "/sap/bc/ui5_ui5/sap/crm_lib_reuse/sap/cus/crm"
},
"description": "CRM Lib Reuse"
}
The extended application works fine when executed from the Web IDE.
Now when I deploy this extended app on the ABAP server and configure it in a Fiori launchpad, it gives the below error while executing -
Error: failed to load 'sap/cus/crm/lib/reuse/library.js' from /sap/bc/ui5_ui5/ui2/ushell/resources/sap/cus/crm/lib/reuse/library.js: 404 - NOT FOUND
Can anyone please help me with this issue ?
Many thanks in advance,
Regards,
Vivek
Add this code to the extended app's Component.js, right after the first line:
(function() {
jQuery.sap.registerModulePath("sap.cus.crm.lib.reuse", "/sap/bc/ui5_ui5/sap/crm_lib_reuse/sap/cus/crm/lib/reuse");
}());
Regards,
Michal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
The ABAP server is not using neo-app.json to resolve application routes. This file is relevant only for HANA Cloud Platform applications.
In the original application code I see in the Component.js the following code:
(function() {
var sPath = jQuery.sap.getModulePath("cus.crm.mycalendar");
if (sPath.toLowerCase().indexOf("crm_mycal") !== -1) {
if (sPath.lastIndexOf("/") !== sPath.length - 1) {
sPath += "/";
}
jQuery.sap.registerModulePath("sap.cus.crm.lib.reuse",
sPath + "../crm_lib_reuse/sap/cus/crm/lib/reuse");
}
}());
(You can import the application into the Web IDE and see it yourself)
I guess that if you will add this to the code of the extension project's Component.js it will work as well on the ABAP server.
Can you try and update if it helps?
Thanks,
Rotem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Rotem for the hint.
I tried it, but it did not work. When I execute the custom tile I dont see "component.js" being called, but my changes are visible.
I tried with both of the below options but it did not work.
(function() {
var sPath = jQuery.sap.getModulePath("cus.crm.mycalendar");
if (sPath.toLowerCase().indexOf("crm_mycal") !== -1) {
if (sPath.lastIndexOf("/") !== sPath.length - 1) {
sPath += "/";
}
jQuery.sap.registerModulePath("sap.cus.crm.lib.reuse",
sPath + "../crm_lib_reuse/sap/cus/crm/lib/reuse");
}
}());
(function() {
var sPath = jQuery.sap.getModulePath("cus.crm.mycalendar");
if (sPath.toLowerCase().indexOf("zcrm_mycal") !== -1) {
if (sPath.lastIndexOf("/") !== sPath.length - 1) {
sPath += "/";
}
jQuery.sap.registerModulePath("sap.cus.crm.lib.reuse",
sPath + "../crm_lib_reuse/sap/cus/crm/lib/reuse");
}
}());
Please help.
Thanks,
Vivek
Hi Rotem,
I debugged standard code and this is the issue I found -
In the method below, the value of sPath is " /sap/bc/ui5_ui5/sap/CRM_MYCAL"
Note that "CRM_MYCAL" is in capital letters, if it had been "crm_mycal", it would have successfully registered and worked fine.
(function() {
var sPath = jQuery.sap.getModulePath("cus.crm.mycalendar");
if (sPath.toLowerCase().indexOf("crm_mycal") !== -1) {
if (sPath.lastIndexOf("/") !== sPath.length - 1) {
sPath += "/";
}
jQuery.sap.registerModulePath("sap.cus.crm.lib.reuse",
sPath + "../crm_lib_reuse/sap/cus/crm/lib/reuse");
}
}());
So now the question is, why does jQuery.sap.getModulePath("cus.crm.mycalendar") return "/sap/bc/ui5_ui5/sap/CRM_MYCAL" and NOT "/sap/bc/ui5_ui5/sap/crm_mycal"
Can you please throw some light where can I check this ?
Thanks,
Vivek
On further debugging I found that standard SAP code registers the crm_mycal component twice, the first one is correct, but the second one is with capital letters and this is causing the issue.
2016-02-26 21:11:28 registerResourcePath ('cus/crm/mycalendar', '/sap/bc/ui5_ui5/sap/crm_mycal/') - sap.ui.ModuleSystem core-min-0-dbg.js:15226
2016-02-26 21:11:28 registerResourcePath ('cus/crm/mycalendar','/sap/bc/ui5_ui5/sap/CRM_MYCAL/') - sap.ui.ModuleSystem
Yet to figure out why this happens
Thanks,
Vivek
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.