C_PE_StRpPurLdgrDmstcSuplrC

DDL: C_PE_STRPPURLDGRDMSTCSUPLRC SQL: CPEPURLDGRC Type: view CONSUMPTION

Purchase Ledger Domestic - Cube

C_PE_StRpPurLdgrDmstcSuplrC is a Consumption CDS View (Cube) that provides data about "Purchase Ledger Domestic - Cube" in SAP S/4HANA. It reads from 2 data sources (P_PE_PurDmstcSuplrTaxAggrgd, I_StRpJournalEntryLog) and exposes 41 fields with key fields CompanyCode, FiscalYear, AccountingDocument, Ledger, StatryRptCategory.

Data Sources (2)

SourceAliasJoin Type
P_PE_PurDmstcSuplrTaxAggrgd P_PE_PurDmstcSuplrTaxAggrgd from
I_StRpJournalEntryLog StRpJournalEntryLog inner

Parameters (5)

NameTypeDefault
P_FinancialStatementHierarchy hryid
P_ReportingCurrency glo_reporting_currency
P_CompanyCode fis_bukrs
P_FiscalYear fis_gjahr_no_conv
P_Ledger rldnr

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName CPEPURLDGRC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #CONSUMPTION view
Analytics.dataCategory #CUBE view
Analytics.internalName #LOCAL view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label Purchase Ledger Domestic - Cube view
Metadata.allowExtensions true view

