2

Is it possible to add Edm.DateTime field based on CDS View Date Source Reference without warnings in SAP Gateway Service Builder?

I created simple CDS View based on select from dd07l with Date field just to show this case, code to create date field is taken directly from sap help example: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abencds_f1_date_time_conversions.htm

It works fine, but during project check in SAP Gateway Service Builder (segw) there is warning shown due to missing Precision field settings, but it is not possible to change it manually in segw for Data Source Reference.

I was looking for some annotation for that purpose, but I didn't find any suitable for it.

@AbapCatalog.sqlViewName: 'ZTEST2_V'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Test'
define view ZTEST2_CDS as select from dd07l as domain
{
    key domain.domname,
    key domain.domvalue_l,
    
    tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as dat
}

Service warnings

Collection properties

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
Kamil
  • 21
  • 2

1 Answers1

1

Most probably in your SEGW service definition OData V2 is specified. OData V2 only has Edm.DateTime and when converting ABAP DATS field to Edm.DateTime you will always receive this warning.

Starting from NW 750 you can also implement Odata V4 services via SEGW which has special Edm.Date type, but it significantly affects frontend implementation. So, if you have to stick with Odata V2 I would suggest just ignore this warning.

slkorolev
  • 5,883
  • 1
  • 29
  • 32