C_PE_StRpPurLdgrDmstcSuplrC

DDL: C_PE_STRPPURLDGRDMSTCSUPLRC SQL: CPEPURLDGRC Type: view CONSUMPTION

Purchase Ledger Domentic - Cube

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

Data Sources (2)

SourceAliasJoin Type
P_PE_PurDmstcSuplrTaxAggrgd PurchaseTaxEntry from
I_StRpJournalEntryLog StRpJournalEntryLog inner

Parameters (1)

NameTypeDefault
P_FinancialStatementHierarchy hryid

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 Domentic - Cube view
Metadata.allowExtensions true view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_PE_PurDmstcSuplrTaxAggrgd CompanyCode
KEY FiscalYear P_PE_PurDmstcSuplrTaxAggrgd FiscalYear
KEY AccountingDocument P_PE_PurDmstcSuplrTaxAggrgd AccountingDocument
KEY StatryRptCategory I_StRpJournalEntryLog StatryRptCategory
KEY StatryRptgEntity I_StRpJournalEntryLog StatryRptgEntity
KEY StatryRptRunID I_StRpJournalEntryLog StatryRptRunID
KEY Ledger P_PE_PurDmstcSuplrTaxAggrgd Ledger
ReportingDate P_PE_PurDmstcSuplrTaxAggrgd ReportingDate
FiscalPeriod P_PE_PurDmstcSuplrTaxAggrgd FiscalPeriod
PE_CompanyCodeTaxNumber P_PE_PurDmstcSuplrTaxAggrgd PE_CompanyCodeTaxNumber
CompanyCodeName P_PE_PurDmstcSuplrTaxAggrgd CompanyCodeName
CalendarYearMonth P_PE_PurDmstcSuplrTaxAggrgd CalendarYearMonth
DocumentDate P_PE_PurDmstcSuplrTaxAggrgd DocumentDate
DocumentNetDueDate P_PE_PurDmstcSuplrTaxAggrgd DocumentNetDueDate
PE_DocumentSerialNumber P_PE_PurDmstcSuplrTaxAggrgd PE_DocumentSerialNumber
ReferenceDocumentFiscalYear P_PE_PurDmstcSuplrTaxAggrgd ReferenceDocumentFiscalYear
PE_OfficialDocumentNumber P_PE_PurDmstcSuplrTaxAggrgd PE_OfficialDocumentNumber
PE_OfficialDocumentType P_PE_PurDmstcSuplrTaxAggrgd PE_OfficialDocumentType
TaxNumberType P_PE_PurDmstcSuplrTaxAggrgd TaxNumberType
TaxNumber1 P_PE_PurDmstcSuplrTaxAggrgd TaxNumber1
SupplierName P_PE_PurDmstcSuplrTaxAggrgd SupplierName
PE_OriginalDocumentDate P_PE_PurDmstcSuplrTaxAggrgd PE_OriginalDocumentDate
PE_OriginalDocumentType P_PE_PurDmstcSuplrTaxAggrgd PE_OriginalDocumentType
PE_OriginalDocumentSeries P_PE_PurDmstcSuplrTaxAggrgd PE_OriginalDocumentSeries
PE_OriginalDocumentNumber P_PE_PurDmstcSuplrTaxAggrgd PE_OriginalDocumentNumber
PE_ClassificationGoodsServices
TransactionCurrency P_PE_PurDmstcSuplrTaxAggrgd TransactionCurrency
CountryCurrency P_PE_PurDmstcSuplrTaxAggrgd CountryCurrency
TaxBaseAmount P_PE_PurDmstcSuplrTaxAggrgd TaxBaseAmount
TaxAmount P_PE_PurDmstcSuplrTaxAggrgd TaxAmount
PE_TxBaseTxblSlsAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TxBaseTxblSlsAmtInCtryCrcy
PE_TaxForTxblSlsAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TaxForTxblSlsAmtInCtryCrcy
PE_BaseTxblNonAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_BaseTxblNonAmtInCtryCrcy
PE_TaxTxblNonTxblAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TaxTxblNonTxblAmtInCtryCrcy
PE_TxBaseNonTxblAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TxBaseNonTxblAmtInCtryCrcy
PE_TxNonTxblSalesAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TxNonTxblSalesAmtInCtryCrcy
PE_NonTxblBaseAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_NonTxblBaseAmtInCtryCrcy
PE_SelectiveAcqnAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_SelectiveAcqnAmtInCtryCrcy
PE_TxOnPlasticBagAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd PE_TxOnPlasticBagAmtInCtryCrcy
PE_OthTxAndChrgsAmtInCtryCrcy P_PE_PurDmstcSuplrTaxAggrgd 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 Domentic - Cube'
@Metadata.allowExtensions:true

define view C_PE_StRpPurLdgrDmstcSuplrC
  with parameters
    P_FinancialStatementHierarchy : hryid

  as select from           P_PE_PurDmstcSuplrTaxAggrgd    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.TransactionCurrency
                                                                                      and ExchangeRate.TargetCurrency            =  PurchaseTaxEntry.CountryCurrency
                                                                                      and PurchaseTaxEntry.TransactionCurrency   <> PurchaseTaxEntry.CountryCurrency
                                                                                      and ExchangeRate.ExchangeRateType          =  PurchaseTaxEntry.ExchangeRateType
                                                                                      and ExchangeRate.ExchangeRateEffectiveDate =  PurchaseTaxEntry.ExchangeRateEffectiveDate

    left outer to one join P_PE_JournalEntryFSStructure   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 PurchaseTaxEntry.FiscalYear,
  key PurchaseTaxEntry.AccountingDocument,
  key StRpJournalEntryLog.StatryRptCategory,
  key StRpJournalEntryLog.StatryRptgEntity,
  key StRpJournalEntryLog.StatryRptRunID,
  key PurchaseTaxEntry.Ledger,

      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 PurchaseTaxEntry.TransactionCurrency
              when 'PEN'
                then 1
              else ExchangeRate.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.amount.currencyCode: 'CountryCurrency'
      PurchaseTaxEntry.TaxBaseAmount,
      @Semantics.amount.currencyCode: 'CountryCurrency'
      PurchaseTaxEntry.TaxAmount,

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

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      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
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EXCHANGERATE",
"I_STRPJOURNALENTRYLOG",
"P_PE_JOURNALENTRYFSSTRUCTURE",
"P_PE_PURDMSTCSUPLRTAXAGGRGD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/