C_PurchaseOrderSpend

DDL: C_PURCHASEORDERSPEND SQL: CMMPURORDSPND Type: view CONSUMPTION

Purchase Order Spend

C_PurchaseOrderSpend is a Consumption CDS View (Cube) that provides data about "Purchase Order Spend" in SAP S/4HANA. It reads from 2 data sources (P_PurOrdItemAcctAssgmt, I_PurchasingCategoryMatlGroup) and exposes 40 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber. It has 5 associations to related views.

Data Sources (2)

SourceAliasJoin Type
P_PurOrdItemAcctAssgmt P_PurOrdItemAcctAssgmt from
I_PurchasingCategoryMatlGroup PurchasingCategoryMatlGroup left_outer

Parameters (3)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate bedat
P_EndDate bedat

Associations (5)

CardinalityTargetAliasCondition
[1..1] P_Purordmaintaincustproj _WBSElement $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
[1..1] I_Material _MaterialText $projection.Material = _MaterialText.Material
[1..1] I_MaterialGroup _MaterialGroup $projection.MaterialGroup = _MaterialGroup.MaterialGroup
[1..1] I_PurchasingDocumentStatus _PurchasingDocumentStatus $projection.PurchasingDocumentStatus = _PurchasingDocumentStatus.PurchasingDocumentStatus
[1..1] I_Country _Country $projection.SupplierCountry = _Country.Country

Annotations (11)

NameValueLevelField
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
VDM.viewType #CONSUMPTION view
Analytics.dataCategory #CUBE view
Metadata.allowExtensions true view
AbapCatalog.sqlViewName CMMPURORDSPND view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Purchase Order Spend view
ObjectModel.modelingPattern #ANALYTICAL_CUBE view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder
KEY PurchaseOrderItem
KEY AccountAssignmentNumber AccountAssignmentNumber
PurgCatUUID PurgCatUUID
Supplier Supplier
SupplierCountry SupplierCountry
PurchaseOrderDate PurchaseOrderDate
CalendarYear CalendarYear
CalendarQuarter CalendarQuarter
CalendarMonth CalendarMonth
CalendarWeek CalendarWeek
YearQuarter YearQuarter
PurchasingOrganization PurchasingOrganization
CompanyCode CompanyCode
PurchasingGroup PurchasingGroup
PurchasingDocumentStatus PurchasingDocumentStatus
Material Material
MaterialGroup P_PurOrdItmAcctAssgmt MaterialGroup
Plant Plant
ProductTypeCode ProductType
ProductType
ServicePerformer ServicePerformer
PurchasingCategory
PurgCatName _PurchasingCategory PurgCatName
WBSElementInternalID WBSElementInternalID
WBSElement WBSElement
WBSDescription WBSDescription
CustomerProjectName _WBSElement CustomerProjectName
CustProjWorkPackageName _WBSElement CustProjWorkPackageName
CostCenter CostCenter
DisplayCurrency
PurOrdNetAmountInDisplayCrcy PurOrdNetAmountInDisplayCrcy
_Plant _Plant
_PurchasingGroup _PurchasingGroup
_PurchasingOrganization _PurchasingOrganization
_PurchasingDocumentStatus _PurchasingDocumentStatus
_Supplier _Supplier
_MaterialGroup _MaterialGroup
_MaterialText _MaterialText
_Country _Country
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@VDM.viewType: #CONSUMPTION
@Analytics.dataCategory: #CUBE
@Metadata.allowExtensions: true
@AbapCatalog.sqlViewName: 'CMMPURORDSPND' 
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED 
@EndUserText.label: 'Purchase Order Spend'
@ObjectModel.supportedCapabilities: [ #ANALYTICAL_PROVIDER  ]
@ObjectModel.modelingPattern: #ANALYTICAL_CUBE
define view C_PurchaseOrderSpend 

  with parameters
  
    P_DisplayCurrency           : displaycurrency,
       
    P_StartDate: bedat,
    
    P_EndDate: bedat   
    
  as select from    P_PurOrdItemAcctAssgmt( P_DisplayCurrency: $parameters.P_DisplayCurrency,
                                            P_StartDate : $parameters.P_StartDate,
                                            P_EndDate : $parameters.P_EndDate ) as P_PurOrdItmAcctAssgmt

  left outer join I_PurchasingCategoryMatlGroup                                                               as PurchasingCategoryMatlGroup on P_PurOrdItmAcctAssgmt.MaterialGroup = PurchasingCategoryMatlGroup.MaterialGroup

  association [1..1] to P_Purordmaintaincustproj   as _WBSElement                 on $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
  association [1..1] to I_Material                 as _MaterialText               on $projection.Material = _MaterialText.Material
  association [1..1] to I_MaterialGroup            as _MaterialGroup              on $projection.MaterialGroup = _MaterialGroup.MaterialGroup
  association [1..1] to I_PurchasingDocumentStatus as _PurchasingDocumentStatus   on $projection.PurchasingDocumentStatus = _PurchasingDocumentStatus.PurchasingDocumentStatus
  association [1..1] to I_Country                  as _Country                    on $projection.SupplierCountry = _Country.Country
 
{
      /* Keys */
  key cast(P_PurOrdItmAcctAssgmt.PurchaseOrder as vdm_purchaseorder)                                                           as PurchaseOrder,
  key cast(PurchaseOrderItem as vdm_purchaseorderitem)                                                   as PurchaseOrderItem,
  key AccountAssignmentNumber,
      
      PurgCatUUID,
      @ObjectModel.foreignKey.association: '_Supplier'
      Supplier,
       @ObjectModel.foreignKey.association: '_Country'
      SupplierCountry,           
      
      /* Order Date */
      
      PurchaseOrderDate,
      @Semantics.calendar.year: true
      CalendarYear,
      CalendarQuarter,
      CalendarMonth,
      CalendarWeek,
      YearQuarter,

      /* Header */
      @ObjectModel.foreignKey.association: '_PurchasingOrganization'
      PurchasingOrganization,
      CompanyCode,
      @ObjectModel.foreignKey.association: '_PurchasingGroup'
      PurchasingGroup,
      @ObjectModel.foreignKey.association: '_PurchasingDocumentStatus'
      PurchasingDocumentStatus,
      
      /* Item Data */
      @ObjectModel.foreignKey.association: '_MaterialText'
      Material,
      @ObjectModel.foreignKey.association: '_MaterialGroup'
      P_PurOrdItmAcctAssgmt.MaterialGroup,
      @ObjectModel.foreignKey.association: '_Plant'
      Plant,
            
      ProductType                                                                        as ProductTypeCode,

      @VDM.lifecycle.status:#DEPRECATED
      @VDM.lifecycle.successor:'ProductTypeCode'
      cast ( ProductType as producttype)                                                 as ProductType,
      
      ServicePerformer,
      
      PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory                                 as PurchasingCategory,
      _PurchasingCategory.PurgCatName                                                                    as PurgCatName,
      
      WBSElementInternalID,
      WBSElement,
      WBSDescription,
      _WBSElement.CustomerProjectName,
      _WBSElement.CustProjWorkPackageName,
      
      CostCenter,
      @Semantics.currencyCode: true
      cast( :P_DisplayCurrency as displaycurrency )                                                      as DisplayCurrency,

      /* Order Amount*/
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      @DefaultAggregation: #SUM                             //3000972

      PurOrdNetAmountInDisplayCrcy ,
      
      _Plant,
      _PurchasingGroup,
      _PurchasingOrganization,
      _PurchasingDocumentStatus,
      _Supplier,
      _MaterialGroup,
      _MaterialText,
      _Country
      
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASINGCATEGORY",
"I_PURCHASINGCATEGORYMATLGROUP",
"P_PURORDITEMACCTASSGMT",
"P_PURORDMAINTAINCUSTPROJ"
],
"ASSOCIATED":
[
"I_COUNTRY",
"I_MATERIAL",
"I_MATERIALGROUP",
"I_PLANT",
"I_PURCHASINGDOCUMENTSTATUS",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_SUPPLIER",
"P_PURORDMAINTAINCUSTPROJ"
],
"BASE":
[
"P_PURORDITEMACCTASSGMT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/