Skip to Content
0
May 20, 2016 at 08:53 AM

get error CORS header 'Access-Control-Allow-Origin' missing SAPUI5 ?

1838 Views

hi, i am new in SAPUI5. for this case i want to show data from Odata net waver in the eclipse application for SAPUI5, but i got a problem when i trying to run program.

this is sctructure tree from eclipse

and this is code from controller:

onInit: function() {

var oModel = new sap.ui.model.odata.ODataModel

("http://[hostname]:8000/sap/opu/odata/SAP/ZEMP_SRV/EmployeeSet", true, "basisadm", "passw0rd" );

oModel.attachRequestSent(function() {

console.log("Request sent");

//etc

});

oModel.attachRequestCompleted(function() {

console.log("Request completed");

//etc

});

oModel.attachRequestFailed(function() {

console.log("Request failed");

//etc

});

sap.ui.getCore().setModel(oModel);

},

i get this error from mozilla firefox when program running.

how i solve this and whats i missing?

Thanks. 😊

Attachments

1.PNG (34.1 kB)
2.PNG (141.1 kB)