I_PurContrVersionHistory

DDL: I_PURCONTRVERSIONHISTORY SQL: ICONTRVERSHIST Type: view BASIC

Purchase Contract Version History

I_PurContrVersionHistory is a Basic CDS View that provides data about "Purchase Contract Version History" in SAP S/4HANA. It reads from 2 data sources (R_PurchaseContract, erev) and exposes 71 fields with key field PurchaseContract. It has 9 associations to related views.

Data Sources (2)

SourceAliasJoin Type
R_PurchaseContract Document inner
erev VersionHistory from

Associations (9)

CardinalityTargetAliasCondition
[1..1] I_User _UserDetails $projection.CreatedByUser = _UserDetails.UserID
[1..1] I_PurContrVersionType _VersionType $projection.PurgDocChangeRequestStatus = _VersionType.PurgDocChangeRequestStatus
[0..1] I_PaymentTermsText _PaymentTermsText $projection.PaymentTerms = _PaymentTermsText.PaymentTerms and _PaymentTermsText.Language = $session.system_language
[0..1] I_PurchasingGroup _PurchasingGroup _PurchasingGroup.PurchasingGroup = $projection.PurchasingGroup
[1..1] I_CurrencyText _DocumentCurrencyText _DocumentCurrencyText.Language = $session.system_language and _DocumentCurrencyText.Currency = $projection.DocumentCurrency
[0..1] I_IncotermsClassificationText _IncotermsClassificationText _IncotermsClassificationText.IncotermsClassification = $projection.IncotermsClassification and _IncotermsClassificationText.IncotermsClassificationName = $session.system_language
[0..1] I_PurchasingOrganization _PurchasingOrganization _PurchasingOrganization.PurchasingOrganization = $projection.PurchasingOrganization
[0..1] I_IncotermsClassification _IncotermsClassification _IncotermsClassification.IncotermsClassification = $projection.IncotermsClassification
[0..1] I_Supplier _InvoicingParty $projection.InvoicingParty = _InvoicingParty.Supplier

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName ICONTRVERSHIST view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Purchase Contract Version History view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.viewType #BASIC view
AccessControl.personalData.blocking #REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (71)

