P_NonMngdPurchasingSpend2

DDL: P_NONMNGDPURCHASINGSPEND2 SQL: PMMNONMNGDPURS2 Type: view CONSUMPTION

Non Managed Spend

P_NonMngdPurchasingSpend2 is a Consumption CDS View that provides data about "Non Managed Spend" in SAP S/4HANA. It reads from 2 data sources (I_OperationalAcctgDocItem, P_NonMngdPurchasingSpend4) and exposes 9 fields with key fields AccountingDocument, FiscalYear, CompanyCode, Creditor.

Data Sources (2)

SourceAliasJoin Type
I_OperationalAcctgDocItem _CCTotal inner
P_NonMngdPurchasingSpend4 P_NonMngdPurchasingSpend4 from

Parameters (3)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate budat
P_EndDate budat

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PMMNONMNGDPURS2 view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Non Managed Spend view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (9)

KeyFieldSource TableSource FieldDescription
KEY AccountingDocument Supplier AccountingDocument
KEY FiscalYear Supplier FiscalYear
KEY CompanyCode Supplier CompanyCode
KEY Creditor Supplier Creditor
PostingDate Supplier PostingDate
AccountingDocumentType Supplier AccountingDocumentType
CompanyCodeCurrency Supplier CompanyCodeCurrency
SupplierAmount Supplier SupplierAmount
CostCenterAmount1
@AbapCatalog.sqlViewName: 'PMMNONMNGDPURS2'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Non Managed Spend'
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AccessControl.personalData.blocking: #NOT_REQUIRED
define view P_NonMngdPurchasingSpend2

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

as select from P_NonMngdPurchasingSpend4( P_DisplayCurrency:$parameters.P_DisplayCurrency , P_StartDate: $parameters.P_StartDate,
                                     P_EndDate: $parameters.P_EndDate) as Supplier

//   left outer join   I_ReceivablesPayablesItem    as _AcctAssgmt on (Supplier.PostingDate        = _AcctAssgmt.PostingDate // 2749901

//                                                                 and Supplier.CompanyCode        = _AcctAssgmt.CompanyCode

//                                                                 and Supplier.AccountingDocument = _AcctAssgmt.AccountingDocument

//                                                                 and Supplier.FiscalYear         = _AcctAssgmt.FiscalYear

//                                                                 and _AcctAssgmt.IsSalesRelated = ''

//                                                                 and _AcctAssgmt.TaxType         = ''

//                                                                 and (

//                                                                        ( Supplier.AmountInCompanyCodeCurrency > 0

//                                                                        and _AcctAssgmt.AmountInCompanyCodeCurrency < 0 )

//                                                                    or (  Supplier.AmountInCompanyCodeCurrency < 0

//                                                                        and _AcctAssgmt.AmountInCompanyCodeCurrency > 0 )

//                                                                 ))


           inner join   I_OperationalAcctgDocItem    as _CCTotal on   Supplier.PostingDate        = _CCTotal.PostingDate // 2749901

                                                                 and Supplier.CompanyCode        = _CCTotal.CompanyCode
                                                                 and Supplier.AccountingDocument = _CCTotal.AccountingDocument
                                                                 and Supplier.FiscalYear         = _CCTotal.FiscalYear
                                                                 and _CCTotal.IsSalesRelated = ''
                                                                 and _CCTotal.TaxType         = ''
                                                                 and  _CCTotal.PostingDate >= $parameters.P_StartDate  // 3026005

                                                                 and  _CCTotal.PostingDate <= $parameters.P_EndDate    // 3026005                                                                 

                                                                 and (  (   Supplier.SupplierAmount > 0    // 2722982

                                                                        and _CCTotal.AmountInCompanyCodeCurrency < 0 )
                                                                     or (   Supplier.SupplierAmount < 0
                                                                        and _CCTotal.AmountInCompanyCodeCurrency > 0 ) )
                                                                 and _CCTotal.FinancialAccountType <> 'K'               // 3001120

                                                                 and _CCTotal.FinancialAccountType <> 'D'               // 3001120

{
  key Supplier.AccountingDocument,
  key Supplier.FiscalYear,
  key Supplier.CompanyCode,
  key Supplier.Creditor,

  Supplier.PostingDate,
  Supplier.AccountingDocumentType,     // 3119821

  Supplier.CompanyCodeCurrency,
//  key _AcctAssgmt.GLAccount as GLAccount, // 2749901

//

//      cast(_AcctAssgmt.AccountingDocumentType as mm_a_farp_blart)          as AccountingDocumentType,

//      _AcctAssgmt.PostingDate                                              as PostingDate,

//      _AcctAssgmt.Material                                                 as Material,

//      _AcctAssgmt.ProfitCenter,

//      _AcctAssgmt.CostCenter,

//      cast(_AcctAssgmt._JournalEntry.AccountingDocCreatedByUser as ernam ) as AccountingDocCreatedByUser,

//

//      _AcctAssgmt.ControllingArea,

//      _AcctAssgmt.WBSElement,

//      _AcctAssgmt.Fund,

//      _AcctAssgmt.Plant                                                    as Plant,

//

//      _AcctAssgmt.PurchasingDocument                                       as PurchaseOrder,

//      _AcctAssgmt.CompanyCodeCurrency,


  Supplier.SupplierAmount,     // 3119821


      sum( _CCTotal.AmountInCompanyCodeCurrency ) as CostCenterAmount1                                         // 3026005

      
}
  group by
  Supplier.AccountingDocument,
//  _AcctAssgmt.GLAccount,

//  _AcctAssgmt.AccountingDocumentItem,      // 2722982

   Supplier.FiscalYear,
   Supplier.CompanyCode,
   Supplier.Creditor,
   Supplier.PostingDate,
   Supplier.AccountingDocumentType,     // 3119821

   Supplier.CompanyCodeCurrency,
   Supplier.SupplierAmount
//  _AcctAssgmt.AccountingDocumentType, // 2749901

//  _AcctAssgmt.PostingDate,

//  _AcctAssgmt.GLAccount,

//

//

//  _AcctAssgmt.ProfitCenter,

//  _AcctAssgmt.CostCenter,

//  _AcctAssgmt.Material,

//  _AcctAssgmt._JournalEntry.AccountingDocCreatedByUser,

//  _AcctAssgmt.ControllingArea,

//  _AcctAssgmt.AmountInCompanyCodeCurrency,

//  _AcctAssgmt.WBSElement,

//  _AcctAssgmt.Fund,

//  _AcctAssgmt.Plant,

//  _AcctAssgmt.CompanyCodeCurrency,

//  _AcctAssgmt.PurchasingDocument

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_OPERATIONALACCTGDOCITEM",
"P_NONMNGDPURCHASINGSPEND4"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/