P_ContractDaysToExpiry

DDL: P_CONTRACTDAYSTOEXPIRY SQL: PMMCTRDAYSEXP Type: view COMPOSITE Package: ODATA_MM_ANALYTICS

Contract Days to Expiry

P_ContractDaysToExpiry is a Composite CDS View that provides data about "Contract Days to Expiry" in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, I_PurchaseContractWD) and exposes 6 fields with key field PurchaseContract. Part of development package ODATA_MM_ANALYTICS.

Data Sources (2)

SourceAliasJoin Type
I_CalendarDate CalendarDate left_outer
I_PurchaseContractWD PurchaseContract from

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PMMCTRDAYSEXP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY PurchaseContract PurchaseContract Purchasing Doc.
PurchaseContractType PurchaseContractType Order Type
PurchasingOrganization PurchasingOrganization Purchasing Organization
PurchasingGroup PurchasingGroup Purchasing Group
ValidityEndDate ValidityEndDate ValidTo
DaysBetween

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_ContractDaysToExpiry.
-- 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: PMMCTRDAYSEXP

CREATE VIEW P_ContractDaysToExpiry AS
SELECT
  PurchaseContract,
  PurchaseContractType,
  PurchasingOrganization,
  PurchasingGroup,
  ValidityEndDate,
  dats_days_between( CalendarDate.CalendarDate, PurchaseContract.ValidityEndDate ) AS DaysBetween
FROM I_PurchaseContractWD AS PurchaseContract
LEFT OUTER JOIN I_CalendarDate AS CalendarDate ON /* join condition not captured in parsed metadata */
;