P_QuantityContract

DDL: P_QUANTITYCONTRACT SQL: PQTYCONTRACT Type: view CONSUMPTION

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

Data Sources (4)

SourceAliasJoin Type
I_PurContractClassification ContractClassification inner
I_PurchaseContract PurchaseContract inner
I_PurchaseContractItem PurchaseContractItem from
I_CalendarDate RelevantDates inner

Annotations (10)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
AbapCatalog.sqlViewName PQTYCONTRACT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #CONSUMPTION view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view

Fields (16)

KeyFieldSource TableSource FieldDescription
PurchaseContract I_PurchaseContract ActivePurchasingDocument Active Purchase Doc
PurchaseContractType I_PurchaseContract PurchaseContractType Order Type
PurchasingOrganization I_PurchaseContract PurchasingOrganization Purchasing Organization
PurchasingGroup I_PurchaseContract PurchasingGroup Purchasing Group
Plant Plant Valuation Area
PurchaseContractItem I_PurchaseContractItem PurchaseContractItem Item
CalendarYear CalendarYear Year
CalendarQuarter CalendarQuarter Calendar Quarter
CalendarMonth CalendarMonth Calendar Month
CalendarWeek CalendarWeek Calendar Week
OrderQuantityUnit OrderQuantityUnit Sales Unit
ValidityStartDate I_PurchaseContract ValidityStartDate Validity Start Date
ValidityEndDate I_PurchaseContract ValidityEndDate ValidTo
TargetQuantity TargetQuantity Target Quantity
TargetAmount TargetAmount Target Value
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_QuantityContract.
-- 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: PQTYCONTRACT

CREATE VIEW P_QuantityContract AS
SELECT
  PurchaseContract.ActivePurchasingDocument AS PurchaseContract,
  PurchaseContract.PurchaseContractType AS PurchaseContractType,
  PurchaseContract.PurchasingOrganization AS PurchasingOrganization,
  PurchaseContract.PurchasingGroup AS PurchasingGroup,
  Plant,
  PurchaseContractItem.PurchaseContractItem AS PurchaseContractItem,
  CalendarYear,
  CalendarQuarter,
  CalendarMonth,
  CalendarWeek,
  OrderQuantityUnit,
  PurchaseContract.ValidityStartDate AS ValidityStartDate,
  PurchaseContract.ValidityEndDate AS ValidityEndDate,
  TargetQuantity,
  TargetAmount,
  dats_days_between(ValidityStartDate, ValidityEndDate) AS CONT_LEN
FROM I_PurchaseContractItem AS PurchaseContractItem
INNER JOIN I_PurchaseContract AS PurchaseContract ON /* join condition not captured in parsed metadata */
INNER JOIN I_CalendarDate AS RelevantDates ON /* join condition not captured in parsed metadata */
INNER JOIN I_PurContractClassification AS ContractClassification ON /* join condition not captured in parsed metadata */
;