擷取目前系統日期:
@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