I_PURCHASECONTRACTVERSION

CDS View

Purchase Contract Version

I_PURCHASECONTRACTVERSION is a CDS View in S/4HANA. Purchase Contract Version. It contains 56 fields. 3 CDS views read from this table.

CDS Views using this table (3)

ViewTypeJoinVDMDescription
C_ContractFs view from CONSUMPTION Purchase Contract
I_PurchaseContractWD view from TRANSACTIONAL BO View for I_PurchaseContractWD
P_Contractmaintain_Trans view from COMPOSITE P View For Transient Fields in Contracts

Fields (56)

KeyField CDS FieldsUsed in Views
KEY ActivePurchasingDocument ActivePurchasingDocument,PurchaseContract 3
KEY PurchaseContract PurchaseContract,PurchaseContractForEdit 2
_DocumentCurrency _DocumentCurrency 1
_IncotermsClassification _IncotermsClassification 1
_PurchasingDocumentCategory _PurchasingDocumentCategory 1
_PurchasingDocumentType _PurchasingDocumentType 1
CashDiscount1Days CashDiscount1Days 2
CashDiscount1Percent CashDiscount1Percent 2
CashDiscount2Days CashDiscount2Days 2
CashDiscount2Percent CashDiscount2Percent 2
CompanyCode CompanyCode 2
CorrespncExternalReference CorrespncExternalReference 1
CorrespncInternalReference CorrespncInternalReference 1
CreatedByUser CreatedByUser 1
CreationDate CreationDate 2
DocumentCurrency DocumentCurrency 2
ExchangeRateIsFixed ExchangeRateIsFixed 1
IncotermsClassification IncotermsClassification 2
IncotermsLocation1 IncotermsLocation1 1
IncotermsLocation2 IncotermsLocation2 1
IncotermsSupChnDvtgLocAddlUUID IncotermsSupChnDvtgLocAddlUUID 1
IncotermsSupChnLoc1AddlUUID IncotermsSupChnLoc1AddlUUID 1
IncotermsSupChnLoc2AddlUUID IncotermsSupChnLoc2AddlUUID 1
IncotermsTransferLocation IncotermsTransferLocation 2
IncotermsVersion IncotermsVersion 1
InvoicingParty InvoicingParty 1
IsEndOfPurposeBlocked IsEndOfPurposeBlocked 1
LastChangeDateTime LastChangeDateTime 1
NetPaymentDays NetPaymentDays 2
PaymentTerms PaymentTerms 2
PurchaseContractTargetAmount PurchaseContractTargetAmount 2
PurchaseContractType PurchaseContractType 3
PurchasingDocumentCategory PurchasingDocumentCategory 2
PurchasingDocumentDeletionCode PurchasingDocumentDeletionCode 1
PurchasingDocumentName PurchasingDocumentName 1
PurchasingDocumentOrigin PurchasingDocumentOrigin 1
PurchasingDocumentVersion PurchasingDocumentVersion 1
PurchasingDocVersionReasonCode PurchasingDocVersionReasonCode 1
PurchasingGroup PurchasingGroup 2
PurchasingOrganization PurchasingOrganization 2
PurchasingProcessingStatus PurchasingProcessingStatus 2
PurgAggrgdProdCmplncSuplrSts PurgAggrgdProdCmplncSuplrSts 1
PurgDocChangeRequestStatus PurgDocChangeRequestStatus 1
PurgDocIsChgVers PurgDocIsChgVers 1
PurgHasCatalogRelevantItems PurgHasCatalogRelevantItems 1
QuotationSubmissionDate QuotationSubmissionDate 1
ReleaseCode ReleaseCode 2
ReleaseIsNotCompleted ReleaseIsNotCompleted 1
Supplier Supplier 2
SupplierAddressID SupplierAddressID 1
SupplierPhoneNumber SupplierPhoneNumber 1
SupplierQuotation SupplierQuotation 1
SupplierRespSalesPersonName SupplierRespSalesPersonName 1
SupplyingSupplier SupplyingSupplier 1
ValidityEndDate ValidityEndDate 2
ValidityStartDate ValidityStartDate 2
@AbapCatalog.sqlViewName: 'IPURCHASECTRVER'
@AbapCatalog.preserveKey:true
@EndUserText.label: 'Purchase Contract Version'
@VDM.viewType : #COMPOSITE
@AccessControl.authorizationCheck: #MANDATORY
@ObjectModel.compositionRoot: true
//@ObjectModel.semanticKey:  [ 'PurchaseContract' ]

@ObjectModel.semanticKey:  [ 'ActivePurchasingDocument' ]
@ObjectModel.uniqueIdField: 'PurchaseContract'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.representativeKey: 'PurchaseContract'
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.entityChangeStateId: 'LastChangeDateTime'
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED

