cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to Initiate metadata in SAP UI5 Application but it good in SAP transactions.

former_member623353
Discoverer
0 Kudos

Dear Friends,

I have developed an oData services and it working fine with SAP transaction(segw).However, while consuming the same in SAPUI5, I am getting the below error. Please let me know what could be the reason.

Code in UI is below:

var oTable = new sap.ui.table.Table({
title: "Sales View",
visibleRowCount: 10,
selectionMode: sap.ui.table.SelectionMode.Multiple
});


oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Sales Document"}),
template: new sap.ui.commons.TextField().bindProperty("value","SO_ID"),
width: "200px",
sorted: true
}));

oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Created by"}),
template: new sap.ui.commons.TextField().bindProperty("value","CREATED_BY")
}));

//create the relation
var oModel = new sap.ui.model.odata.ODataModel("https://xxxxx:8031/sap/opu/odata/SAP/ZOEMSO1_SRV/");
// true,
// "",
// "");
// oModel.setCountSupported(false);

oTable.setModel(oModel);
oTable.bindRows("/ZOEMSO1Set");
oTable.placeAt("content");

Appreciate your help on the same.

Accepted Solutions (0)

Answers (3)

Answers (3)

junwu
Active Contributor

you should use relative url, like /sap/opu/odata/SAP/ZOEMSO1_SRV/

run through destination in web ide, or deploy to abap server to run.

former_member623353
Discoverer
0 Kudos

Thanks Jun and Vincent for the responses. Issue is resolved by fixing few things at Sevice implementations.

VincentBloem
Participant
0 Kudos

try something like this:

var oDataHelp = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZXX_GW_HELP_SRV/", true);