R_PurchaseContract

DDL: R_PURCHASECONTRACT SQL: RPURCHASECTR Type: view BASIC

Purchase Contract Base View

R_PurchaseContract is a Basic CDS View that provides data about "Purchase Contract Base View" in SAP S/4HANA. It reads from 1 data source (R_PurchasingDocument) and exposes 68 fields with key field PurchaseContract.

Data Sources (1)

SourceAliasJoin Type
R_PurchasingDocument R_PurchasingDocument from

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName RPURCHASECTR view
AbapCatalog.preserveKey true view
VDM.viewType #BASIC view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Purchase Contract Base View view
ObjectModel.representativeKey PurchaseContract view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (68)

KeyFieldSource TableSource FieldDescription
KEY PurchaseContract
PurchaseContractType PurchasingDocumentType
PurchasingDocumentCategory PurchasingDocumentCategory
LastChangeDateTime LastChangeDateTime
CreationDate CreationDate
Supplier Supplier
CompanyCode CompanyCode
PurchasingOrganization PurchasingOrganization
PurchasingGroup PurchasingGroup
DocumentCurrency DocumentCurrency
IncotermsClassification IncotermsClassification
IncotermsTransferLocation IncotermsTransferLocation
PaymentTerms PaymentTerms
CashDiscount1Days CashDiscount1Days
CashDiscount2Days CashDiscount2Days
NetPaymentDays NetPaymentDays
CashDiscount1Percent CashDiscount1Percent
CashDiscount2Percent CashDiscount2Percent
PurchaseContractTargetAmount TargetAmount
ValidityStartDate ValidityStartDate
ValidityEndDate ValidityEndDate
ReleaseCode ReleaseCode
CreatedByUser CreatedByUser
PurchasingDocumentDeletionCode PurchasingDocumentDeletionCode
SupplyingSupplier SupplyingSupplier
InvoicingParty InvoicingParty
ExchangeRate ExchangeRate
ExchangeRateIsFixed ExchangeRateIsFixed
QuotationSubmissionDate QuotationSubmissionDate
SupplierQuotation SupplierQuotationExternalID
CorrespncExternalReference CorrespncExternalReference
CorrespncInternalReference CorrespncInternalReference
SupplierRespSalesPersonName SupplierRespSalesPersonName
SupplierPhoneNumber SupplierPhoneNumber
IncotermsVersion IncotermsVersion
IncotermsLocation1 IncotermsLocation1
IncotermsLocation2 IncotermsLocation2
IncotermsSupChnLoc1AddlUUID IncotermsSupChnLoc1AddlUUID
IncotermsSupChnLoc2AddlUUID IncotermsSupChnLoc2AddlUUID
IncotermsSupChnDvtgLocAddlUUID IncotermsSupChnDvtgLocAddlUUID
PurchasingDocumentName PurchasingDocumentName
PurchasingDocumentOrigin PurchasingDocumentOrigin
ReleaseIsNotCompleted ReleaseIsNotCompleted
PurchasingProcessingStatus PurchasingProcessingStatus
ManualSupplierAddressID ManualSupplierAddressID
IsEndOfPurposeBlocked IsEndOfPurposeBlocked
PurgDocExternalReference PurgDocExternalReference
PurgAggrgdProdCmplncSuplrSts PurgAggrgdProdCmplncSuplrSts
PurgAggrgdProdMarketabilitySts PurgAggrgdProdMarketabilitySts
PurgAggrgdSftyDataSheetStatus PurgAggrgdSftyDataSheetStatus
PurgProdCmplncTotDngrsGoodsSts PurgProdCmplncTotDngrsGoodsSts
PurgHasCatalogRelevantItems PurgHasCatalogRelevantItems
ActivePurchasingDocument ActivePurchasingDocument
PurchasingDocumentVersion PurchasingDocumentVersion
PurgDocChangeRequestStatus PurgDocChangeRequestStatus
_PurchasingDocumentCategory _PurchasingDocumentCategory
_PurchasingDocumentType _PurchasingDocumentType
_IncotermsClassification _IncotermsClassification
_Supplier _Supplier
_CompanyCode _CompanyCode
_PurchasingOrganization _PurchasingOrganization
_PurchasingGroup _PurchasingGroup
_CreatedByUser _CreatedByUser
_DocumentCurrency _DocumentCurrency
_ReleaseCode _ReleaseCode
_SupplyingSupplier _SupplyingSupplier
_InvoicingParty _InvoicingParty
_PaymentTerms _PaymentTerms
@AbapCatalog.sqlViewName: 'RPURCHASECTR'
@AbapCatalog.preserveKey:true
@VDM.viewType : #BASIC
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Purchase Contract Base View'
@ObjectModel.representativeKey: 'PurchaseContract'
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL


define view R_PurchaseContract
  as select from R_PurchasingDocument
{
  key cast (PurchasingDocument as vdm_purchasecontract preserving type) as PurchaseContract,

      PurchasingDocumentType                                            as PurchaseContractType,

      PurchasingDocumentCategory,

      LastChangeDateTime,

      @Semantics.businessDate.createdAt: true
      CreationDate,

      Supplier,

      CompanyCode,

      PurchasingOrganization,

      PurchasingGroup,

      @Semantics.currencyCode:true
      DocumentCurrency,

      IncotermsClassification,

      IncotermsTransferLocation,

      PaymentTerms,

      CashDiscount1Days,

      CashDiscount2Days,

      NetPaymentDays,

      CashDiscount1Percent,

      CashDiscount2Percent,

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

      ValidityStartDate,

      ValidityEndDate,

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

      @Semantics.user.createdBy: true
      CreatedByUser,

      PurchasingDocumentDeletionCode,

      SupplyingSupplier,

      InvoicingParty,
      ExchangeRate,
      ExchangeRateIsFixed,
      QuotationSubmissionDate,
      SupplierQuotationExternalID                                       as SupplierQuotation,
      CorrespncExternalReference,
      CorrespncInternalReference,
      SupplierRespSalesPersonName,
      SupplierPhoneNumber,
      IncotermsVersion,
      IncotermsLocation1,
      IncotermsLocation2,
      IncotermsSupChnLoc1AddlUUID,
      IncotermsSupChnLoc2AddlUUID,
      IncotermsSupChnDvtgLocAddlUUID,
      PurchasingDocumentName,
      PurchasingDocumentOrigin,
      ReleaseIsNotCompleted,
      PurchasingProcessingStatus,
      ManualSupplierAddressID,
      IsEndOfPurposeBlocked,
      PurgDocExternalReference,

      // fields from product compliance

      PurgAggrgdProdCmplncSuplrSts,
      PurgAggrgdProdMarketabilitySts,
      PurgAggrgdSftyDataSheetStatus,
      PurgProdCmplncTotDngrsGoodsSts,
      
      PurgHasCatalogRelevantItems,
      //Versionining 

      ActivePurchasingDocument, 
      PurchasingDocumentVersion,
      PurgDocChangeRequestStatus,
      case PurgDocChangeRequestStatus
        when '2' then cast( 'X' as xfeld )
        else cast( '' as xfeld ) end                                           as PurgDocIsChgVers,      

      _PurchasingDocumentCategory,
      _PurchasingDocumentType,
      _IncotermsClassification,
      _Supplier,
      _CompanyCode,
      _PurchasingOrganization,
      _PurchasingGroup,
      _CreatedByUser,
      _DocumentCurrency,
      _ReleaseCode,
      _SupplyingSupplier,
      _InvoicingParty,
      _PaymentTerms
}
where
      PurchasingDocumentCategory = 'K'
  and IsEndOfPurposeBlocked      = ''
  and ( PurgDocChangeRequestStatus = '' or
        PurgDocChangeRequestStatus = '1' or
        PurgDocChangeRequestStatus = '2' or
        PurgDocChangeRequestStatus = '4' )     
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"R_PURCHASINGDOCUMENT"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_CURRENCY",
"I_INCOTERMSCLASSIFICATION",
"I_PAYMENTTERMS",
"I_PURCHASINGDOCUMENTCATEGORY",
"I_PURCHASINGDOCUMENTTYPE",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_RELEASECODE",
"I_SUPPLIER",
"I_USER"
],
"BASE":
[
"R_PURCHASINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/