Skip to Content

Count Element in SAP Cloud Platform SDK for Service Development

Hello,

I have been following these tutorials for Cloud Service Development(link), but I been struggling with this one issue, and really hope someone can help me out.

Issue: Service response does not contain a Count element?

…/odata/v2/EPMSampleService/Products?$select=Category,Price&$inlinecount=allpages

Result:

My Code for Service Class:

//Getting Data
ODataQueryResult result = ODataQueryBuilder
  .withEntity("/sap/opu/odata/IWBEP/GWSAMPLE_BASIC", "ProductSet")
  .select("ProductID", "Name", "Description", "Category", "Price")
  .inlineCount()
  .build()
  .execute(DESTINATION_NAME);

count = result.getInlineCount();
result.setInlineCount(count);

//Returning Data
final List<ProductEntity> v2ProductList = result.asList(ProductEntity.class);
queryResponse = QueryResponse.setSuccess().setData(v2ProductList).response();
return queryResponse;

Any help or hints would me much appreciated.
Thank you,
Rob

nocount.jpg (34.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers