SAP Knowledge Base Article - Public

3012593 - Fields Switch From Date Format to DateTime Format in OData

Symptom

After a field is created and added to OData Services, the data type is automatically changing from Date to Date and Time (DateTime).

This happens to KUT as well as PDI fields.

Environment

SAP Business ByDesign

Cause

When adding a field of Date type to OData service, the Edm type in $metadata is determined as DateTime.

Resolution

There is no Edm.Date Datatype in OData V2, so all such properties which are of data type gets added as Edm.DateTime with the Time part as 000000.

Additionally,  there is an annotation in the metadata which tells that the property(although having Edm type as DateTime) will only have the Date part of the data.

 

That annotation is sap:display-format="Date".

 

<Property Name="ZLastChangedOn_BW_KUT" Type="Edm.DateTime" Nullable="true" Precision="0" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:extension-field="true" sap:display-format="Date"/>
<Property Name="ZCreatedOn_BW_KUT" Type="Edm.DateTime" Nullable="true" Precision="0" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:extension-field="true" sap:display-format="Date"/>

Keywords

change, changing, convert, converted, switching, edm, customer, custom, extension , KBA , AP-RC-ODF , OData framework (C4C Only) , Problem

Product

SAP Business ByDesign all versions