cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set Nullable Property on SAP RAP based OData V4

5,098

Hello Community,

I created an OData V4 Service to read data with RAP (CDS Views) based on a SAP Standard Table BNKA.

In the metadata any string are stated as Nullable="false".

For non key fields I would expect that fields can be null.

Can this be influenced via cds?


With Odata V2 the nullable property is optional and thus not mentioned when publishing the same service.

However i did not find the default value for the field if it is not declared.

What is the default value for nullable if not provided in OData V2?

View Entire Topic
evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos

The default for the CSDL XML Nullable facet is true for both OData V2 and V4.

http://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/cs01/odata-csdl-xml-v4.01-cs01.html#_Toc505863...

As to whether that indicates a problem with the generation of either the V2 and V4 models you are working with, I can't comment as I don't know the origin of those XML files. If these are both machine-generated from the same input, then one of them is wrong since they aren't consistent.

0 Kudos

Thank you for the answer. Yes, it should be consistent.

I created the OData v2 and OData v4 based on the same Service Definition resulting in the above seen metadata.

What leads to the inconsistency?