cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 writes error to console when no oData entity for key

former_member182374
Active Contributor
0 Kudos

Hello Experts,

I'm not sure if this is SAPUI5 or SAP Gateway question.

I'm using the following code for getting data using gateway:


setDefaultPurchGrp: function(oEvent) {

    var sRoot = "<server>:<port>";

      

    var oModelUserParams = new sap.ui.model.odata.v2.ODataModel(sRoot + "/sap/opu/odata/sap/ZOMRI_REQ_SRV");

    oModelUserParams.setDefaultCountMode(sap.ui.model.odata.CountMode.None);

      

    oModelUserParams.attachRequestCompleted(function(o) {

        console.log("statusCode-->"+o.getParameter("response").statusCode);

        });

      

    oModelUserParams.read("/UserParametersSet('EKG')");

}

The service gets EKG value from user parameters.

The service works correctly as long as the user has EKG maintained but if user doesn't have the parameter an error is written to browser's console:


2015-10-27 12:02:24 Service returned messages for entities that were not requested. This might lead to wrong message processing and loss of messages -   sap-ui-core.js:80

2015-10-27 12:02:24 The following problem occurred: HTTP request failed404,Not Found,{"error":{"code":"/IWBEP/CM_MGW_RT/020","message":{"lang":"en","value":"Resource not found for segment 'UserParameters'."},"innererror":{"transactionid":"CD917CE597CEF1FBA79700237DD279C8","timestamp":"","Error_Resolution":{"SAP_Transaction":"","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[{"code":"/IWBEP/CX_MGW_BUSI_EXCEPTION","message":"Resource not found for segment 'UserParameters'","propertyref":"","severity":"error","target":""}]}}} -   sap-ui-core.js:80

statusCode-->404

and only then the 'attachRequestCompleted' is being called.

Is it normal behavior? I would expect that nothing will be written to the console log and the handling for "no entity for key" should be in the attachRequestCompleted' function.

Regards,

Omri

Accepted Solutions (0)

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos