P_NONMNGDPURCHASINGSPEND

CDS View

Non Managed Purchasing Spend

P_NONMNGDPURCHASINGSPEND is a CDS View in S/4HANA. Non Managed Purchasing Spend. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
C_NonMngdPurchasingSpend3 view from CONSUMPTION Non Managed Purchasing Spend Cube
@AbapCatalog.sqlViewName: 'PMMNONMNGDPURSP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Non Managed Purchasing Spend'
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AccessControl.personalData.blocking: #NOT_REQUIRED
define view P_NonMngdPurchasingSpend

  with parameters
    P_DisplayCurrency           : displaycurrency,
    P_StartDate: mm_a_delivery_date,
    P_EndDate: mm_a_delivery_date

  as select from P_NonMngdPurchasingSpend3( P_DisplayCurrency:$parameters.P_DisplayCurrency , P_StartDate: $parameters.P_StartDate,
                                     P_EndDate: $parameters.P_EndDate)                                                                  as PostedAccountDocEn1

  association [0..1] to I_CompanyCode as _CompanyCode on  $projection.CompanyCode = _CompanyCode.CompanyCode
  association [0..1] to I_GLAccount   as _GLAccount   on  $projection.GLAccount   = _GLAccount.GLAccount
                                                      and $projection.CompanyCode = _GLAccount.CompanyCode
  association [0..1] to I_Material    as _Material    on  $projection.Material = _Material.Material

{
  key PostedAccountDocEn1.AccountingDocument,
  key PostedAccountDocEn1.FiscalYear,
  key PostedAccountDocEn1.CompanyCode,
  key PostedAccountDocEn1.Creditor                                                      as Supplier,
  key PostedAccountDocEn1.GLAccount,

      PostedAccountDocEn1.AccountingDocumentType,
      PostedAccountDocEn1.PostingDate                                              as PostingDate,
      PostedAccountDocEn1.Material                                                 as Material,
      PostedAccountDocEn1.ProfitCenter,
      PostedAccountDocEn1.CostCenter,
      AccountingDocCreatedByUser,

      PostedAccountDocEn1.ControllingArea,
      PostedAccountDocEn1.WBSElement,
      PostedAccountDocEn1.WBSElementInternalID,
      PostedAccountDocEn1.Fund,
      PostedAccountDocEn1.Plant                                                    as Plant,
      _Material.MaterialGroup                                                           as MaterialGroup,

      PostedAccountDocEn1.PurchaseOrder,
      PostedAccountDocEn1.CompanyCodeCurrency,

      SupplierAmount,

      sum( case when (  CostCenterAmount1 > 0 and SupplierAmount < 0
                     or CostCenterAmount1 < 0 and SupplierAmount > 0 ) then
            - cast( round( cast( DIVISION(CostCenterAmount, CostCenterAmount1, 7) as abap.curr(17,7)) *       //3001120

             cast( SupplierAmount as abap.curr(15,3)),3) as abap.curr(17,3) )
        else - SupplierAmount end )                                                     as TotalSpendAmount,  //3001120



      $parameters.P_DisplayCurrency                                                     as DisplayCurrency,
      _CompanyCode,
      _GLAccount,
      _Material


}

group by
  PostedAccountDocEn1.AccountingDocument,
  PostedAccountDocEn1.FiscalYear,
  PostedAccountDocEn1.CompanyCode,
  PostedAccountDocEn1.Creditor,

  PostedAccountDocEn1.AccountingDocumentType,
  PostedAccountDocEn1.PostingDate,
  PostedAccountDocEn1.GLAccount,


  PostedAccountDocEn1.ProfitCenter,
  PostedAccountDocEn1.CostCenter,
  PostedAccountDocEn1.Material,
  AccountingDocCreatedByUser,
  PostedAccountDocEn1.ControllingArea,
  PostedAccountDocEn1.WBSElement,
  PostedAccountDocEn1.WBSElementInternalID,
  PostedAccountDocEn1.Fund,
  PostedAccountDocEn1.Plant,
  _Material.MaterialGroup,
  PostedAccountDocEn1.CompanyCodeCurrency,
  SupplierAmount,

  PostedAccountDocEn1.PurchaseOrder
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIAL",
"P_NONMNGDPURCHASINGSPEND3"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_GLACCOUNT",
"I_MATERIAL"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/