on 06-19-2023 7:14 AM
Hello all,
I am developing a CAP supported Fiori Elements application with OData V4. Currently I am struggling with getting the onpremise OData Service data into a valuehelp in frontend. The issue is whenever the batch call is triggered it adds a "$count" parameter into the call URI which is not supported by the backend (error can be seen in /IWNFD/ERROR_LOG).
Since Fiori Elements template is used, this call takes place automatically over a CAP Service that wraps the backend OData Service call. It has a very basic service js as can be seen below. Even converting the frontend model into OData V2 didn't help since "inlinecount" param was also not supported in backend.
const cds = require("@sap/cds");
module.exports = async function () {
const inspectionLotService = await cds.connect.to("INSPECTION_LOT_SRV");
this.on("READ", "Plant_VHSet", async function (request)
{
return await inspectionLotService.tx(request).run(request.query);
});
};
Batch URI in OData V4 Call:
GET Plant_VHSet $select=City1,Name1,Name2,Nation,PostCode1,Werks&$count=true&$orderby=Werks&$skip=0&$top=58<br>
Batch URI in OData V2 Call:
GET Plant_VHSet?$inlinecount=allpages&$orderby=Werks&$select=City1,Name1,Name2,Nation,PostCode1,Werks&$skip=0&$top=58
Both URI calls ends with error in backend. A workaround would be deleting the count parameter from the query before sending it to backend. But I would like to find a more official solution, removing the count off of from the query via a configuration etc.
I appreciate for any comment and help,
Thanks in advance,
Best,
Merve
Hello Merve,
$count support is one of the prerequisites for using SAP Fiori elements. Please checkout the following page:
https://ui5.sap.com/#/topic/f2344b5e78164b2b9c27ef8b068f295c
The reason is that our UI5 tables need the $count for proper rendering / enabling scrolling etc.
Therefore we don't provide any configuration to disable the $count.
I recommend to enable $count support in the backend (our SAP backend frameworks RAP and CAP support it out of the box).
Best regards,
Marcel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.