SAP CDS view里将Date和time连接成timestamp的函数

时间:2022-07-26
本文章向大家介绍SAP CDS view里将Date和time连接成timestamp的函数,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

函数名: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
}