P_PurContrMassUpdt

DDL: P_PURCONTRMASSUPDT SQL: PPURCTRHDR Type: view CONSUMPTION

Purchase Contract Hdr

P_PurContrMassUpdt is a Consumption CDS View that provides data about "Purchase Contract Hdr" in SAP S/4HANA. It reads from 1 data source (R_PurchasingDocument) and exposes 46 fields with key field PurchaseContract. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
R_PurchasingDocument R_PurchasingDocument from

Parameters (1)

NameTypeDefault
P_Date sydatum

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_PurchaseContract _PurchaseContract _PurchaseContract.PurchaseContract = $projection.PurchaseContract

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PPURCTRHDR view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view
EndUserText.label Purchase Contract Hdr view

Fields (46)

KeyFieldSource TableSource FieldDescription
KEY PurchaseContract Purchasing Document
PurchasingContractCategory PurchasingDocumentCategory Doc. Category
PurchaseContractType PurchasingDocumentType RFQ Type
ExchangeRate ExchangeRate Exchange rate
ExchangeRateIsFixed ExchangeRateIsFixed Fixed Exch.Rate
CreationDate CreationDate Time Stamp
Supplier Supplier Supplier
DocumentCurrency DocumentCurrency Document Currency
PaymentTerms PaymentTerms Pyt Terms
PurchaseContractTargetAmount TargetAmount Target Value
ValidityStartDate Validity Start Date
ValidityEndDate ValidTo
NoOfDaysFromValidityStart
NoOfDaysBtwnValidityStrtAndEnd
IsEndOfPurposeBlocked IsEndOfPurposeBlocked Busin. Purp. Cmpltd.
PurchasingDocumentDeletionCode PurchasingDocumentDeletionCode Del. Indicator
CompanyCode CompanyCode Receiver Company Code
PurchasingOrganization PurchasingOrganization Purchasing Organization
PurchasingGroup PurchasingGroup Purchasing Group
IncotermsClassification IncotermsClassification Incoterms
CorrespncExternalReference CorrespncExternalReference Your Reference
CorrespncInternalReference CorrespncInternalReference Our Reference
SupplierRespSalesPersonName SupplierRespSalesPersonName Salesperson
SupplierPhoneNumber SupplierPhoneNumber Telephone
PurchasingDocumentName PurchasingDocumentName Purch. Doc. Name
IncotermsVersion IncotermsVersion Inco. Version
IncotermsLocation1 IncotermsLocation1 Inco. Location1
IncotermsLocation2 IncotermsLocation2 Inco. Location2
CreatedByUser CreatedByUser User Name
CashDiscount1Percent CashDiscount1Percent Disc. Percent 1
CashDiscount1Days CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Percent CashDiscount2Percent Disc. Percent 2
CashDiscount2Days CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays NetPaymentDays Net Pmt Terms Period
SupplierQuotation SupplierQuotationExternalID Quotation
QuotationSubmissionDate QuotationSubmissionDate Quotation Date
InvoicingParty InvoicingParty Supplier
SupplyingSupplier SupplyingSupplier Goods Supplier
_Supplier _Supplier
_CompanyCode _CompanyCode
_PurchasingOrganization _PurchasingOrganization
_PurchasingGroup _PurchasingGroup
_IncotermsClassification _IncotermsClassification
_IncotermsVersion _IncotermsVersion
_PaymentTerms _PaymentTerms
_PurchasingDocumentType _PurchasingDocumentType

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_PurContrMassUpdt.
-- 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: PPURCTRHDR
-- Parameters: P_Date : sydatum

CREATE VIEW P_PurContrMassUpdt AS
SELECT
  cast (PurchasingDocument as vdm_purchasecontract preserving type) AS PurchaseContract,
  PurchasingDocumentCategory AS PurchasingContractCategory,
  PurchasingDocumentType AS PurchaseContractType,
  ExchangeRate,
  ExchangeRateIsFixed,
  CreationDate,
  Supplier,
  DocumentCurrency,
  PaymentTerms,
  TargetAmount AS PurchaseContractTargetAmount,
  cast (ValidityStartDate as vdm_validitystart) AS ValidityStartDate,
  cast (ValidityEndDate as vdm_validityend) AS ValidityEndDate,
  dats_days_between( ValidityStartDate , $parameters.P_Date ) * 10 AS NoOfDaysFromValidityStart,
  dats_days_between( ValidityStartDate , ValidityEndDate ) * 9 AS NoOfDaysBtwnValidityStrtAndEnd,
  IsEndOfPurposeBlocked,
  PurchasingDocumentDeletionCode,
  CompanyCode,
  PurchasingOrganization,
  PurchasingGroup,
  IncotermsClassification,
  CorrespncExternalReference,
  CorrespncInternalReference,
  SupplierRespSalesPersonName,
  SupplierPhoneNumber,
  PurchasingDocumentName,
  IncotermsVersion,
  IncotermsLocation1,
  IncotermsLocation2,
  CreatedByUser,
  CashDiscount1Percent,
  CashDiscount1Days,
  CashDiscount2Percent,
  CashDiscount2Days,
  NetPaymentDays,
  SupplierQuotationExternalID AS SupplierQuotation,
  QuotationSubmissionDate,
  InvoicingParty,
  SupplyingSupplier
FROM R_PurchasingDocument
LEFT OUTER JOIN I_PurchaseContract AS _PurchaseContract ON _PurchaseContract.PurchaseContract = PurchaseContract  -- association [1..1]
;