P_QuantityContractWithHistory

DDL: P_QUANTITYCONTRACTWITHHISTORY SQL: PQTYCONTRHISTPAI Type: view CONSUMPTION

P_QuantityContractWithHistory is a Consumption CDS View in SAP S/4HANA. It reads from 4 data sources (I_PurContractClassification, I_PurchaseContractHistory, I_PurchaseContract, I_PurchaseContractItem) and exposes 10 fields.

Data Sources (4)

SourceAliasJoin Type
I_PurContractClassification ContractClassification inner
I_PurchaseContractHistory History from
I_PurchaseContract PurchaseContract inner
I_PurchaseContractItem PurchaseContractItem inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PQTYCONTRHISTPAI view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.personalData.blocking #NOT_REQUIRED view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (10)

KeyFieldSource TableSource FieldDescription
PurchaseContract I_PurchaseContractHistory PurchaseContract Purchasing Doc.
PurchaseContractItem I_PurchaseContractHistory PurchaseContractItem Item
PurchaseContractType I_PurchaseContract PurchaseContractType Order Type
ReleaseOrder ReleaseOrder Purchasing Doc.
ValidityStartDate ValidityStartDate Validity Start Date
ValidityEndDate ValidityEndDate ValidTo
TargetQuantity TargetQuantity Target Quantity
TargetAmount TargetAmount Target Value
ReleaseOrderItemOrderQuantity ReleaseOrderItemOrderQuantity PO Quantity
CONT_LEN

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_QuantityContractWithHistory.
-- 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: PQTYCONTRHISTPAI

CREATE VIEW P_QuantityContractWithHistory AS
SELECT
  History.PurchaseContract AS PurchaseContract,
  History.PurchaseContractItem AS PurchaseContractItem,
  PurchaseContract.PurchaseContractType AS PurchaseContractType,
  ReleaseOrder,
  ValidityStartDate,
  ValidityEndDate,
  TargetQuantity,
  TargetAmount,
  ReleaseOrderItemOrderQuantity,
  dats_days_between(ValidityStartDate, ValidityEndDate) AS CONT_LEN
FROM I_PurchaseContractHistory AS History
INNER JOIN I_PurchaseContractItem AS PurchaseContractItem ON /* join condition not captured in parsed metadata */
INNER JOIN I_PurchaseContract AS PurchaseContract ON /* join condition not captured in parsed metadata */
INNER JOIN I_PurContractClassification AS ContractClassification ON /* join condition not captured in parsed metadata */
;