I_StRpTaxItemWithRefDocument

DDL: I_STRPTAXITEMWITHREFDOCUMENT SQL: ISRTXITMREFDOC Type: view COMPOSITE Package: GLO_FIN_VAT_MENA

Tax Items with Reference Documents

I_StRpTaxItemWithRefDocument is a Composite CDS View that provides data about "Tax Items with Reference Documents" in SAP S/4HANA. It reads from 1 data source (I_OperationalAcctgDocItem) and exposes 79 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, AccountingDocumentItem. It has 1 association to related views. Part of development package GLO_FIN_VAT_MENA.

Data Sources (1)

SourceAliasJoin Type
I_OperationalAcctgDocItem _DocItem left_outer

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_JournalEntry _JournalEntry $projection.CompanyCode = _JournalEntry.CompanyCode and $projection.ReferenceDocumentFiscalYear = _JournalEntry.FiscalYear and $projection.ReferenceDocumentNumber = _JournalEntry.AccountingDocument

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName ISRTXITMREFDOC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
EndUserText.label Tax Items with Reference Documents view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view

Fields (79)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_StRpTaxItem CompanyCode
KEY AccountingDocument I_StRpTaxItem AccountingDocument
KEY FiscalYear I_StRpTaxItem FiscalYear
KEY TaxItem I_StRpTaxItem TaxItem
KEY AccountingDocumentItem I_OperationalAcctgDocItem AccountingDocumentItem
KEY TaxCode I_StRpTaxItem TaxCode
KEY TransactionTypeDetermination I_StRpTaxItem TransactionTypeDetermination
DebitCreditCode I_StRpTaxItem DebitCreditCode
TaxRate I_StRpTaxItem TaxRate
GLAccount I_StRpTaxItem GLAccount
TaxItemGroup I_StRpTaxItem TaxItemGroup
BusinessPlace I_StRpTaxItem BusinessPlace
TaxJurisdiction I_StRpTaxItem TaxJurisdiction
LowestLevelTaxJurisdiction I_StRpTaxItem LowestLevelTaxJurisdiction
AccountingDocumentType I_StRpTaxItem AccountingDocumentType
ReferenceDocumentType I_StRpTaxItem ReferenceDocumentType
ReverseDocument I_StRpTaxItem ReverseDocument
ReverseDocumentFiscalYear I_StRpTaxItem ReverseDocumentFiscalYear
DocumentReferenceID I_StRpTaxItem DocumentReferenceID
ConditionType I_StRpTaxItem ConditionType
Ledger I_StRpTaxItem Ledger
LedgerGroup I_StRpTaxItem LedgerGroup
PostingDate I_StRpTaxItem PostingDate
DocumentDate I_StRpTaxItem DocumentDate
TaxReportingDate I_StRpTaxItem TaxReportingDate
FiscalPeriod I_StRpTaxItem FiscalPeriod
ExchangeRate I_StRpTaxItem ExchangeRate
IsReversal I_StRpTaxItem IsReversal
IsReversed I_StRpTaxItem IsReversed
AccountingDocumentHeaderText I_StRpTaxItem AccountingDocumentHeaderText
CompanyCodeCountry I_StRpTaxItem CompanyCodeCountry
ReportingCountry I_StRpTaxItem ReportingCountry
TaxReturnCountry I_StRpTaxItem TaxReturnCountry
ReportingDate I_StRpTaxItem ReportingDate
CompanyCodeCurrency I_StRpTaxItem CompanyCodeCurrency
CountryCurrency I_StRpTaxItem CountryCurrency
DocumentCurrency I_StRpTaxItem DocumentCurrency
ReportingCurrency I_StRpTaxItem ReportingCurrency
AdditionalCurrency1 I_StRpTaxItem AdditionalCurrency1
AdditionalCurrency2 I_StRpTaxItem AdditionalCurrency2
TaxBaseAmountInRptgCrcy I_StRpTaxItem TaxBaseAmountInRptgCrcy
TaxAmountInRptgCrcy I_StRpTaxItem TaxAmountInRptgCrcy
TaxBaseAmountInCoCodeCrcy I_StRpTaxItem TaxBaseAmountInCoCodeCrcy
TaxAmountInCoCodeCrcy I_StRpTaxItem TaxAmountInCoCodeCrcy
TaxBaseAmountInTransCrcy I_StRpTaxItem TaxBaseAmountInTransCrcy
TaxAmount I_StRpTaxItem TaxAmount
TaxBaseAmountInCountryCrcy I_StRpTaxItem TaxBaseAmountInCountryCrcy
TaxAmountInCountryCrcy I_StRpTaxItem TaxAmountInCountryCrcy
TaxBaseAmtInAdditionalCrcy1 I_StRpTaxItem TaxBaseAmtInAdditionalCrcy1
TaxBaseAmtInAdditionalCrcy2 I_StRpTaxItem TaxBaseAmtInAdditionalCrcy2
TaxAmountInAdditionalCurrency1 I_StRpTaxItem TaxAmountInAdditionalCurrency1
TaxAmountInAdditionalCurrency2 I_StRpTaxItem TaxAmountInAdditionalCurrency2
TaxType I_StRpTaxItem TaxType
TaxCalculationProcedure I_StRpTaxItem TaxCalculationProcedure
TargetTaxCode I_StRpTaxItem TargetTaxCode
EUTaxClassification I_StRpTaxItem EUTaxClassification
TaxNumber1 I_StRpTaxItem TaxNumber1
TaxNumber2 I_StRpTaxItem TaxNumber2
TaxNumber3 I_StRpTaxItem TaxNumber3
BusinessPartner I_StRpTaxItem BusinessPartner
BusinessPartnerName I_StRpTaxItem BusinessPartnerName
CustomerSupplierAddress I_StRpTaxItem CustomerSupplierAddress
TaxIsNotDeductible I_StRpTaxItem TaxIsNotDeductible
SupplierAccountGroup I_StRpTaxItem SupplierAccountGroup
MiniOneStopShopTxRptgCntry I_StRpTaxItem MiniOneStopShopTxRptgCntry
BillingDocument I_OperationalAcctgDocItem BillingDocument
FinancialAccountType I_OperationalAcctgDocItem FinancialAccountType
TaxCountry I_StRpTaxItem TaxCountry
_ReportingCurrency _ReportingCurrency
_AccountingDocument _AccountingDocument
_GLAccount _GLAccount
_TaxJurisdiction _TaxJurisdiction
_DebtorCreditorRblsPyblsItem _DebtorCreditorRblsPyblsItem
_ReceivablesPayablesItem _ReceivablesPayablesItem
_TaxReceivablesPayablesItem _TaxReceivablesPayablesItem
_TaxTypeText _TaxTypeText
_TaxCodeText _TaxCodeText
_ReportedItemsLog _ReportedItemsLog
_JournalEntry _JournalEntry
@AbapCatalog.sqlViewName: 'ISRTXITMREFDOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@EndUserText.label: 'Tax Items with Reference Documents'
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@Consumption.dbHints: ['USE_HEX_PLAN']
define view I_StRpTaxItemWithRefDocument as select distinct from I_StRpTaxItem
left outer join I_OperationalAcctgDocItem as _DocItem on _DocItem.CompanyCode = I_StRpTaxItem.CompanyCode
                                                and _DocItem.AccountingDocument = I_StRpTaxItem.AccountingDocument
                                                and _DocItem.FiscalYear = I_StRpTaxItem.FiscalYear
                                                and (_DocItem.FinancialAccountType = 'K' or _DocItem.FinancialAccountType = 'D')