define view I_PurchaseContractVersion

  as select from R_PurchaseContract

  association [1..*] to I_PurchaseContractItem        as _PurchaseContractItem       on $projection.PurchaseContract = _PurchaseContractItem.PurchaseContract

  association [1..*] to I_PurchaseContractHistory     as _PurchaseContractHistory    on $projection.PurchaseContract = _PurchaseContractHistory.PurchaseContract

  association [1..1] to I_ReleaseCode                 as _ReleaseCode                on $projection.ReleaseCode = _ReleaseCode.ReleaseCode

  association [0..*] to I_PurchasingDocumentTypeText  as _PurchasingDocumentTypeText on $projection.PurchaseContractType = _PurchasingDocumentTypeText.PurchasingDocumentType

  association [0..*] to I_Purctrnotes                 as _PurCtrNotes                on $projection.PurchaseContract = _PurCtrNotes.PurchaseContract

  association [0..*] to I_Purctrpartners              as _PurCtrPartners             on $projection.PurchaseContract = _PurCtrPartners.PurchaseContract

  association [1..1] to I_PurContrVersionType         as _VersionType                on $projection.PurgDocChangeRequestStatus = _VersionType.PurgDocChangeRequestStatus

  ----Extension Association
  association [1..1] to E_PurchasingDocument          as _PurchasingDocument         on $projection.PurchaseContract = _PurchasingDocument.PurchasingDocument

  association [0..1] to I_PurContrVersionHistory      as _PurContrVersionHistory     on $projection.PurchaseContract = _PurContrVersionHistory.PurchaseContract

  association [0..1] to I_PurgDocVersionReasonValHelp as _VersionReasonValHelp       on $projection.purchasingdocversionreasoncode = _VersionReasonValHelp.PurchasingDocVersionReasonCode

  association [0..1] to I_PurContrVersRelevance       as _VersionRelevance           on $projection.PurchaseContract = _VersionRelevance.PurchaseContract

  association [0..1] to I_PurContrHdrExtReference     as _PurContrHdrExtReference    on $projection.ActivePurchasingDocument = _PurContrHdrExtReference.PurchaseContract


{
  key PurchaseContract,

      PurchaseContractType,

      PurchasingDocumentCategory,

      LastChangeDateTime,

      @Semantics.businessDate.at: true
      CreationDate,

      Supplier,

      CompanyCode,

      PurchasingOrganization,

      PurchasingGroup,

      @Semantics.currencyCode:true
      DocumentCurrency,

      IncotermsClassification,

      IncotermsTransferLocation,

      PaymentTerms,

      CashDiscount1Days,

      CashDiscount2Days,

      NetPaymentDays,

      CashDiscount1Percent,

      CashDiscount2Percent,

      @Semantics.amount.currencyCode: 'DocumentCurrency'
      @DefaultAggregation: #NONE
      PurchaseContractTargetAmount,

      ValidityStartDate,

      ValidityEndDate,

      @ObjectModel.foreignKey.association: '_ReleaseCode'
      ReleaseCode,

      @Semantics.user.createdBy: true
      CreatedByUser,

      PurchasingDocumentDeletionCode,

      SupplyingSupplier,

      InvoicingParty,
      ExchangeRate,
      ExchangeRateIsFixed,
      QuotationSubmissionDate,
      SupplierQuotation,
      CorrespncExternalReference,
      CorrespncInternalReference,
      SupplierRespSalesPersonName,
      SupplierPhoneNumber,
      IncotermsVersion,
      IncotermsLocation1,
      IncotermsLocation2,
      IncotermsSupChnLoc1AddlUUID,
      IncotermsSupChnLoc2AddlUUID,
      IncotermsSupChnDvtgLocAddlUUID,
      PurchasingDocumentName,
      PurchasingDocumentOrigin,
      ReleaseIsNotCompleted,
      PurchasingProcessingStatus,
      case ManualSupplierAddressID
        when '' then  _Supplier.AddressID
        else ManualSupplierAddressID
      end       as SupplierAddressID,
      IsEndOfPurposeBlocked,
//      PurgDocExternalReference,


      case
         when _PurContrHdrExtReference.PurgDocExternalReference  is not initial
         then _PurContrHdrExtReference.PurgDocExternalReference
         else
              PurgDocExternalReference
      end as PurgDocExternalReference,

      // fields from product compliance

      PurgAggrgdProdCmplncSuplrSts,
      PurgAggrgdProdMarketabilitySts,
      PurgAggrgdSftyDataSheetStatus,
      PurgProdCmplncTotDngrsGoodsSts,

      PurgHasCatalogRelevantItems,

      //Versioning in Purchase Contracts

      ActivePurchasingDocument,
      PurchasingDocumentVersion,
      PurgDocChangeRequestStatus,
      PurgDocIsChgVers,
      _PurContrVersionHistory.PurchasingDocVersionReasonCode,
      _VersionRelevance.VersionIsEnabled,

      //Fields for External Reference

      _PurContrHdrExtReference.PurgOutlineAgrmtExtSystID,

      _PurContrHdrExtReference.PurgDocExtReferenceNodeType,

      _PurchasingDocumentCategory,
      _PurchasingDocumentType,
      _IncotermsClassification,
      _Supplier,
      _CompanyCode,
      _PurchasingOrganization,
      _PurchasingGroup,
      _CreatedByUser,
      _DocumentCurrency,
      _ReleaseCode,
      _SupplyingSupplier,
      _InvoicingParty,
      _PaymentTerms,
      //Versioning in Purchase Contracts

      _VersionType,
      _VersionReasonValHelp,
      _VersionRelevance,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _PurchaseContractItem,

      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _PurCtrNotes,

      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _PurCtrPartners
}
//Commented Tmporarily

where
  //Versioning

  (
       PurgDocChangeRequestStatus = ''
    or PurgDocChangeRequestStatus = '2'
  )