Fields (41)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode PurchaseTaxEntry CompanyCode
KEY FiscalYear
KEY AccountingDocument PurchaseTaxEntry AccountingDocument
KEY Ledger PurchaseTaxEntry Ledger
KEY StatryRptCategory I_StRpJournalEntryLog StatryRptCategory
KEY StatryRptgEntity I_StRpJournalEntryLog StatryRptgEntity
KEY StatryRptRunID I_StRpJournalEntryLog StatryRptRunID
ReportingDate PurchaseTaxEntry ReportingDate
FiscalPeriod PurchaseTaxEntry FiscalPeriod
PE_CompanyCodeTaxNumber PurchaseTaxEntry PE_CompanyCodeTaxNumber
CompanyCodeName PurchaseTaxEntry CompanyCodeName
CalendarYearMonth PurchaseTaxEntry CalendarYearMonth
DocumentDate PurchaseTaxEntry DocumentDate
DocumentNetDueDate PurchaseTaxEntry DocumentNetDueDate
PE_DocumentSerialNumber PurchaseTaxEntry PE_DocumentSerialNumber
ReferenceDocumentFiscalYear PurchaseTaxEntry ReferenceDocumentFiscalYear
PE_OfficialDocumentNumber PurchaseTaxEntry PE_OfficialDocumentNumber
PE_OfficialDocumentType PurchaseTaxEntry PE_OfficialDocumentType
TaxNumberType PurchaseTaxEntry TaxNumberType
TaxNumber1 PurchaseTaxEntry TaxNumber1
SupplierName PurchaseTaxEntry SupplierName
PE_OriginalDocumentDate PurchaseTaxEntry PE_OriginalDocumentDate
PE_OriginalDocumentType PurchaseTaxEntry PE_OriginalDocumentType
PE_OriginalDocumentSeries PurchaseTaxEntry PE_OriginalDocumentSeries
PE_OriginalDocumentNumber PurchaseTaxEntry PE_OriginalDocumentNumber
PE_ClassificationGoodsServices
TransactionCurrency PurchaseTaxEntry TransactionCurrency
CountryCurrency PurchaseTaxEntry CountryCurrency
ReportingCurrency PurchaseTaxEntry ReportingCurrency
TaxBaseAmount PurchaseTaxEntry TaxBaseAmount
TaxAmount PurchaseTaxEntry TaxAmount
PE_TxBaseTxblSlsAmtInCtryCrcy PurchaseTaxEntry PE_TxBaseTxblSlsAmtInCtryCrcy
PE_TaxForTxblSlsAmtInCtryCrcy PurchaseTaxEntry PE_TaxForTxblSlsAmtInCtryCrcy
PE_BaseTxblNonAmtInCtryCrcy PurchaseTaxEntry PE_BaseTxblNonAmtInCtryCrcy
PE_TaxTxblNonTxblAmtInCtryCrcy PurchaseTaxEntry PE_TaxTxblNonTxblAmtInCtryCrcy
PE_TxBaseNonTxblAmtInCtryCrcy PurchaseTaxEntry PE_TxBaseNonTxblAmtInCtryCrcy
PE_TxNonTxblSalesAmtInCtryCrcy PurchaseTaxEntry PE_TxNonTxblSalesAmtInCtryCrcy
PE_NonTxblBaseAmtInCtryCrcy PurchaseTaxEntry PE_NonTxblBaseAmtInCtryCrcy
PE_SelectiveAcqnAmtInCtryCrcy PurchaseTaxEntry PE_SelectiveAcqnAmtInCtryCrcy
PE_TxOnPlasticBagAmtInCtryCrcy PurchaseTaxEntry PE_TxOnPlasticBagAmtInCtryCrcy
PE_OthTxAndChrgsAmtInCtryCrcy PurchaseTaxEntry PE_OthTxAndChrgsAmtInCtryCrcy
@AbapCatalog.sqlViewName: 'CPEPURLDGRC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #CONSUMPTION
@Analytics: { dataCategory: #CUBE }
@Analytics.internalName: #LOCAL
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@EndUserText.label: 'Purchase Ledger Domestic - Cube'
@Metadata.allowExtensions:true

define view C_PE_StRpPurLdgrDmstcSuplrC
  with parameters
    P_FinancialStatementHierarchy : hryid,
    P_ReportingCurrency           : glo_reporting_currency,
    P_CompanyCode                 : fis_bukrs,
    P_FiscalYear                  : fis_gjahr_no_conv,
    P_Ledger                      : rldnr

  as select from           P_PE_PurDmstcSuplrTaxAggrgd( P_ReportingCurrency: $parameters.P_ReportingCurrency ) as PurchaseTaxEntry


    inner join             I_StRpJournalEntryLog                                                               as StRpJournalEntryLog on  StRpJournalEntryLog.CompanyCode        = PurchaseTaxEntry.CompanyCode
                                                                                                                                      and StRpJournalEntryLog.AccountingDocument = PurchaseTaxEntry.AccountingDocument
                                                                                                                                      and StRpJournalEntryLog.FiscalYear         = PurchaseTaxEntry.FiscalYear

    left outer to one join I_ExchangeRate                                                                      as ExchangeRate        on  ExchangeRate.SourceCurrency            =  PurchaseTaxEntry.SourceCurrency
                                                                                                                                      and ExchangeRate.TargetCurrency            =  PurchaseTaxEntry.TargetCurrency
                                                                                                                                      and PurchaseTaxEntry.TransactionCurrency   <> PurchaseTaxEntry.ReportingCurrency
                                                                                                                                      and ExchangeRate.ExchangeRateType          =  PurchaseTaxEntry.ExchangeRateType
                                                                                                                                      and ExchangeRate.ExchangeRateEffectiveDate =  PurchaseTaxEntry.ExchangeRateEffectiveDate

    left outer to one join P_PE_JournalEntryFSStructure(
                           P_CompanyCode: $parameters.P_CompanyCode,
                           P_FiscalYear: $parameters.P_FiscalYear,
                           P_Ledger: $parameters.P_Ledger,
                           P_FinancialStatementHierarchy: $parameters.P_FinancialStatementHierarchy )          as FinancialStatement  on  FinancialStatement.CompanyCode                 = PurchaseTaxEntry.CompanyCode
                                                                                                                                      and FinancialStatement.FiscalYear                  = PurchaseTaxEntry.FiscalYear
                                                                                                                                      and FinancialStatement.AccountingDocument          = PurchaseTaxEntry.AccountingDocument
                                                                                                                                      and FinancialStatement.Ledger                      = PurchaseTaxEntry.Ledger
                                                                                                                                      and FinancialStatement.FinancialStatementHierarchy = $parameters.P_FinancialStatementHierarchy

{
  key PurchaseTaxEntry.CompanyCode,
  key cast( PurchaseTaxEntry.FiscalYear as fis_gjahr_no_conv )                           as FiscalYear,
  key PurchaseTaxEntry.AccountingDocument,
  key PurchaseTaxEntry.Ledger,
  key StRpJournalEntryLog.StatryRptCategory,
  key StRpJournalEntryLog.StatryRptgEntity,
  key StRpJournalEntryLog.StatryRptRunID,

      PurchaseTaxEntry.ReportingDate,
      PurchaseTaxEntry.FiscalPeriod,
      PurchaseTaxEntry.PE_CompanyCodeTaxNumber,
      PurchaseTaxEntry.CompanyCodeName,
      PurchaseTaxEntry.CalendarYearMonth,
      PurchaseTaxEntry.DocumentDate,
      PurchaseTaxEntry.DocumentNetDueDate,

      PurchaseTaxEntry.PE_DocumentSerialNumber,
      PurchaseTaxEntry.ReferenceDocumentFiscalYear,
      PurchaseTaxEntry.PE_OfficialDocumentNumber,
      PurchaseTaxEntry.PE_OfficialDocumentType,
      PurchaseTaxEntry.TaxNumberType,
      PurchaseTaxEntry.TaxNumber1,
      PurchaseTaxEntry.SupplierName,

      PurchaseTaxEntry.PE_OriginalDocumentDate,
      PurchaseTaxEntry.PE_OriginalDocumentType,
      PurchaseTaxEntry.PE_OriginalDocumentSeries,
      PurchaseTaxEntry.PE_OriginalDocumentNumber,

      cast( case
              when PurchaseTaxEntry.ReportingCurrency = PurchaseTaxEntry.TransactionCurrency
                then 1
              when PurchaseTaxEntry.ReportingCurrency = PurchaseTaxEntry.CountryCurrency
                then abs(ExchangeRate.ExchangeRate)
              when PurchaseTaxEntry.ReportingCurrency = PurchaseTaxEntry.CompanyCodeCurrency
                then abs(PurchaseTaxEntry.ExchangeRate)
            end
      as fipe_exchange_rate )                                                            as ExchangeRate,

      cast( FinancialStatement.HierarchyParentNodeVal as fipe_classfctn_goods_services ) as PE_ClassificationGoodsServices,

      @Semantics.currencyCode:true
      PurchaseTaxEntry.TransactionCurrency,
      @Semantics.currencyCode:true
      PurchaseTaxEntry.CountryCurrency,
      @Semantics.currencyCode:true
      PurchaseTaxEntry.ReportingCurrency,

      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.TaxBaseAmount,
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.TaxAmount,

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TxBaseTxblSlsAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TaxForTxblSlsAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_BaseTxblNonAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TaxTxblNonTxblAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TxBaseNonTxblAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TxNonTxblSalesAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_NonTxblBaseAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_SelectiveAcqnAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_TxOnPlasticBagAmtInCtryCrcy,
      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      PurchaseTaxEntry.PE_OthTxAndChrgsAmtInCtryCrcy,

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        PurchaseTaxEntry.PE_TxBaseTxblSlsAmtInCtryCrcy +
        PurchaseTaxEntry.PE_TaxForTxblSlsAmtInCtryCrcy +
        PurchaseTaxEntry.PE_BaseTxblNonAmtInCtryCrcy +
        PurchaseTaxEntry.PE_TaxTxblNonTxblAmtInCtryCrcy +
        PurchaseTaxEntry.PE_TxBaseNonTxblAmtInCtryCrcy +
        PurchaseTaxEntry.PE_TxNonTxblSalesAmtInCtryCrcy +
        PurchaseTaxEntry.PE_NonTxblBaseAmtInCtryCrcy +
        PurchaseTaxEntry.PE_SelectiveAcqnAmtInCtryCrcy +
        PurchaseTaxEntry.PE_TxOnPlasticBagAmtInCtryCrcy +
        PurchaseTaxEntry.PE_OthTxAndChrgsAmtInCtryCrcy
      as fipe_total_tax_documents )                                                      as TotalAmountInLocalCurrency
}
where
      PurchaseTaxEntry.CompanyCode = $parameters.P_CompanyCode
  and PurchaseTaxEntry.FiscalYear  = $parameters.P_FiscalYear
  and PurchaseTaxEntry.Ledger      = $parameters.P_Ledger