P_DatesCalcdFrmToday

DDL: P_DATESCALCDFRMTODAY SQL: PDATCALCDFRMTDY Type: view CONSUMPTION

Dates based on today’s date

P_DatesCalcdFrmToday is a Consumption CDS View that provides data about "Dates based on today’s date" in SAP S/4HANA. It reads from 1 data source (I_ProjectCostLineItemsOvw) and exposes 16 fields with key fields Project, CompanyCode, ProfitCenter. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_ProjectCostLineItemsOvw _ProjectCostLineItemsOvw from

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_CalendarDate _CalendarDate $projection.CurrentDate = _CalendarDate.CalendarDate

Annotations (11)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
AbapCatalog.sqlViewName PDATCALCDFRMTDY view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
AbapCatalog.preserveKey true view
EndUserText.label Dates based on today’s date view

Fields (16)

KeyFieldSource TableSource FieldDescription
KEY Project I_ProjectCostLineItemsOvw Project WBS Element
KEY CompanyCode I_ProjectCostLineItemsOvw CompanyCode Receiver Company Code
KEY ProfitCenter I_ProjectCostLineItemsOvw ProfitCenter Profit Center
ProjectInternalID I_ProjectCostLineItemsOvw ProjectInternalID Project Def.
ControllingArea I_ProjectCostLineItemsOvw ControllingArea Controlling Area
CurrentDate CurrentDate
ProjectUUID ProjectUUID Project UUID
BusinessPartnerFullName BusinessPartnerFullName Broker Name
ProjectType ProjectType Project Type
BusinessPartnerUUID BusinessPartnerUUID UUID
ProjectDescription I_ProjectCostLineItemsOvw ProjectDescription Project Name
ProjectsMaxCreationDate
LastDateOfFirstInterval
LastDateOfSecondInterval
FirstDateOfFirstInterval
FirstDateOfSecondInterval

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 P_DatesCalcdFrmToday.
-- 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.
-- SQL view name: PDATCALCDFRMTDY

CREATE VIEW P_DatesCalcdFrmToday AS
SELECT
  _ProjectCostLineItemsOvw.Project AS Project,
  _ProjectCostLineItemsOvw.CompanyCode AS CompanyCode,
  _ProjectCostLineItemsOvw.ProfitCenter AS ProfitCenter,
  _ProjectCostLineItemsOvw.ProjectInternalID AS ProjectInternalID,
  _ProjectCostLineItemsOvw.ControllingArea AS ControllingArea,
  CurrentDate,
  ProjectUUID,
  BusinessPartnerFullName,
  ProjectType,
  BusinessPartnerUUID,
  _ProjectCostLineItemsOvw.ProjectDescription AS ProjectDescription,
  max(ProjectsMaxCreationDate) AS ProjectsMaxCreationDate,
  dats_add_days(dats_add_months(_CalendarDate.FirstDayOfMonthDate,-1,'FAIL'),-1,'FAIL') AS LastDateOfFirstInterval,
  dats_add_days(dats_add_months(_CalendarDate.FirstDayOfMonthDate,-5,'FAIL'),-1,'FAIL') AS LastDateOfSecondInterval,
  dats_add_months(_CalendarDate.FirstDayOfMonthDate,-3,'FAIL') AS FirstDateOfFirstInterval,
  dats_add_months(_CalendarDate.FirstDayOfMonthDate,-7,'FAIL') AS FirstDateOfSecondInterval
FROM I_ProjectCostLineItemsOvw AS _ProjectCostLineItemsOvw
LEFT OUTER JOIN I_CalendarDate AS _CalendarDate ON CurrentDate = _CalendarDate.CalendarDate  -- association [1..1]
;