Skip to Content
avatar image
Former Member

[SOLVED] SAP UI5 - oData - method READ - must be absolute if no Context is set

Hi,

I have the following problem:

I have a model that exists in the project, but I want to read a specific content inside a forEach, but it displays the error message:

2018-04-23 11:26:01.927100 EventProvider sap.ui.model.odata.v2.ODataModel path Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao must be absolute if no Context is set -

follow the code

var oModelAdmin = this.getOwnerComponent().getModel("admin");
oModelAdmin.read("Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {
    method: "GET",
    success: function(data) {
        var oData = data.results;
        console.log(oData);
        oData.forEach(function(element, index){
        });
    },
    error: function(error) {
        MessageToast.show(error);
    }
});


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 23 at 02:39 PM

    RESOLVED

    missing bar "/" at start of request

    OLD
    oModelAdmin.read("Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {
    NEW
    oModelAdmin.read("/Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {
    

    Add comment
    10|10000 characters needed characters exceeded