Forum

dcyborra
Participant
    6 years, 9 months ago #10089
    Up
    0
    Down
    ::

    Hi ck,

    afaik it is as easy as this:

    
    // create a new oData model with your connector and simplifier token
    var oModel = new sap.ui.model.odata.ODataModel("/client/1.0/odata/<your-connector>/?SimplifierToken=<your-token>");
    
    // read the service endpoint
    oModel.read("<your-endpoint>", null, null, true, function(oData, response) {
        // do your work here
    }.bind(this));
    

    Since you can access the simplifier global variables simply by

    
    this.getGlobals().getVar("<your-variable>")
    

    you could do something like

    
    var oModel = new sap.ui.model.odata.ODataModel("/client/1.0/odata/" + this.getGlobals().getVar("odataCon") + /?SimplifierToken=" + this.getGlobals().getVar("token"));
    oModel.read(this.getGlobals().getVar("odataEndpoint"), null, null, true, function(oData, response) {
        // set result as items of your table
        this.setItemModel("Test", "Test_Table1", "items", oData.results);
    }.bind(this));