KeyFieldSource TableSource FieldDescription
KEY PurchaseContract R_PurchaseContract PurchaseContract Purchasing Doc.
PurchaseContractType R_PurchaseContract PurchaseContractType Order Type
PurchasingDocumentCategory R_PurchaseContract PurchasingDocumentCategory Doc. Category
Supplier R_PurchaseContract Supplier Supplier
CompanyCode R_PurchaseContract CompanyCode Receiver Company Code
PurchasingOrganization R_PurchaseContract PurchasingOrganization Purchasing Organization
PurchasingGroup R_PurchaseContract PurchasingGroup Purchasing Group
DocumentCurrency R_PurchaseContract DocumentCurrency Document Currency
IncotermsClassification R_PurchaseContract IncotermsClassification Incoterms
IncotermsTransferLocation R_PurchaseContract IncotermsTransferLocation Incoterms 2
PaymentTerms R_PurchaseContract PaymentTerms Pyt Terms
CashDiscount1Days R_PurchaseContract CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days R_PurchaseContract CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays R_PurchaseContract NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent R_PurchaseContract CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent R_PurchaseContract CashDiscount2Percent Disc. Percent 2
PurchaseContractTargetAmount R_PurchaseContract PurchaseContractTargetAmount Target Value
ValidityStartDate R_PurchaseContract ValidityStartDate Validity Start Date
ValidityEndDate R_PurchaseContract ValidityEndDate ValidTo
ReleaseCode R_PurchaseContract ReleaseCode Release ind.
PurchasingDocumentDeletionCode R_PurchaseContract PurchasingDocumentDeletionCode Del. Indicator
SupplyingSupplier R_PurchaseContract SupplyingSupplier Goods Supplier
InvoicingParty R_PurchaseContract InvoicingParty Supplier
ExchangeRate
ExchangeRateIsFixed R_PurchaseContract ExchangeRateIsFixed Fixed Exch.Rate
QuotationSubmissionDate R_PurchaseContract QuotationSubmissionDate Quotation Date
SupplierQuotation R_PurchaseContract SupplierQuotation RFQ
ReleaseIsNotCompleted R_PurchaseContract ReleaseIsNotCompleted Subj.to Release
CorrespncExternalReference R_PurchaseContract CorrespncExternalReference Your Reference
CorrespncInternalReference R_PurchaseContract CorrespncInternalReference Our Reference
SupplierRespSalesPersonName R_PurchaseContract SupplierRespSalesPersonName Salesperson
SupplierPhoneNumber R_PurchaseContract SupplierPhoneNumber Telephone
IncotermsVersion R_PurchaseContract IncotermsVersion Inco. Version
IncotermsLocation1 R_PurchaseContract IncotermsLocation1 Inco. Location1
IncotermsLocation2 R_PurchaseContract IncotermsLocation2 Inco. Location2
PurchasingDocumentName R_PurchaseContract PurchasingDocumentName Purch. Doc. Name
LastChangeDateTime R_PurchaseContract LastChangeDateTime Timestamp
PurchasingProcessingStatus R_PurchaseContract PurchasingProcessingStatus Proc. State
IsEndOfPurposeBlocked R_PurchaseContract IsEndOfPurposeBlocked Busin. Purp. Cmpltd.
ActivePurchasingDocument R_PurchaseContract ActivePurchasingDocument Active Purchase Doc
PurgDocChangeRequestStatus R_PurchaseContract PurgDocChangeRequestStatus Change Request Stat.
PurchasingDocumentVersion R_PurchaseContract PurchasingDocumentVersion Version
PurgDocIsChgVers R_PurchaseContract PurgDocIsChgVers Checkbox
PurgAggrgdProdCmplncSuplrSts R_PurchaseContract PurgAggrgdProdCmplncSuplrSts Supplier Check Sts
CreatedByUser erev ernam User Name
CreationDate erev erdat Entered On
CreationTime erev eruhr Time
PurchasingDocVersionReasonCode erev rscod Reason Code
PurchasingDocVersionStatus erev strev Version status
AccWorkflowApprover
AccWorkflowApproverFirstName
ApprovalStatusName
ApproverUser
PurgContractIsInPreparation
PurchasingDocumentStatus
IncotermsSupChnLoc1AddlUUID IncotermsSupChnLoc1AddlUUID Location UUID
IncotermsSupChnLoc2AddlUUID IncotermsSupChnLoc2AddlUUID Location UUID
IncotermsSupChnDvtgLocAddlUUID IncotermsSupChnDvtgLocAddlUUID Location UUID
PurchasingDocumentOrigin PurchasingDocumentOrigin Status
CreatedByUserName _CreatedByUser UserDescription Full Name
PurgHasCatalogRelevantItems PurgHasCatalogRelevantItems Ctlg Item Rlvt Doc
_PaymentTermsText _PaymentTermsText
_UserDetails _UserDetails
_VersionType _VersionType
_PurchasingGroup _PurchasingGroup
_DocumentCurrency R_PurchaseContract _DocumentCurrency
_DocumentCurrencyText _DocumentCurrencyText
_IncotermsClassificationText _IncotermsClassificationText
_IncotermsClassification _IncotermsClassification
_PurchasingOrganization _PurchasingOrganization
_InvoicingParty _InvoicingParty

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 I_PurContrVersionHistory.
-- 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: ICONTRVERSHIST

