P_ES_TaxReturnBoxATR

DDL: P_ES_TAXRETURNBOXATR SQL: PESTAXRETBOXATR Type: view CONSUMPTION

P_ES_TaxReturnBoxATR is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_StRpTaxReturnBoxCube, P_T007B_GLO) and exposes 68 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, TaxCode.

Data Sources (2)

SourceAliasJoin Type
I_StRpTaxReturnBoxCube I_StRpTaxReturnBoxCube from
P_T007B_GLO P_T007B_GLO left_outer

Parameters (4)

NameTypeDefault
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id
P_ReportingCountry land1

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PESTAXRETBOXATR view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
AbapCatalog.preserveKey true view

Fields (68)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_StRpTaxReturnBoxCube CompanyCode
KEY AccountingDocument AccountingDocument
KEY FiscalYear FiscalYear
KEY TaxItem TaxItem
KEY TaxCode I_StRpTaxReturnBoxCube TaxCode
KEY TransactionTypeDetermination I_StRpTaxReturnBoxCube TransactionTypeDetermination
KEY TaxBox TaxBox
KEY TaxGroup TaxGroup
KEY Country I_StRpTaxReturnBoxCube Country
KEY TaxDeclnAmountType I_StRpTaxReturnBoxCube TaxDeclnAmountType
KEY UnifiedTaxBoxStructureType I_StRpTaxReturnBoxCube UnifiedTaxBoxStructureType
KEY ValidFrom ValidFrom
KEY StatryRptgEntity StatryRptgEntity
KEY StatryRptCategory StatryRptCategory
KEY StatryRptRunID StatryRptRunID
StatryRptRun I_StRpTaxReturnBoxCube StatryRptRun
TaxItemGroupingVersion TaxItemGroupingVersion
TaxBoxStructureType TaxBoxStructureType
ValidTo ValidTo
DebitCreditCode I_StRpTaxReturnBoxCube DebitCreditCode
TaxCalculationProcedure TaxCalculationProcedure
TaxRate TaxRate
TaxRateValidityStartDate I_StRpTaxReturnBoxCube TaxRateValidityStartDate
GLAccount GLAccount
TaxItemGroup TaxItemGroup
BusinessPlace BusinessPlace
TaxJurisdiction TaxJurisdiction
LowestLevelTaxJurisdiction LowestLevelTaxJurisdiction
AccountingDocumentType I_StRpTaxReturnBoxCube AccountingDocumentType
ReferenceDocumentType ReferenceDocumentType
CAReconciliationKey I_StRpTaxReturnBoxCube CAReconciliationKey
ReverseDocument ReverseDocument
ReverseDocumentFiscalYear ReverseDocumentFiscalYear
DocumentReferenceID DocumentReferenceID
Ledger Ledger
LedgerGroup LedgerGroup
PostingDate PostingDate
DocumentDate DocumentDate
TaxReportingDate TaxReportingDate
ReportingDate ReportingDate
TaxType TaxType
IsReversal IsReversal
IsReversed IsReversed
FiscalPeriod FiscalPeriod
ExchangeRate ExchangeRate
AccountingDocumentHeaderText AccountingDocumentHeaderText
CompanyCodeCountry CompanyCodeCountry
ReportingCountry ReportingCountry
TaxReturnCountry TaxReturnCountry
CompanyCodeCurrency CompanyCodeCurrency
CountryCurrency CountryCurrency
DocumentCurrency DocumentCurrency
ReportingCurrency ReportingCurrency
AdditionalCurrency1 AdditionalCurrency1
AdditionalCurrency2 AdditionalCurrency2
TargetTaxCode TargetTaxCode
TaxNumber1 TaxNumber1
TaxNumber2 TaxNumber2
TaxNumber3 TaxNumber3
BusinessPartner BusinessPartner
BusinessPartnerName BusinessPartnerName
BusinessPartnerCountry I_StRpTaxReturnBoxCube BusinessPartnerCountry
CustomerSupplierAddress CustomerSupplierAddress
TaxIsNotDeductible TaxIsNotDeductible
TaxBoxStructure TaxBoxStructure
TaxBoxName TaxBoxName
TaxBoxAggregationOperation TaxBoxAggregationOperation
TaxCountry I_StRpTaxReturnBoxCube TaxCountry
@AbapCatalog.sqlViewName: 'PESTAXRETBOXATR'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass: #MIXED
@AbapCatalog.preserveKey: true

