获取当前系统日期:
@AbapCatalog.sqlViewName: 'ZCDS_DEMO4'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'cds练习使用'
define view ZCDS_DEMO4_SEELE as select from mara {
mara.matnr,
//方法一 dats类型
$session.system_date as systemdate1,
//方法二 char类型(没有时区,参照国际标准时间)
substring(cast(tstmp_current_utctimestamp() as abap.char(17)),1,8) as systemdate2,
//方法三 dats类型
tstmp_to_dats(
tstmp_current_utctimestamp(),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL'
) as systemdate3
}
获取当前系统时间
@AbapCatalog.sqlViewName: 'ZCDS_DEMO4'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'cds练习使用'
define view ZCDS_DEMO4_SEELE as select from mara {
mara.matnr,
//方法一 char类型(没有时区,参照国际标准时间)
substring(cast(tstmp_current_utctimestamp() as abap.char(17)),9,6) as systemtime1,
//方法二 tims类型
tstmp_to_tims( tstmp_current_utctimestamp(),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL'
) as systemtime2
}
$session会话变量还可以取系统语言,客户端等信息
参考链接:https://www.cnblogs.com/SAPmatinal/p/10221093.html#_label1