Skip to Content
0
Apr 22 at 11:06 AM

SAP Android SDK - CDS view published as OData

242 Views

Hi all,

We have defined a CDS view and published it as an OData service.

@OData.publish: true

This service is in the mobile services as destination. Now we would like to add this service to the SAP Android SDK

Based on the metadata, the SAP Android SDK generates the Java definition of the request:

public ZCDS1Type getZCDS1Type(final DataQuery query)

The generated definition returns a single item instead of a list of items as it usually generates and returns.

The request itself returns a list of items, that is correct.

Only this definition is incorrect and it generates a crash inside the app since the definition does not match the returned type.

com.sap.cloud.mobile.odata.QueryResultException: getRequiredEntity: result value (with type Z_CDS1_CDS.Z_CDS1Type*) is not an entity value. It is a list with 340 items.

Android Studio 3.6.3

SAP Android SDK 2.1.1

Does something have to be adjusted in the CDS view?

Or in the OData service?

Or how can we fix this bug?

Thank you.

Best regards,

Marco