CREATE VIEW I_PurContrVersionHistory AS
SELECT
  Document.PurchaseContract AS PurchaseContract,
  Document.PurchaseContractType AS PurchaseContractType,
  Document.PurchasingDocumentCategory AS PurchasingDocumentCategory,
  Document.Supplier AS Supplier,
  Document.CompanyCode AS CompanyCode,
  Document.PurchasingOrganization AS PurchasingOrganization,
  Document.PurchasingGroup AS PurchasingGroup,
  Document.DocumentCurrency AS DocumentCurrency,
  Document.IncotermsClassification AS IncotermsClassification,
  Document.IncotermsTransferLocation AS IncotermsTransferLocation,
  Document.PaymentTerms AS PaymentTerms,
  Document.CashDiscount1Days AS CashDiscount1Days,
  Document.CashDiscount2Days AS CashDiscount2Days,
  Document.NetPaymentDays AS NetPaymentDays,
  Document.CashDiscount1Percent AS CashDiscount1Percent,
  Document.CashDiscount2Percent AS CashDiscount2Percent,
  Document.PurchaseContractTargetAmount AS PurchaseContractTargetAmount,
  Document.ValidityStartDate AS ValidityStartDate,
  Document.ValidityEndDate AS ValidityEndDate,
  Document.ReleaseCode AS ReleaseCode,
  Document.PurchasingDocumentDeletionCode AS PurchasingDocumentDeletionCode,
  Document.SupplyingSupplier AS SupplyingSupplier,
  Document.InvoicingParty AS InvoicingParty,
  cast( Document.ExchangeRate as fis_exchange_rate preserving type ) AS ExchangeRate,
  Document.ExchangeRateIsFixed AS ExchangeRateIsFixed,
  Document.QuotationSubmissionDate AS QuotationSubmissionDate,
  Document.SupplierQuotation AS SupplierQuotation,
  Document.ReleaseIsNotCompleted AS ReleaseIsNotCompleted,
  Document.CorrespncExternalReference AS CorrespncExternalReference,
  Document.CorrespncInternalReference AS CorrespncInternalReference,
  Document.SupplierRespSalesPersonName AS SupplierRespSalesPersonName,
  Document.SupplierPhoneNumber AS SupplierPhoneNumber,
  Document.IncotermsVersion AS IncotermsVersion,
  Document.IncotermsLocation1 AS IncotermsLocation1,
  Document.IncotermsLocation2 AS IncotermsLocation2,
  Document.PurchasingDocumentName AS PurchasingDocumentName,
  Document.LastChangeDateTime AS LastChangeDateTime,
  Document.PurchasingProcessingStatus AS PurchasingProcessingStatus,
  Document.IsEndOfPurposeBlocked AS IsEndOfPurposeBlocked,
  Document.ActivePurchasingDocument AS ActivePurchasingDocument,
  Document.PurgDocChangeRequestStatus AS PurgDocChangeRequestStatus,
  Document.PurchasingDocumentVersion AS PurchasingDocumentVersion,
  Document.PurgDocIsChgVers AS PurgDocIsChgVers,
  Document.PurgAggrgdProdCmplncSuplrSts AS PurgAggrgdProdCmplncSuplrSts,
  VersionHistory.ernam AS CreatedByUser,
  VersionHistory.erdat AS CreationDate,
  VersionHistory.eruhr AS CreationTime,
  VersionHistory.rscod AS PurchasingDocVersionReasonCode,
  VersionHistory.strev AS PurchasingDocVersionStatus,
  cast ('' as mm_oa_approver_id) AS AccWorkflowApprover,
  cast ('' as mm_oa_approver_name) AS AccWorkflowApproverFirstName,
  cast( '' as val_text ) AS ApprovalStatusName,
  cast( '' as sww_aagent ) AS ApproverUser,
  cast('' as boolean ) AS PurgContractIsInPreparation,
  cast('' as mmpur_doc_status) AS PurchasingDocumentStatus,
  IncotermsSupChnLoc1AddlUUID,
  IncotermsSupChnLoc2AddlUUID,
  IncotermsSupChnDvtgLocAddlUUID,
  PurchasingDocumentOrigin,
  _CreatedByUser.UserDescription AS CreatedByUserName,
  PurgHasCatalogRelevantItems,
  Document._DocumentCurrency AS _DocumentCurrency
FROM erev AS VersionHistory
INNER JOIN R_PurchaseContract AS Document ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_User AS _UserDetails ON CreatedByUser = _UserDetails.UserID  -- association [1..1]
LEFT OUTER JOIN I_PurContrVersionType AS _VersionType ON PurgDocChangeRequestStatus = _VersionType.PurgDocChangeRequestStatus  -- association [1..1]
LEFT OUTER JOIN I_PaymentTermsText AS _PaymentTermsText ON PaymentTerms = _PaymentTermsText.PaymentTerms AND _PaymentTermsText.Language = $session.system_language  -- association [0..1]
LEFT OUTER JOIN I_PurchasingGroup AS _PurchasingGroup ON _PurchasingGroup.PurchasingGroup = PurchasingGroup  -- association [0..1]
LEFT OUTER JOIN I_CurrencyText AS _DocumentCurrencyText ON _DocumentCurrencyText.Language = $session.system_language AND _DocumentCurrencyText.Currency = DocumentCurrency  -- association [1..1]
LEFT OUTER JOIN I_IncotermsClassificationText AS _IncotermsClassificationText ON _IncotermsClassificationText.IncotermsClassification = IncotermsClassification AND _IncotermsClassificationText.IncotermsClassificationName = $session.system_language  -- association [0..1]
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON _PurchasingOrganization.PurchasingOrganization = PurchasingOrganization  -- association [0..1]
LEFT OUTER JOIN I_IncotermsClassification AS _IncotermsClassification ON _IncotermsClassification.IncotermsClassification = IncotermsClassification  -- association [0..1]
LEFT OUTER JOIN I_Supplier AS _InvoicingParty ON InvoicingParty = _InvoicingParty.Supplier  -- association [0..1]
;