cancel
Showing results for 
Search instead for 
Did you mean: 

How can i remove this Error

Former Member
0 Kudos

i´m trying to run the shopping cart sap demo that i download and modified

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Do you have the error with the original version?

If you have no problems with the original, then please include your code (changes made).

Regards, Mike

SAP Technology RIG

Former Member
0 Kudos

i dont undestand what you say ...sorry ... i explain now

I downloaded the demo ShoppingCart SAP code and am trying to use the template OpenSap Course. I separated view / controller dirs. I dont changed the file code (only the dirs name). I changed the file structure. I created  index.html,  manifest.json and Components.js. Now I'm trying to run with the files mockdata locally. I can send the code via email if interested.

D_Chia
Active Participant
0 Kudos

double-check the '_sMetadataPath' and '_sJsonFilesModulePath' path names set in the code of localService/mockserver.js

see if it corresponds to your resourceroots correctly (i assume you specified your own in the index.html file)

Former Member
0 Kudos

My mockserver.js is correct (i think) see below

sap.ui.define(["sap/ui/core/util/MockServer" ],
function (MockServer) {"use strict";
return {
init: function () {
var oMockServer = new MockServer({rootUri: "/destinations/ES4/sap/opu/odata/IWBEP/EPM_DEVELOPER_SCENARIO_SRV/"});
var oUriParameters = jQuery.sap.getUriParameters();
MockServer.config({autoRespond: true,autoRespondAfter: oUriParameters.get("serverDelay") || 1000});
var sPath = jQuery.sap.getModulePath("raiz.localService");
oMockServer.simulate(sPath + "/metadata.xml", sPath + "/mockdata");
oMockServer.start();
}
};

});

D_Chia
Active Participant
0 Kudos

please verify these 2 lines

var sPath = jQuery.sap.getModulePath("raiz.localService");
oMockServer.simulate(sPath + "/metadata.xml", sPath + "/mockdata");

i have a working cart demo app which has code like below:-

   


     var _sMetadataPath = "demo/cart/localService/metadata",

           _sJsonFilesModulePath = "demo/cart/localService/mockdata";

     var sMetadataUrl = jQuery.sap.getModulePath(_sMetadataPath, ".xml"),

           sJsonFilesUrl = jQuery.sap.getModulePath(_sJsonFilesModulePath);

         

     oMockServer.simulate(sMetadataUrl, {

                sMockdataBaseUrl: sJsonFilesUrl,

                bGenerateMissingMockData: true

     });

my namespace was "demo.cart" so please adapt to yours accordingly.

Former Member
0 Kudos

the first code is working well... the problem dont exist more

Answers (0)