cancel
Showing results for 
Search instead for 
Did you mean: 

OData V4 / CDS - $count not implemented

ThomasM2C
Explorer
0 Kudos
500
  • SAP Managed Tags:

Hello,

We have published a CDS view called z_iledelivdocitem as OData V2 and OData V4 services.

An error is raised when we try to get the number of records with the OData V4 service by calling the following url:

https://xxxx:44300/sap/opu/odata4/sap/cdi_cds/cdi_cds/sap/z_iledelivdocitem/0001/Facts/$count

The error message is :

"error": {
"code": "/IWBEP/CM_V4_RUNTIME/040",
"message": "Provider application did not return count",
"@SAP__common.ExceptionCategory": "Provider_Application_Error",
"innererror": {
"ErrorDetails": {
"@SAP__common.Application": {
"ComponentId": "BW-WHM-DBA-ODA",
"ServiceRepository": "CDI_CDS",
"ServiceId": "Z_ILEDELIVDOCITEM",
"ServiceVersion": "0001"
}
...
}

when we add the $sap-ds-debug=true parameter to the url, the exception raised is :

Exception /IWBEP/CX_V4_RUNTIME occured in Class /IWBEP/CL_V4_RESPONSE_INFO_PRO Method VALIDATE_INT and Line 182

IF ( is_todo_list_request-return-count = abap_true ) AND ( ms_done_list-return-count = abap_false ).
RAISE EXCEPTION TYPE /iwbep/cx_v4_runtime
EXPORTING
textid = /iwbep/cx_v4_runtime=>todo_list_return_count
exception_category = /iwbep/cx_gateway=>gcs_excep_categories-provider
http_status_code = /iwbep/cx_gateway=>gcs_http_status_codes-sv_not_implemented.
ENDIF.

$count works fine with the OData V2 service with this url :

https://xxxx:44300/sap/opu/odata/sap/Z_ILEDELIVDOCITEM_CDS/Z_ILEDELIVDOCITEM/$count

SAP documentation indicates that $count is supported for two versions of OData.

$count Option | SAP Help Portal

Help appreciated!

  

View Entire Topic
ThomasM2C
Explorer
0 Kudos

Hello,

OData is not created from SEGW transaction, it is created through CDS annotations which automatically creates OData.

PS4 version is S/4 HANA 2021 FPS01 and we are upgrading to S/4 HANA 2023 FPS01.

/Facts/$count=true doesn't work.

/Facts works well.

Regards

 

FabioPagoti
Active Contributor
0 Kudos

AFAIK ODava.publish annotation only supports OData V4. How did you manage to create the OData V4 service? Also, it's ?$count=true and not /$count=true

ThomasM2C
Explorer
0 Kudos
I tested ?$count=true without success.
ThomasM2C
Explorer
0 Kudos
/iwbep/v4_admin to publish the CDS view.
FabioPagoti
Active Contributor
0 Kudos
"CDS annotations which automatically creates OData." It's not automatic if you have to register in /iwbep/v4_admin and annotations are not needed in this case.