define view P_ES_TaxReturnBoxATR
  with parameters
    P_StatryRptgEntity  : srf_reporting_entity,
    P_StatryRptCategory : srf_rep_cat_id,
    P_StatryRptRunID    : srf_report_run_id,
    P_ReportingCountry  : land1
  as select from    I_StRpTaxReturnBoxCube( P_TaxIsDeferredRelevant : 'N',
                                            P_TaxIsMossRelevant     : 'N',
                                            P_StatryRptgEntity      : $parameters.P_StatryRptgEntity ,
                                            P_StatryRptCategory     : $parameters.P_StatryRptCategory,
                                            P_StatryRptRunID        : $parameters.P_StatryRptRunID,
                                            P_ReportingCountry      : $parameters.P_ReportingCountry,
                                            P_TaxBoxConfiguration   : '2' // 1 = T007* 2 = VG_CUST 3 = T007* and VG_CUST

                                           )
    left outer join P_T007B_GLO                                                    on P_T007B_GLO.ktosl = I_StRpTaxReturnBoxCube.TransactionTypeDetermination
{
  key I_StRpTaxReturnBoxCube.CompanyCode,
  key AccountingDocument,
  key FiscalYear,
  key TaxItem,

  key I_StRpTaxReturnBoxCube.TaxCode,
  key I_StRpTaxReturnBoxCube.TransactionTypeDetermination,
  key TaxBox,
  key TaxGroup,
  key I_StRpTaxReturnBoxCube.Country,
  key I_StRpTaxReturnBoxCube.TaxDeclnAmountType,
  key I_StRpTaxReturnBoxCube.UnifiedTaxBoxStructureType,
  key ValidFrom,

  key StatryRptgEntity,
  key StatryRptCategory,
  key StatryRptRunID,
  
      I_StRpTaxReturnBoxCube.StatryRptRun,

      TaxItemGroupingVersion,
      TaxBoxStructureType,
      ValidTo,
      I_StRpTaxReturnBoxCube.DebitCreditCode,
      TaxCalculationProcedure,
      TaxRate,

      I_StRpTaxReturnBoxCube.TaxRateValidityStartDate,
      GLAccount,
      TaxItemGroup,
      BusinessPlace,
      TaxJurisdiction,
      LowestLevelTaxJurisdiction,
      I_StRpTaxReturnBoxCube.AccountingDocumentType,
      ReferenceDocumentType,
      I_StRpTaxReturnBoxCube.CAReconciliationKey,
      ReverseDocument,
      ReverseDocumentFiscalYear,
      DocumentReferenceID,
      Ledger,
      LedgerGroup,
      PostingDate,
      DocumentDate,
      TaxReportingDate,
      ReportingDate,

      TaxType,
      IsReversal,
      IsReversed,

      FiscalPeriod,
      ExchangeRate,
      AccountingDocumentHeaderText,
      CompanyCodeCountry,
      ReportingCountry,
      TaxReturnCountry,

      CompanyCodeCurrency,
      CountryCurrency,
      DocumentCurrency,
      ReportingCurrency,
      AdditionalCurrency1,
      AdditionalCurrency2,

      @Semantics.amount.currencyCode: 'ReportingCurrency'
      case P_T007B_GLO.stgrp
        when '2' then AmountInReportingCurrency
        else -AmountInReportingCurrency
      end as AmountInReportingCurrency,
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      case P_T007B_GLO.stgrp
        when '2' then AmountInTransactionCurrency
        else -AmountInTransactionCurrency
      end as AmountInTransactionCurrency,

      @Semantics.amount.currencyCode: 'ReportingCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmountInRptgCrcy
        else -TaxBaseAmountInRptgCrcy
      end as TaxBaseAmountInRptgCrcy,
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmountInRptgCrcy
        else -TaxAmountInRptgCrcy
      end as TaxAmountInRptgCrcy,

      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmountInCoCodeCrcy
        else -TaxBaseAmountInCoCodeCrcy
      end as TaxBaseAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmountInCoCodeCrcy
        else -TaxAmountInCoCodeCrcy
      end as TaxAmountInCoCodeCrcy,

      @Semantics.amount.currencyCode: 'DocumentCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmountInTransCrcy
        else -TaxBaseAmountInTransCrcy
      end as TaxBaseAmountInTransCrcy,
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmount
        else -TaxAmount
      end as TaxAmount,

      @Semantics.amount.currencyCode: 'CountryCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmountInCountryCrcy
        else -TaxBaseAmountInCountryCrcy
      end as TaxBaseAmountInCountryCrcy,
      @Semantics.amount.currencyCode: 'CountryCurrency'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmountInCountryCrcy
        else -TaxAmountInCountryCrcy
      end as TaxAmountInCountryCrcy,

      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmtInAdditionalCrcy1
        else -TaxBaseAmtInAdditionalCrcy1
      end as TaxBaseAmtInAdditionalCrcy1,
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmountInAdditionalCurrency1
        else -TaxAmountInAdditionalCurrency1
      end as TaxAmountInAdditionalCurrency1,

      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      case P_T007B_GLO.stgrp
        when '2' then TaxBaseAmtInAdditionalCrcy2
        else -TaxBaseAmtInAdditionalCrcy2
      end as TaxBaseAmtInAdditionalCrcy2,
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      case P_T007B_GLO.stgrp
        when '2' then TaxAmountInAdditionalCurrency2
        else -TaxAmountInAdditionalCurrency2
      end as TaxAmountInAdditionalCurrency2,

      TargetTaxCode,
      TaxNumber1,
      TaxNumber2,
      TaxNumber3,

      BusinessPartner,
      BusinessPartnerName,
      I_StRpTaxReturnBoxCube.BusinessPartnerCountry,
      CustomerSupplierAddress,
      TaxIsNotDeductible,

      TaxBoxStructure,
      TaxBoxName,
      TaxBoxAggregationOperation,
      I_StRpTaxReturnBoxCube.TaxCountry
}
where
  IsVATRelevant = 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_STRPTAXRETURNBOXCUBE",
"P_T007B_GLO"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/