A function that connects Date and time into timestamp in SAP CDS view

Function name: DATS_TIMS_TO_TSTMP

Calculating Timestamp in CDS View from Date and Time: – The values of the columns ZDATE and ZTIME of the database table DEMO are combined into a time stamp by the conversion function DATS_TIMS_TO_TSTMP
Example:-
@AbapCatalog.sqlViewName: 'DEMO_CDS_DATTYM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'DEMO'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
@Analytics.dataExtraction.enabled: true
Define view demo_cds_date_time
  as select from demo
{
ZDATE,
ZTIME,
DATS_TIMS_TO_TSTMP (ZDATE, ZTIME, abap_system_timezone($session.client,'NULL' ),
$session.client,'NULL') as ZTIMESTAMP
}

Guess you like

Origin blog.csdn.net/i042416/article/details/109061205