Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

How to call a batch request for Read in UI5...

$
0
0

Hi,

 

 

Can I get an example as to how to call a batch request for POST in UI5 for the below:

 

 

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/xml

 

GET ztotal_EmpSet/?$filter=StartDate+eq+datetime'2016-08-24T00:00:00'+and+EndDate+eq+datetime'2016-08-28T23:00:00'+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'1'HTTP/1.1

 

 

--batch--

 

Any link would also be helpful.

 

Code:

 

 

var allfilters = [new sap.ui.model.Filter({
  path:'filter1',
  operator : sap.ui.model.FilterOperator.EQ,
  value1 : this.filter1value
  }),
  new sap.ui.model.Filter({
  path:'DateField',
  operator : sap.ui.model.FilterOperator.EQ,
  value1 : 'BASIC'
  }),
  new sap.ui.model.Filter({
  path:'StartDate',
  operator : sap.ui.model.FilterOperator.EQ,
  value1 : oDateFormat.format(this.startDate.toDate())
  }),
  new sap.ui.model.Filter({
  path:'EndDate',
  operator : sap.ui.model.FilterOperator.EQ,
  value1 : oDateFormat.format(this.endDate.toDate())
  })];

  var batchrequest = this.oModel.createBatchOperation('/ztotal_EmpSet','GET',{
  filters : allfilters
  });
  this.oModel.addBatchReadOperations([batchrequest]); 
  this.oModel.submitBatch(this._gotData.bind(this),function(err){
  console.log(err);
  });

 

I am not getting values in the it_filter_select_options in the backend while debugging.

 

Regards,

Gopa


Viewing all articles
Browse latest Browse all 2823

Trending Articles



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