Skip to Content
0
Jul 03, 2018 at 07:50 AM

SAPUI5 Any Sample of accessing OData services of ES5 , without bypassing corporate internet security

373 Views

Any Sample code of accessing OData services of ES5 from client side html page, without bypassing corporate internet security

Is it possible to share sample code of accessing OData services of ES5 system,

using a single html page,

without bypassing corporate internet security.

Tried using urls
https://cors-anywhere.herokuapp.com/sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ 

and

 https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ 

But was getting errors in connection process.

Below is a sample code for accessing Northwind DB, using script.

Is it possible to provide a sample code for accessing OData services of ES5.

<script>
var sURL1 = "http://services.odata.org/V4/Northwind/Northwind.svc/Customers";
var oModel = new sap.ui.model.json.JSONModel(sURL1, true);
sap.ui.getCore().setModel(oModel);
var oTable = new sap.m.Table("tableID", {
columns : [ new sap.m.Column ({ 
header:[ new sap.m.Label ({text: "Customer ID"})]}),
new sap.m.Column ({ header :[ new sap.m.Label ({text: "Company Name"})]})
]
});
oTable.bindItems("/value", new sap.m.ColumnListItem("listItem",{
cells:[ new sap.m.Text({text: "{CustomerID}"}),
new sap.m.Text ({text: "{CompanyName}"})
]}));
oTable.placeAt("content");
</script>