Skip to Content
0

Neo-app.json path in local webide for Re-Usable component of Std Fiori App

May 03, 2017 at 06:02 AM

277

avatar image

Hi All,

I have imported standard app "Manage Material Coverage" in my local webide. As can be seen from the fiori library(screenshot 1) , it consists of 2 components. 1) PP_MATSHORT_DT

2) Reusable Component PP_MRP_REUSE

So I imported both the applications in my local webide and my webide workspace now looks like follows(screenshot 2)

Now when I run the app PP_MATSHORT_DT in the fiori sandbox on local webide , quite obviously it gives error "Could not load app. Try again later" , because I need to explicitly set up the link to the re-usable component PP_MRP_REUSE inside my main app PP_MATSHORT_DT. In the error console (screenshot 3) , loading of library.js inside the reuse component is shown to be failed

As per my understanding, this broken path of reuse component needs to be rectified in neo-app.json of the main app . However I tried add a new path in my neo-app.json but not sure what exactly to add. The library.js in reuse component exists in the following path(screenshot 4)

Any hints will be appreciated..

PS: Just wanted to add one more observation (not sure if its relevant to the above). In the component.js file of the main app PP_MATSHORT_DT I could see the following code

/*
 * Copyright (C) 2009-2014 SAP SE or an SAP affiliate company. All rights reserved
 */
jQuery.sap.declare("i2d.pp.materialshortge.details.Component");
jQuery.sap.require("sap.ca.scfld.md.ComponentBase");
(function() {
var i = window.location.pathname.indexOf("/ui5_ui5/");
if (i !== -1) {
var p = window.location.pathname.slice(0, i + 8);
p += "/sap/pp_mrp_reuse/i2d/pp/mrpcockpit/reuse";
jQuery.sap.registerModulePath("i2d.pp.mrpcockpit.reuse", p);
}
}());

Now in the above code there is a condition which checks for the string "/ui5_ui5/" in the URL and if it finds then only it calls registerModulePath for reusable component. Now since we are running our app in fiori sandbox in local webide , the URL is not going to have /ui5_ui5 string in the URL and the if condition is bound to fail.

I am not sure if the neo-app.json will take care of the above

Regards

reuse-1.png (13.8 kB)
reuse-2.png (6.3 kB)
reuse-3.png (69.2 kB)
reuse-4.png (12.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Krishna Kishor Kammaje
May 04, 2017 at 04:52 AM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Krishna,

Thanks for your reply. Actually I had already gone through that thread and made changes in my neo-app.json as follows but thing is no matter what changes i make in neo-app , in the console the path for library.js for reuse component still points to original location as in the above screenshot.

Kindly let me know if I am doing something wrong in neo-app

{ <br>  "path": "/resources/i2d/pp/mrpcockpit/reuse", <br>  "target": {
        "type": "application", <br>                 "name": "pp_mrp_reuse", <br>                 "entryPath": "/sap/bc/ui5_ui5/sap/pp_mrp_reuse/i2d/pp/mrpcockpit/reuse" <br>               }, <br>   "description": "MRP Lib Reuse" <br>    },

Regards

0
Amber . May 08, 2017 at 09:32 AM
0

Hi All,

I have tried in the HCP cloud also but same issue in the webide comes.

Please find my neo-app.json code of the Main app for the new destination for re-use library. Even after adding this , its giving the same issue of library.js not found in the Reuse component. Also attached is my project structure in webide.

Neo-app.json in PP_MATSHORT_DT

{   "welcomeFile": "index.html",    
    "routes": [
           {          
            "path": "resources/PP_MRP_REUSE/i2d/pp/mrpcockpit/reuse/",          
            "target": {
                "type": "destination",                          
                "name": "FGT_DEST_OFC",                          
                "entryPath": "/sap/bc/ui5_ui5/sap/pp_mrp_reuse/i2d/pp/mrpcockpit/reuse/"                      
             },          

             "description": "MRP Lib Reuse"        
          },

Regards


reuse-6.png (12.8 kB)
reuse-4.png (12.3 kB)
Share
10 |10000 characters needed characters left characters exceeded
Amber . Jun 02, 2017 at 12:58 PM
0

I resolved the issue. Actually I had to deploy the re-use library to HCP platform and use the name of the deployed app in neo-app.json

Share
10 |10000 characters needed characters left characters exceeded