P_PurContrValdtySts

DDL: P_PURCONTRVALDTYSTS SQL: PPCONTRVALSTS Type: view CONSUMPTION

Contract Validity Status Calculation

P_PurContrValdtySts is a Consumption CDS View that provides data about "Contract Validity Status Calculation" in SAP S/4HANA. It reads from 1 data source (R_PurchasingDocument) and exposes 3 fields with key field PurchaseContract.

Data Sources (1)

SourceAliasJoin Type
R_PurchasingDocument _PurchaseContract from

Parameters (1)

NameTypeDefault
P_Date sydatum

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PPCONTRVALSTS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
VDM.private true view
VDM.viewType #CONSUMPTION view
EndUserText.label Contract Validity Status Calculation view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY PurchaseContract R_PurchasingDocument PurchasingDocument Purchasing Document
NoOfDaysFromValidityStart
NoOfDaysBtwnValidityStrtAndEnd

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_PurContrValdtySts.
-- 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: PPCONTRVALSTS
-- Parameters: P_Date : sydatum

CREATE VIEW P_PurContrValdtySts AS
SELECT
  _PurchaseContract.PurchasingDocument AS PurchaseContract,
  dats_days_between( $parameters.P_Date, ValidityStartDate) * 10 AS NoOfDaysFromValidityStart,
  dats_days_between(ValidityEndDate, ValidityStartDate) * 9 AS NoOfDaysBtwnValidityStrtAndEnd
FROM R_PurchasingDocument AS _PurchaseContract
;