P_AR_PURCHASEVATRATEDETAIL

CDS View

P_AR_PURCHASEVATRATEDETAIL is a CDS View in S/4HANA. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
C_AR_StRpPurImprtDispatchVATC view from CONSUMPTION AR Purchase Import Dispatch - Cube
P_AR_PurchaseVATRateDetail2 view from CONSUMPTION
@AbapCatalog.sqlViewName: 'PARPURCVATRD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_AR_PurchaseVATRateDetail
  with parameters
    P_RptgAmountIsInTransCrcy : fiar_use_transaction_currency

  as select from           P_AR_PurVATRateAggregatedAmt2 as PurVATRateAggregatedAmt

    inner join             P_AR_JournalEntry             as JournalEntry       on JournalEntry.CompanyCode        = PurVATRateAggregatedAmt.CompanyCode
                                                                              and JournalEntry.FiscalYear         = PurVATRateAggregatedAmt.FiscalYear
                                                                              and JournalEntry.AccountingDocument = PurVATRateAggregatedAmt.AccountingDocument
                                                                              and JournalEntry.ReportingDate      = PurVATRateAggregatedAmt.ReportingDate

    left outer to one join P_AR_NumberOfVATRates         as NumberOfVATRates   on NumberOfVATRates.CompanyCode        = PurVATRateAggregatedAmt.CompanyCode
                                                                              and NumberOfVATRates.FiscalYear         = PurVATRateAggregatedAmt.FiscalYear
                                                                              and NumberOfVATRates.AccountingDocument = PurVATRateAggregatedAmt.AccountingDocument
                                                                              and NumberOfVATRates.TaxType            = 'V'

{
  key JournalEntry.CompanyCode,
  key JournalEntry.FiscalYear,
  key JournalEntry.AccountingDocument,
  key PurVATRateAggregatedAmt.TaxRate as TaxRate,
      JournalEntry.PostingDate,
      JournalEntry.DocumentDate,
      PurVATRateAggregatedAmt.ReportingDate,
      JournalEntry.TaxReportingDate,
      JournalEntry.AccountingDocumentType,
      JournalEntry.DocumentReferenceID,
      JournalEntry.AR_PrintCharacter,
      JournalEntry.AR_Branch,
      JournalEntry.AR_OfficialDocumentNumber,
      PurVATRateAggregatedAmt.CompanyCodeCountry,

      @Semantics.currencyCode:true
      JournalEntry.CompanyCodeCurrency,
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      PurVATRateAggregatedAmt.TaxAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      PurVATRateAggregatedAmt.TaxBaseAmountInCoCodeCrcy,

      @Semantics.currencyCode:true
      JournalEntry.TransactionCurrency,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      PurVATRateAggregatedAmt.TaxAmountInTransCrcy,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      PurVATRateAggregatedAmt.TaxBaseAmountInTransCrcy,

      @Semantics.currencyCode:true
      cast(
        case $parameters.P_RptgAmountIsInTransCrcy
          when 'X'
            then JournalEntry.TransactionCurrency
          else JournalEntry.CompanyCodeCurrency
        end as glo_reporting_currency preserving type
      )                                     as ReportingCurrency,

      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        case $parameters.P_RptgAmountIsInTransCrcy
          when 'X'
            then PurVATRateAggregatedAmt.TaxAmountInTransCrcy
          else PurVATRateAggregatedAmt.TaxAmountInCoCodeCrcy
        end as glo_tax_amount_rptg_crcy preserving type
      )                                     as TaxAmountInRptgCrcy,

      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        case $parameters.P_RptgAmountIsInTransCrcy
          when 'X'
            then PurVATRateAggregatedAmt.TaxBaseAmountInTransCrcy
          else PurVATRateAggregatedAmt.TaxBaseAmountInCoCodeCrcy
        end as glo_taxbase_amount_rptg_crcy preserving type
      )                                     as TaxBaseAmountInRptgCrcy,

      NumberOfVATRates.NmbrOfVATRates,
      JournalEntry._OneTimeAccountBP
}
// considers the lines with taxes or lines with zero vat but without additional tax lines (<>zero)

where PurVATRateAggregatedAmt.TaxRate <> '0.00' or
    ( PurVATRateAggregatedAmt.TaxRate = '0.00' and ( NumberOfVATRates.NmbrOfVATRates = 0 or NumberOfVATRates.NmbrOfVATRates is null ) )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_AR_JOURNALENTRY",
"P_AR_NUMBEROFVATRATES",
"P_AR_PURVATRATEAGGREGATEDAMT2"
],
"ASSOCIATED":
[
"I_ONETIMEACCOUNTBP"
],
"BASE":
[
"P_AR_JOURNALENTRY"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/