DEMO_CDS_DATE_FUNC_VE

DDL: DEMO_CDS_DATE_FUNC_VE Type: view_entity Package: SABAP_DEMOS_ABAP_CDS_CLOUD

CDS view entity, date functions

DEMO_CDS_DATE_FUNC_VE is a CDS View that provides data about "CDS view entity, date functions" in SAP S/4HANA. It reads from 1 data source (demo_expressions) and exposes 13 fields with key field id. Part of development package SABAP_DEMOS_ABAP_CDS_CLOUD.

Data Sources (1)

SourceAliasJoin Type
demo_expressions demo_expressions from

Parameters (2)

NameTypeDefault
p_days abap.int4
p_months abap.int4

Annotations (1)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY id id WorklistID
date1 dats1
valid1
date2 dats2
valid2
diff
day1
day2
date3 datn1
date4 datn2
daysBetw
add_days
system_dateFAILFAIL1asadd_month

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view DEMO_CDS_DATE_FUNC_VE.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- Parameters: p_days : abap.int4, p_months : abap.int4

CREATE VIEW DEMO_CDS_DATE_FUNC_VE AS
SELECT
  id,
  dats1 AS date1,
  dats_is_valid(dats1) AS valid1,
  dats2 AS date2,
  dats_is_valid(dats2) AS valid2,
  dats_days_between($session.user_date, 20200101) AS diff,
  dats_add_days(20200301,$parameters.p_days,'INITIAL') AS day1,
  dats_add_months(dats2,$parameters.p_months,'FAIL') AS day2,
  datn1 AS date3,
  datn2 AS date4,
  datn_days_between( datn1, datn2 ) AS daysBetw,
  datn_add_days( datn1,3+6 ) AS add_days,
  datn_add_months( dats_to_datn ($session.system_date, 'FAIL', 'FAIL') ,1 ) as add_month AS system_dateFAILFAIL1asadd_month
FROM demo_expressions
;