Skip to Content
0
Aug 18, 2015 at 04:08 AM

oData.read() Executoin flow with v2 oData Model

3373 Views

Hi,

I am facing an issue with v2 (sap.ui.model.odata.v2.ODataModel) of oData Model. When I execute a read funtion of oModel, the success handler method is executed after executing the statements that are written after the read() function.

But when I use sap.ui.model.odata.ODataModel of oModel, then the success handler method of read function is executed before the statements following the read method. Meaning the request is synchronous.

Below is the read method:

oModel1.read("/PaymentDetailsSet", {
filters: filterArr1,

async:false,

success: function(oData, response) {
                len=oData.results.length;

alert(len);
},
failed: function(oData, response) {
alert("Failed to get InputHelpValues from service!");

}

can anyone tell me how to acheive the same bahaviour with sap.ui.model.odata.v2.ODataModel . The behavour with V2 is always asynchronous.

Regards,

Adren

Regards,

Adren