Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8545

Retrieving entity data via OData Model

$
0
0

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


Viewing all articles
Browse latest Browse all 8545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>