P_CntrlPurContrValidityStatus

DDL: P_CNTRLPURCONTRVALIDITYSTATUS SQL: PCPCVALSTAT Type: view COMPOSITE

P_CntrlPurContrValidityStatus is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_CntrlPurContrValidityDates) and exposes 7 fields with key field CentralPurchaseContract.

Data Sources (1)

SourceAliasJoin Type
P_CntrlPurContrValidityDates P_CntrlPurContrValidityDates from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCPCVALSTAT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY CentralPurchaseContract CentralPurchaseContract Purchasing Doc.
ActivePurchasingDocument ActivePurchasingDocument Active Purchase Doc
ValidityStartDate ValidityStartDate Validity Start Date
ValidityEndDate ValidityEndDate ValidTo
CntrlPurContrValDateDiff CntrlPurContrValDateDiff
CntrlPurContrValidity CntrlPurContrValidity
dec81endasCntrlPurContrValdtyThldValue

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_CntrlPurContrValidityStatus.
-- 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: PCPCVALSTAT

CREATE VIEW P_CntrlPurContrValidityStatus AS
SELECT
  CentralPurchaseContract,
  ActivePurchasingDocument,
  ValidityStartDate,
  ValidityEndDate,
  CntrlPurContrValDateDiff,
  CntrlPurContrValidity,
  case when CntrlPurContrValidity <> 0 then cast ( ( division (CntrlPurContrValDateDiff, dats_days_between(ValidityEndDate, ValidityStartDate), 2 ) ) as abap.dec( 8, 1 ) ) else cast ( ( division (CntrlPurContrValDateDiff, 1 , 2 ) ) as abap.dec( 8, 1 ) ) end as CntrlPurContrValdtyThldValue AS dec81endasCntrlPurContrValdtyThldValue
FROM P_CntrlPurContrValidityDates
;