Skip to Content
0
Former Member
Nov 23, 2013 at 11:58 AM

Retrieving entity data via OData Model

2106 Views

Hello,

Since I'm an absolute beginner in javascript and SAP UI5 I think this question can be answered easily.

I'm developing an extension for the SAP ESPM Scenario and I have a problem with consuming the OData Service:

To test whether I retrieve any Data from the ABAP backend-system, I'm trying to write data into a textarea-control.

I tried first with the read-method:

var fnSuccess = $.proxy(function() {

console.log("success");

}, this);

var fnError = $.proxy(function() {

console.log("error");

}, this);

var oValue = sap.app.odatamodel.read("/Products('HT-1000')?$select=Name", null, null, true, fnSuccess, fnError);

var oText = new sap.ui.commons.TextArea({

value : oValue,

visible : true,

width : "100%"

});

I got [objekt] objekt as a return in my textarea.

Then I tried the bind-method:

var oText = new sap.ui.commons.TextArea({

value : "",

visible : true,

width : "100%"

});

oText.bindElement("/Products('HT-1000')?$select=Name", {

select : "Name"

});

Here I get the following error:

Methode 'PRODUCTS_GET_ENTITY' in Datenanbieterklasse nicht implementiert.

I'm not sure, but does that mean that the get-entity-method is locked or something like that? Won't I ever be able to directly address one entity?

Thanks for your help!

Daniel