association [1..1] to I_JournalEntry  as _JournalEntry                on  $projection.CompanyCode        = _JournalEntry.CompanyCode
                                                                      and $projection.ReferenceDocumentFiscalYear      = _JournalEntry.FiscalYear
                                                                      and $projection.ReferenceDocumentNumber = _JournalEntry.AccountingDocument

{
  key I_StRpTaxItem.CompanyCode,
  key I_StRpTaxItem.AccountingDocument,
  key I_StRpTaxItem.FiscalYear,
  //key I_StRpTaxItem.AccountingDocumentItem,

  key I_StRpTaxItem.TaxItem,
  key _DocItem.AccountingDocumentItem, //added this


     ///@ObjectModel.text.association: '_TaxCodeText'

  key I_StRpTaxItem.TaxCode,
  key I_StRpTaxItem.TransactionTypeDetermination,
      I_StRpTaxItem.DebitCreditCode,
      I_StRpTaxItem.TaxRate,
      I_StRpTaxItem.GLAccount,
      I_StRpTaxItem.TaxItemGroup,
      I_StRpTaxItem.BusinessPlace,
      I_StRpTaxItem.TaxJurisdiction,
      I_StRpTaxItem.LowestLevelTaxJurisdiction,
      I_StRpTaxItem.AccountingDocumentType,
      I_StRpTaxItem.ReferenceDocumentType,
      I_StRpTaxItem.ReverseDocument,
      I_StRpTaxItem.ReverseDocumentFiscalYear,
      I_StRpTaxItem.DocumentReferenceID,
      I_StRpTaxItem.ConditionType,
      I_StRpTaxItem.Ledger,
      I_StRpTaxItem.LedgerGroup,
      I_StRpTaxItem.PostingDate,
      I_StRpTaxItem.DocumentDate,
      I_StRpTaxItem.TaxReportingDate,
      I_StRpTaxItem.FiscalPeriod,
      @DefaultAggregation:#MIN
      I_StRpTaxItem.ExchangeRate,
      I_StRpTaxItem.IsReversal,
      I_StRpTaxItem.IsReversed,
      I_StRpTaxItem.AccountingDocumentHeaderText,
      I_StRpTaxItem.CompanyCodeCountry,
      I_StRpTaxItem.ReportingCountry,
      I_StRpTaxItem.TaxReturnCountry,
      I_StRpTaxItem.ReportingDate,
      @Semantics.currencyCode:true
      I_StRpTaxItem.CompanyCodeCurrency,
      @Semantics.currencyCode:true
      I_StRpTaxItem.CountryCurrency,
      @Semantics.currencyCode:true
      I_StRpTaxItem.DocumentCurrency,
      @Semantics.currencyCode:true
      I_StRpTaxItem.ReportingCurrency,
      @Semantics.currencyCode: true
      I_StRpTaxItem.AdditionalCurrency1,
      @Semantics.currencyCode: true
      I_StRpTaxItem.AdditionalCurrency2,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      I_StRpTaxItem.TaxBaseAmountInRptgCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      I_StRpTaxItem.TaxAmountInRptgCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      I_StRpTaxItem.TaxBaseAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      I_StRpTaxItem.TaxAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      I_StRpTaxItem.TaxBaseAmountInTransCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      I_StRpTaxItem.TaxAmount,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      I_StRpTaxItem.TaxBaseAmountInCountryCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      I_StRpTaxItem.TaxAmountInCountryCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      I_StRpTaxItem.TaxBaseAmtInAdditionalCrcy1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      I_StRpTaxItem.TaxBaseAmtInAdditionalCrcy2,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      I_StRpTaxItem.TaxAmountInAdditionalCurrency1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      I_StRpTaxItem.TaxAmountInAdditionalCurrency2,
      @ObjectModel.text.association: '_TaxTypeText'
      I_StRpTaxItem.TaxType,
      I_StRpTaxItem.TaxCalculationProcedure,
      I_StRpTaxItem.TargetTaxCode,
      I_StRpTaxItem.EUTaxClassification,
      I_StRpTaxItem.TaxNumber1,
      I_StRpTaxItem.TaxNumber2,
      I_StRpTaxItem.TaxNumber3,
      I_StRpTaxItem.BusinessPartner,
      I_StRpTaxItem.BusinessPartnerName,
      I_StRpTaxItem.CustomerSupplierAddress,
      I_StRpTaxItem.TaxIsNotDeductible,
      I_StRpTaxItem.SupplierAccountGroup,
      I_StRpTaxItem.MiniOneStopShopTxRptgCntry,

// Begin of code related to Adjustment documents

      case
          when _DocItem.InvoiceReference <> ''
                    then _DocItem.InvoiceReference
                else
                  case when I_StRpTaxItem.ReverseDocument <> ''
                    then I_StRpTaxItem.ReverseDocument
                  else ''
                  end
                  end as ReferenceDocumentNumber,
      case
          when _DocItem.InvoiceReference <> ''
                    then _DocItem.InvoiceReferenceFiscalYear
                else
                  case when I_StRpTaxItem.ReverseDocument <> ''
                    then I_StRpTaxItem.ReverseDocumentFiscalYear
                  else ''
                  end
      end as ReferenceDocumentFiscalYear,
       _DocItem.BillingDocument,
       _DocItem.FinancialAccountType,
// End of code related to Adjustment documents

      I_StRpTaxItem.TaxCountry,
      _ReportingCurrency,
      _AccountingDocument,
      _GLAccount,
      _TaxJurisdiction,
      _DebtorCreditorRblsPyblsItem,
      _ReceivablesPayablesItem,
      _TaxReceivablesPayablesItem,
      _TaxTypeText,
      _TaxCodeText,
      _ReportedItemsLog,
      _JournalEntry

}