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
}
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
{
ZTIME,
cast(
cast(cast(substring(ZTIME,1,2) as abap.numc( 2 )) as abap.dec( 15, 0 )) * 3600 +
cast(cast(substring(ZTIME,3,2) as abap.numc( 2 )) as abap.dec( 15, 0 )) * 60 +
cast(cast(substring(ZTIME,5,2) as abap.numc( 2 )) as abap.dec( 15, 0 ))
as abap.dec( 15, 0 ))as ZSECONDS
}
@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,
ZDATE1,
ZTIME1,
tstmp_seconds_between
(
dats_tims_to_tstmp
(
ZDATE,
ZTIME,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL'
),
dats_tims_to_tstmp
(
ZDATE1,
ZTIME2,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL'
),
'NULL'
)as ZDIFF_SECONDS
}
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,
dats_add_days(ZDATE, +1, 'NULL') as ZDATE_NEW
}
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
{
Date_column,
Cast(
Concat(
Concat(
Concat(substring(Date_Column, 5, 2), ‘/’),
Concat(substring(Date_Column, 7, 2), ‘/’),
),
Substring(Date_column, 1, 4)
)
As char10 preserving type) as ZCONVERTED_DATE
}
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
{
$session.system_date as systemdate
}
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
{
tstmp_current_utctimestamp()
}
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,
cast((substring(ZDATE, 7, 2)) as abap.char(2)) as ZDD
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |