R_PurchaseOrder

DDL: R_PURCHASEORDER SQL: RMMPURCHASEORDER Type: view BASIC

Purchase Order Internal View

R_PurchaseOrder is a Basic CDS View that provides data about "Purchase Order Internal View" in SAP S/4HANA. It reads from 1 data source (R_PurchasingDocument) and exposes 94 fields with key field PurchaseOrder. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
R_PurchasingDocument R_PurchasingDocument from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_PurchaseOrderType _PurchaseOrderType _PurchaseOrderType.PurchaseOrderType = $projection.PurchaseOrderType
[0..*] R_PurchaseOrderItem _PurchaseOrderItem $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder
[0..*] R_PurchaseOrderSupplierAddress _SupplierAddress $projection.PurchaseOrder = _SupplierAddress.PurchaseOrder
[1..1] I_PurchaseOrderCalcFields _PurchaseOrderCalcFields $projection.PurchaseOrder = _PurchaseOrderCalcFields.PurchaseOrder
[1..1] I_PurchaseOrderDeletionCode _PurchaseOrderDeletionCode $projection.PurchaseOrderDeletionCode = _PurchaseOrderDeletionCode.PurchaseOrderDeletionCode

Annotations (16)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Purchase Order Internal View view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.viewType #BASIC view
AbapCatalog.sqlViewName RMMPURCHASEORDER view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.modelCategory #BUSINESS_OBJECT view
ObjectModel.compositionRoot true view
ObjectModel.semanticKey PurchaseOrder view
ObjectModel.representativeKey PurchaseOrder view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view

Fields (94)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder
PurchaseOrderType PurchasingDocumentType
PurchaseOrderSubtype PurchasingDocumentSubtype
PurchasingDocumentProcessCode PurchasingDocumentProcessCode
PurchasingDocumentOrigin PurchasingDocumentOrigin
PurchasingDocumentIsAged PurchasingDocumentIsAged
CreatedByUser CreatedByUser
CreationDate CreationDate
PurchaseOrderDate
Language Language
PurchaseOrderDeletionCode
ReleaseIsNotCompleted ReleaseIsNotCompleted
PurchasingCompletenessStatus PurchasingCompletenessStatus
PurchasingProcessingStatus PurchasingProcessingStatus
PurgReleaseSequenceStatus PurgReleaseSequenceStatus
ReleaseCode ReleaseCode
PurchasingReleaseStrategy PurchasingReleaseStrategy
CompanyCode CompanyCode
PurchasingOrganization PurchasingOrganization
PurchasingGroup PurchasingGroup
Supplier Supplier
ManualSupplierAddressID ManualSupplierAddressID
SupplierAddressID SupplierAddressID
SupplierRespSalesPersonName SupplierRespSalesPersonName
SupplierPhoneNumber SupplierPhoneNumber
SupplyingSupplier SupplyingSupplier
SupplyingPlant SupplyingPlant
InvoicingParty InvoicingParty
Customer Customer
PurchaseContract PurchaseContract
RequestForQuotation RequestForQuotation
QuotationSubmissionDate QuotationSubmissionDate
PurchasingCollectiveNumber PurchasingCollectiveNumber
ItemNumberIntervalForSubItems ItemNumberIntervalForSubItems
SupplierQuotationExternalID SupplierQuotationExternalID
PaymentTerms PaymentTerms
CashDiscount1Days CashDiscount1Days
CashDiscount2Days CashDiscount2Days
NetPaymentDays NetPaymentDays
CashDiscount1Percent CashDiscount1Percent
CashDiscount2Percent CashDiscount2Percent
DownPaymentType DownPaymentType
DownPaymentPercentageOfTotAmt DownPaymentPercentageOfTotAmt
DownPaymentAmount DownPaymentAmount
DownPaymentDueDate DownPaymentDueDate
IncotermsClassification IncotermsClassification
IncotermsTransferLocation IncotermsTransferLocation
IncotermsVersion IncotermsVersion
IncotermsLocation1 IncotermsLocation1
IncotermsLocation2 IncotermsLocation2
IncotermsSupChnLoc1AddlUUID IncotermsSupChnLoc1AddlUUID
IncotermsSupChnLoc2AddlUUID IncotermsSupChnLoc2AddlUUID
IncotermsSupChnDvtgLocAddlUUID IncotermsSupChnDvtgLocAddlUUID
IsIntrastatReportingRelevant IsIntrastatReportingRelevant
IsIntrastatReportingExcluded IsIntrastatReportingExcluded
CorrespncExternalReference CorrespncExternalReference
CorrespncInternalReference CorrespncInternalReference
PricingDocument PricingDocument
PricingProcedure PricingProcedure
DocumentCurrency DocumentCurrency
ValidityStartDate ValidityStartDate
ValidityEndDate ValidityEndDate
ExchangeRate ExchangeRate
ExchangeRateIsFixed ExchangeRateIsFixed
LastChangeDateTime LastChangeDateTime
IsEndOfPurposeBlocked IsEndOfPurposeBlocked
TaxReturnCountry TaxReturnCountry
VATRegistrationCountry VATRegistrationCountry
PurgReasonForDocCancellation PurgReasonForDocCancellation
PurgReleaseTimeTotalAmount PurgReleaseTimeTotalAmount
PurgAggrgdProdCmplncSuplrSts PurgAggrgdProdCmplncSuplrSts
PurgAggrgdProdMarketabilitySts PurgAggrgdProdMarketabilitySts
PurgAggrgdSftyDataSheetStatus PurgAggrgdSftyDataSheetStatus
PurgProdCmplncTotDngrsGoodsSts PurgProdCmplncTotDngrsGoodsSts
PurgDocDefaultShippingType PurgDocDefaultShippingType
_PurchaseOrderItem _PurchaseOrderItem
_PurchaseOrderType _PurchaseOrderType
_CompanyCode _CompanyCode
_CreatedByUser _CreatedByUser
_Supplier _Supplier
_SupplyingSupplier _SupplyingSupplier
_InvoicingParty _InvoicingParty
_PurchasingOrganization _PurchasingOrganization
_PurchasingGroup _PurchasingGroup
_DocumentCurrency _DocumentCurrency
_IncotermsClassification _IncotermsClassification
_IncotermsVersion _IncotermsVersion
_SupplyingPlant _SupplyingPlant
_PaymentTerms _PaymentTerms
_SupplierAddress _SupplierAddress
_Language _Language
_PurchaseOrderDeletionCode _PurchaseOrderDeletionCode
_PurchaseOrderCalcFields _PurchaseOrderCalcFields
_PurchasingProcessingStatus _PurchasingProcessingStatus
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Purchase Order Internal View'
@AccessControl: { authorizationCheck:#CHECK, personalData.blocking: #BLOCKED_DATA_EXCLUDED, privilegedAssociations: [ '_SupplierAddress' ] } 
@VDM.viewType : #BASIC
@AbapCatalog.sqlViewName: 'RMMPURCHASEORDER'
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel: {
  modelCategory: #BUSINESS_OBJECT,
  compositionRoot:true,
  semanticKey: 'PurchaseOrder',
  representativeKey: 'PurchaseOrder'
}
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
 
define view R_PurchaseOrder
  as select from R_PurchasingDocument

  association [0..1] to I_PurchaseOrderType            as _PurchaseOrderType         on _PurchaseOrderType.PurchaseOrderType = $projection.PurchaseOrderType

  association [0..*] to R_PurchaseOrderItem            as _PurchaseOrderItem         on  $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder

  association [0..*] to R_PurchaseOrderSupplierAddress as _SupplierAddress           on  $projection.PurchaseOrder = _SupplierAddress.PurchaseOrder

  association [1..1] to I_PurchaseOrderCalcFields      as _PurchaseOrderCalcFields   on  $projection.PurchaseOrder = _PurchaseOrderCalcFields.PurchaseOrder

  association [1..1] to I_PurchaseOrderDeletionCode    as _PurchaseOrderDeletionCode on  $projection.PurchaseOrderDeletionCode = _PurchaseOrderDeletionCode.PurchaseOrderDeletionCode


{
      //Key

  key cast (PurchasingDocument as vdm_purchaseorder preserving type)             as PurchaseOrder,

      //Category

      @ObjectModel.foreignKey.association: '_PurchaseOrderType'
      PurchasingDocumentType                                                     as PurchaseOrderType,
      PurchasingDocumentSubtype                                                  as PurchaseOrderSubtype,
      PurchasingDocumentProcessCode,
      PurchasingDocumentOrigin,
      PurchasingDocumentIsAged,

      //Admin

      CreatedByUser,
      //   @Semantics.businessDate.createdAt

      CreationDate,
      cast (PurchasingDocumentOrderDate as bedat preserving type)                as PurchaseOrderDate,
      @Semantics.language: true
      @ObjectModel.foreignKey.association: '_Language'
      Language,

      //Status

      @ObjectModel.foreignKey.association: '_PurchaseOrderDeletionCode'
      cast (PurchasingDocumentDeletionCode as mmpur_po_del_code preserving type) as PurchaseOrderDeletionCode,
      ReleaseIsNotCompleted,
      PurchasingCompletenessStatus,
      PurchasingProcessingStatus,
      PurgReleaseSequenceStatus,
      ReleaseCode,
      PurchasingReleaseStrategy,

      //Organization

      @ObjectModel.foreignKey.association: '_CompanyCode'
      CompanyCode,
      @ObjectModel.foreignKey.association: '_PurchasingOrganization'
      PurchasingOrganization,
      @ObjectModel.foreignKey.association: '_PurchasingGroup'
      PurchasingGroup,

      //Supplier

      @ObjectModel.foreignKey.association: '_Supplier'
      Supplier,
      ManualSupplierAddressID,
      SupplierAddressID,
      SupplierRespSalesPersonName,
      SupplierPhoneNumber,
      @ObjectModel.foreignKey.association: '_SupplyingSupplier'
      SupplyingSupplier,
      @ObjectModel.foreignKey.association: '_SupplyingPlant'
      SupplyingPlant,
      @ObjectModel.foreignKey.association: '_InvoicingParty'
      InvoicingParty,
      Customer,

      // Contract

      PurchaseContract,

      // Request For Quotation

      RequestForQuotation,
      QuotationSubmissionDate,
      // Collective Number

      PurchasingCollectiveNumber,
      ItemNumberIntervalForSubItems,

      //Quotation

      SupplierQuotationExternalID,

      //PaymentTerms

      @ObjectModel.foreignKey.association: '_PaymentTerms'
      PaymentTerms,
      CashDiscount1Days,
      CashDiscount2Days,
      NetPaymentDays,
      CashDiscount1Percent,
      CashDiscount2Percent,

      //DownPayment

      DownPaymentType,
      DownPaymentPercentageOfTotAmt,
      DownPaymentAmount,
      DownPaymentDueDate,

      //Incoterms

      @ObjectModel.foreignKey.association: '_IncotermsClassification'
      IncotermsClassification,
      IncotermsTransferLocation,
      @ObjectModel.foreignKey.association: '_IncotermsVersion'
      IncotermsVersion,
      IncotermsLocation1,
      IncotermsLocation2,
      IncotermsSupChnLoc1AddlUUID,      
      IncotermsSupChnLoc2AddlUUID,
      IncotermsSupChnDvtgLocAddlUUID,            

      //Intratat

      IsIntrastatReportingRelevant,
      IsIntrastatReportingExcluded,

      //References

      CorrespncExternalReference, //Your reference

      CorrespncInternalReference, //Our reference


      //Pricing

      PricingDocument,
      PricingProcedure,

      @Semantics.currencyCode
      @ObjectModel.foreignKey.association: '_DocumentCurrency'
      DocumentCurrency,

      ValidityStartDate,
      ValidityEndDate,

      @Consumption.hidden: true
      ExchangeRate,
      ExchangeRateIsFixed,

      LastChangeDateTime,
      IsEndOfPurposeBlocked,

      TaxReturnCountry,
      VATRegistrationCountry,
      PurgReasonForDocCancellation,
      PurgReleaseTimeTotalAmount,

      // fields from product compliance

      PurgAggrgdProdCmplncSuplrSts,
      PurgAggrgdProdMarketabilitySts,
      PurgAggrgdSftyDataSheetStatus,
      PurgProdCmplncTotDngrsGoodsSts,
      
      PurgDocDefaultShippingType,


      //_CompanyCode.FiscalYearVariant as FiscalYearVariant,


      // Associations


      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _PurchaseOrderItem,
      _PurchaseOrderType,
      _CompanyCode,
      _CreatedByUser,
      _Supplier,
      _SupplyingSupplier,
      _InvoicingParty,
      _PurchasingOrganization,
      _PurchasingGroup,
      _DocumentCurrency,
      _IncotermsClassification,
      _IncotermsVersion,
      _SupplyingPlant,
      _PaymentTerms,
      _SupplierAddress,
      _Language,
      _PurchaseOrderDeletionCode,
      _PurchaseOrderCalcFields,
      _PurchasingProcessingStatus

      //Missing Associations


      //_AllContacts

      // Partner

      //Conditions

      //PricingProcedure

}
where
      R_PurchasingDocument.PurchasingDocumentCategory = 'F'
  and R_PurchasingDocument.PurchasingDocumentIsAged   = ''
  and IsEndOfPurposeBlocked                           = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"R_PURCHASINGDOCUMENT"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_CURRENCY",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSVERSION",
"I_LANGUAGE",
"I_PAYMENTTERMS",
"I_PLANT",
"I_PURCHASEORDERCALCFIELDS",
"I_PURCHASEORDERDELETIONCODE",
"I_PURCHASEORDERTYPE",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_PURCHASINGPROCESSINGSTATUS",
"I_SUPPLIER",
"I_USER",
"R_PURCHASEORDERITEM",
"R_PURCHASEORDERSUPPLIERADDRESS"
],
"BASE":
[
"R_PURCHASINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/