on ‎2017 Feb 23 5:40 AM
Hi,
When i make a read call for an odatamodel for one entity, in the chrome console, if i check that $batch operation, there are 2 additional calls which i never included as part of filters or parameters:
GET Entity1/$count HTTP/1.1
GET Entity1?$skip=0&$top=100 HTTP/1.1
Not sure why these calls are made via $batch request.
Anybody knows how to avoid these calls ?
BR,
Venky
Request clarification before answering.
Hello,
To disable 2nd request you can add
refreshAfterChange: false in settings. But of course there will be side effect based on your use case.
Regards,
Vinod Patil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Venky,
Whenever there is an aggregation binding in UI5 , the framework will automatically trigger the count call , so that controls like table ,list can provide a paging , growing functionality. This is precisely the reason why the $top and $skip keep getting appended to your request.
I would suggest you to set the defaultCountMode to Inline in either
1. Manifest.json
2. In the component or view hook method by using javascript code model.setDefaultCountMode("Inline") .
The use of "Inline" appends one more parameter to your request $inlineCount=allpages which makes only request (instead of 2 requests) but also retrieves the count and everything else works seamlessly.
Thanks and Regards,
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Veera,
Thanks for your help.
I wanted to get rid of these calls, so i tried setting defaultCountMode to 'None'--> it removes only one call GET Entity1/$count HTTP/1.1
But still there is another call which is still getting called:
GET Entity1?$skip=0&$top=100 HTTP/1.1
Any idea how do i get rid of it ?
BR,
Venky.
Update model settings in manifest.json and use the property 'defaultCountMode' as 'None', this will avoid the call for $count.
I think second request is still required. Show me your batch request and XML view binding.
Below is the code for 'manifest.json'
"sap.app": {
"dataSources": {
"invoiceRemote": {
"uri": "https://services.odata.org/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"defaultCountMode": "None" //--> this removes count mode in batch request
}
}
}
"sap.ui5": {
"models": {
"dataSource": "invoiceRemote"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My mistake. Property "defaultCountMode" should be set in "sap.ui5". Refer below:
"sap.app": {
"dataSources": {
"invoiceRemote": {
"uri": "https://services.odata.org/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
"sap.ui5": {
"myModel": {
"models": {
"type": "sap.ui.model.odata.v2.ODataModel",
"dataSource": "invoiceRemote",
"settings": {
"defaultCountMode": "None" //Place it here
}
}
}
}

Hi Srikanth,
Thanks a lot for your help.
After implementing your solution, it took away only this call :
GET Entity1/$count HTTP/1.1
But still there is one more call, which is still occuring: i have no idea which setting would remove this call :
GET Entity1?$skip=0&$top=100 HTTP/1.1
Anyways, thanks again for your help.
BR,
Venky.
second request GET C_ProcMonE2EChain?$skip=0&$top=100 HTTP/1.1 mostly refers to binding to table which have the default threshold of 100, without this request data will not be populated into the table.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.