I_TAXITEM

CDS View

Tax Item

I_TAXITEM is a CDS View in S/4HANA. Tax Item. It contains 79 fields. 61 CDS views read from this table.

CDS Views using this table (61)

ViewTypeJoinVDMDescription
C_CA_StRpGSTItemCube view left_outer CONSUMPTION Canada GST Tax Item Details
C_CL_StRpSalesLedgerLog view_entity inner CONSUMPTION Chile Sales Ledger Log
C_IN_AcctgDocTaxItem view from CONSUMPTION Accounting Document Tax Item details
C_PE_StRpJournalEntryWithTax view inner CONSUMPTION Peru journal entries with tax
FAC_DART_Z3_JOURNAL_ENTRY view left_outer DART Z3 G/L Accounts-Line Items
FAC_DART_Z3_TAX_LINEITEM_BASE view from Tax - Line Items Base View
I_IN_EDocGSTPurRegTaxItem view_entity inner COMPOSITE India GST Purchase Register Tax Item
I_PL_SAFTGetDownPayAll view_entity inner COMPOSITE SAFT PL FA DonwPaymentAll
I_PL_SAFTGetDownPaymentHeader view_entity inner COMPOSITE SAF T PL Down Payment Header
I_PL_SAFTGetInvoiceHeader view_entity inner COMPOSITE SAFT PL FA Invoice Header
I_SAFTAccountingTaxCheck view from COMPOSITE SAF-T Accounting Tax Check
P_AR_StRpTaxJournalEntryItem view_entity from COMPOSITE Argentina Tax Journal Entry Item
P_AR_StRpVatPrcptnTaxItem view_entity from COMPOSITE AR SICORE VAT Perception
P_AR_TaxItem view from CONSUMPTION Private View for Argentina Tax Item
P_AUDIT_AT_BSET view_entity inner COMPOSITE Austrian Audit Journal Tax Data
P_BaseAmtForNegativeCharge view from COMPOSITE Private view to return Base Amount for Neg Charge
P_CL_PurJournalEntryTaxItem view_entity inner CONSUMPTION Chile Purchase Journal Entry Tax Item
P_CL_SalesJournalEntryTaxItem view_entity inner CONSUMPTION Sales Journal Entry Tax Item
P_CL_StRpJrnlEntryItemWithTax view_entity inner CONSUMPTION Journal Entry With Tax Log for Chilean Reports
P_CN_AcctStdInputVatAccDoc1 view_entity from COMPOSITE Input Vat Document
P_GB_APOpenItem view_entity from COMPOSITE GB VAT AP Unpaid Invoice
P_GB_AROpenItem view_entity inner COMPOSITE Great Britain AR Open items
P_HR_TaxItem view_entity from COMPOSITE OPZ STAT 1 Tax Item
P_HU_STRPINVOICECOUNTRY view from COMPOSITE Hungary VAT: Invoice Hierarchy
P_ID_StRpTaxItemBoxCube view inner COMPOSITE ID Tax Item Box Cube
P_KR_EDCJrnlEntrTxItm view_entity from COMPOSITE KR Cons. Checks- Tax Items
P_KR_TaxInvoice06 view from CONSUMPTION Help view for tax inovice South Korea
P_LU_SAFTDPZeroTaxLine view inner COMPOSITE SAFT LU Identify the Zero Line Tax
P_LU_SAFTTaxItem view from COMPOSITE SAFT LU Tax Item
P_LU_SAFTZeroTaxLine view inner COMPOSITE SAFT LU Identify the Zero Line Tax
P_ManageJournalEntryTaxItem view_entity from COMPOSITE Journal Entry Tax Item
P_NO_SAFTTaxAmountSum view_entity inner COMPOSITE SAFT Get Sum Tax Amount
P_NO_SAFTTaxAmountSum view_entity union COMPOSITE SAFT Get Sum Tax Amount
P_NO_SAFTTaxAmountSum view_entity from COMPOSITE SAFT Get Sum Tax Amount
P_NO_SAFTTaxSpGL view from COMPOSITE Tax Special GL
P_PE_PurDmstcSuplrTaxItem view inner CONSUMPTION Peru: Purchase Domestic Supplier Tax Item
P_PE_PurFrgnSuplrTaxItem view_entity from CONSUMPTION Purchase Ledger Foreign Tax Items
P_PE_SalesTaxItem view inner CONSUMPTION Sales Ledger Tax Item View for Peru
P_PL_SAFTGETACCOUNTINGINVCDATA view_entity inner COMPOSITE SAFT PL FA Accounting Invc Basic Data
P_PL_SAFTGetSalesInvoiceData view_entity inner COMPOSITE SAFT PL FA Sales Invoice Basic Data
P_RO_SAFTNTRPURINVWIAHEADER view_entity inner CONSUMPTION Purchase invoice WIA header
P_RO_SAFTNTRSLSINVWIAHEADER view_entity inner CONSUMPTION Sales invoice WIA header
P_RO_SAFTNTRTAXINFO view_entity from CONSUMPTION Purchase invoice items
P_RO_SAFTPurInvoiceItemTaxBase view_entity inner CONSUMPTION Sales Invoice Item Taxbase
P_RO_SAFTSlsInvoiceItemTaxBase view_entity inner CONSUMPTION Sales Invoice Item Taxbase
P_RU_CommissionTradeInvoice11 view_entity inner CONSUMPTION Comission Trade Invoices - Alternative 1
P_SAFTTaxAmountSum view from COMPOSITE SAFT Get Sum Tax Amount
P_SK_CABsetTaxItem view_entity from COMPOSITE CA related BSET items
P_SlsPurListBPTaxItem20 view from CONSUMPTION Sales Purchase List BP Tax Item (Helper)
P_StRpBPTaxItem2 view from COMPOSITE Business Partner Tax Item (Tax Item Branch 1)
P_StRpTaxItemDebitCredit view_entity from COMPOSITE Tax Item for Statutory Reporting (Auxiliary View)
P_StRpTaxItmWithEUTaxClass3 view from COMPOSITE EU Sales tax Item View for Statutory Reporting
P_TH_TaxCodeRate2 view from COMPOSITE Get rate for tax item for TH
P_TW_AcctgDocLeadingTaxCode view_entity inner COMPOSITE Accounting Document Leading Tax Code
P_TW_LeadingTaxItem view_entity union_all COMPOSITE TW Leading Tax Item in a FI document
P_TW_TaxItemConsume view from CONSUMPTION Private Consumption View for TAX ITEM
P_TW_TaxItemLeadingTaxCode view_entity from COMPOSITE TW Tax Item with Leading Tax Code
P_TxDocStRpActy1 view inner COMPOSITE Tax Document Reporting Activity
P_UA_TaxItemReasonCode view_entity from COMPOSITE Private view to fetch reason codes
R_ES_EDCSalesInvoiceSIITaxItem view_entity inner COMPOSITE Spain SII Customer Inv TaxLines
R_ES_EDCSuplrInvcSIITaxLine view_entity inner COMPOSITE Spain Supplier Invoice Tax lines

Fields (79)

KeyField CDS FieldsUsed in Views
KEY AccountingDocument AccountingDocument,belnr 23
KEY CompanyCode bukrs,CompanyCode 22
KEY FiscalYear FiscalYear,gjahr 20
KEY TaxCode mwskz,TaxCode 23
KEY TaxItem buzei,TaxItem 18
KEY TaxItemAcctgDocItemRef TaxItemAcctgDocItemRef,taxps 5
KEY TaxItemUUID TaxItemUUID 2
KEY TransactionTypeDetermination ktosl,TransactionTypeDetermination 16
_CompanyCodeCountry _CompanyCodeCountry 1
_CompanyCodeCurrency _CompanyCodeCurrency 1
_GLAccount _GLAccount 1
_JournalEntry _JournalEntry 1
_ReceivablesPayablesItem _ReceivablesPayablesItem 1
_TaxJurisdiction _TaxJurisdiction 1
AccountingDocumentCategory AccountingDocumentCategory 1
AccountingDocumentHeaderText AccountingDocumentHeaderText 1
AccountingDocumentType AccountingDocumentType 1
AdditionalCurrency1 AdditionalCurrency1 4
AdditionalCurrency2 AdditionalCurrency2 4
BusinessPlace BusinessPlace 4
CompanyCodeCountry CompanyCodeCountry,Country 5
CompanyCodeCurrency CompanyCodeCurrency 9
ConditionRecord ConditionRecord 1
ConditionType ConditionType 5
CountryCurrency CountryCurrency 6
DebitCreditCode DebitCreditCode,DebitCreditCodeCalc,shkzg,TaxDebitCreditCode 9
DestinationCountry DestinationCountry,egbld 2
DocumentCurrency DocumentCurrency,TransactionCurrency 7
DocumentDate DocumentDate 1
DocumentReferenceID DocumentReferenceID 1
ExchangeRate ExchangeRate 1
FiscalPeriod FiscalPeriod 1
GLAccount ActiveGLAccount,GLAccount,hkont 7
IsReversal IsReversal 1
IsReversed IsReversed 1
Ledger Ledger 1
LedgerGroup LedgerGroup 1
LowestLevelTaxJurisdiction LowestLevelTaxJurisdiction 3
OriginalReferenceDocument OriginalReferenceDocument 1
PostingDate PostingDate 1
ReferenceDocumentType ReferenceDocumentType 1
ReportingCountry ReportingCountry 1
ReportingCurrency ReportingCurrency 1
ReportingDate ReportingDate 1
ReverseDocument ReverseDocument 1
ReverseDocumentFiscalYear ReverseDocumentFiscalYear 1
SenderAccountingDocument SenderAccountingDocument 1
SenderCompanyCode SenderCompanyCode 1
SenderFiscalYear SenderFiscalYear 1
SenderLogicalSystem SenderLogicalSystem 1
SupplyingCountry eglld,SupplyingCountry 2
TaxAmount TaxAmount 5
TaxAmountInAdditionalCurrency1 TaxAmountInAdditionalCurrency1 3
TaxAmountInAdditionalCurrency2 TaxAmountInAdditionalCurrency2 3
TaxAmountInCoCodeCrcy TaxAmountInCoCodeCrcy 7
TaxAmountInCountryCrcy TaxAmountInCountryCrcy 3
TaxBaseAmountInCoCodeCrcy TaxBaseAmountInCoCodeCrcy 6
TaxBaseAmountInCountryCrcy TaxBaseAmountInCountryCrcy 4
TaxBaseAmountInTransCrcy TaxBaseAmountInTransCrcy 5
TaxBaseAmtInAdditionalCrcy1 TaxBaseAmtInAdditionalCrcy1 2
TaxBaseAmtInAdditionalCrcy2 TaxBaseAmtInAdditionalCrcy2 2
TaxCalculationProcedure TaxCalculationProcedure 1
TaxCodeIsLeading TaxCodeIsLeading 1
TaxCountry ReportingCountry,TaxCountry 5
TaxDataSource TaxDataSource 3
TaxDeterminationDate TaxDeterminationDate 1
TaxFulfillmentDate TaxFulfillmentDate 1
TaxItemGroup TaxItemGroup 5
TaxItemIsExternal TaxItemIsExternal 1
TaxJurisdiction TaxJurisdiction 5
TaxJurisdictionLevel TaxJurisdictionLevel 1
TaxRate kbetr,TaxRate 7
TaxRateValidityStartDate TaxRateValidityStartDate 3
TaxReportingDate mlddt,TaxReportingDate 4
TaxReportingDocumentDate TaxReportingDocumentDate 1
TaxResultManualModification TaxResultManualModification 1
TaxReturnCountry TaxReturnCountry 6
TaxReturnDate TaxReturnDate 1
VATRegistration stceg,VATRegistration 2
//Documentation about annotations can be found at http://help.sap.com searching for CDS annotations //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.sizeCategory: #XL //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.serviceQuality: #C //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.dataClass: #MIXED //Inserted by VDM CDS Suite Plugin

@AccessControl.authorizationCheck: #CHECK
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Tax Item'
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.sqlViewName: 'IFITAXITEM'
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API


define view I_TaxItem
  as select from P_Bset   as Taxitem

  association  [0..1] to I_CompanyCode as _CompanyCode                            on $projection.CompanyCode = _CompanyCode.CompanyCode


  association [0..1] to I_JournalEntry            as _JournalEntry                on  $projection.AccountingDocument      = _JournalEntry.AccountingDocument
                                                                                  and $projection.CompanyCode             = _JournalEntry.CompanyCode
                                                                                  and $projection.FiscalYear              = _JournalEntry.FiscalYear
  
  association [0..1] to I_AccountingDocument      as _AccountingDocument          on  $projection.CompanyCode        = _AccountingDocument.CompanyCode
                                                                                  and $projection.AccountingDocument = _AccountingDocument.AccountingDocument
                                                                                  and $projection.FiscalYear         = _AccountingDocument.FiscalYear



  association [0..1] to I_GLAccount               as _GLAccount                   on  $projection.GLAccount   = _GLAccount.GLAccount
                                                                                  and $projection.CompanyCode = _GLAccount.CompanyCode

  association [0..1] to I_Country                 as _CompanyCodeCountry          on  $projection.CompanyCodeCountry = _CompanyCodeCountry.Country

  association [0..1] to I_Country                 as _TaxReturnCountry            on  $projection.TaxReturnCountry = _TaxReturnCountry.Country
  
  association [0..1] to I_Country                 as _TaxCountry                  on  $projection.TaxCountry = _TaxCountry.Country

  association [0..*] to I_TaxJurisdiction         as _TaxJurisdiction             on  $projection.TaxJurisdiction = _TaxJurisdiction.TaxJurisdiction

  association [0..1] to I_Currency                as _CompanyCodeCurrency         on  $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency

  association [0..1] to I_Currency                as _DocumentCurrency            on  $projection.DocumentCurrency = _DocumentCurrency.Currency

  association [0..1] to I_Currency                as _DocumentAdditionalCurrency1 on  $projection.AdditionalCurrency1 = _DocumentAdditionalCurrency1.Currency

  association [0..1] to I_Currency                as _DocumentAdditionalCurrency2 on  $projection.AdditionalCurrency2 = _DocumentAdditionalCurrency2.Currency

  association [0..*] to I_OperationalAcctgDocItem as _DebtorCreditorRblsPyblsItem on  $projection.CompanyCode        = _DebtorCreditorRblsPyblsItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _DebtorCreditorRblsPyblsItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _DebtorCreditorRblsPyblsItem.AccountingDocument
                                                                                  and (
     $projection.TaxCode                                                                                             = _DebtorCreditorRblsPyblsItem.TaxCode
     or _DebtorCreditorRblsPyblsItem.TaxCode                                                                         = '**'
     or _DebtorCreditorRblsPyblsItem.TaxCode                                                                         = ''
   )
  and $projection.TaxCountry                                                                                         = _DebtorCreditorRblsPyblsItem.TaxCountry
  and $projection.TaxJurisdiction                                                                                    = _DebtorCreditorRblsPyblsItem.TaxJurisdiction
  and(
    _DebtorCreditorRblsPyblsItem.FinancialAccountType                                                                = 'D'
    or _DebtorCreditorRblsPyblsItem.FinancialAccountType                                                             = 'K'
  )
  
  association [0..*] to I_OperationalAcctgDocItem as _TaxReceivablesPayablesItem  on  $projection.CompanyCode        = _TaxReceivablesPayablesItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _TaxReceivablesPayablesItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _TaxReceivablesPayablesItem.AccountingDocument
                                                                                  and $projection.TaxItemGroup       = _TaxReceivablesPayablesItem.TaxItemGroup
                                                                                  and $projection.TaxCode            = _TaxReceivablesPayablesItem.TaxCode
                                                                                  and $projection.TaxCountry         = _TaxReceivablesPayablesItem.TaxCountry
                                                                                  and $projection.TaxJurisdiction    = _TaxReceivablesPayablesItem.TaxJurisdiction
                                                                                  and (
     _TaxReceivablesPayablesItem.TaxType                                                                             = 'A'
     or _TaxReceivablesPayablesItem.TaxType                                                                          = 'V'
   )

  association [0..*] to I_OperationalAcctgDocItem as _ReceivablesPayablesItem     on  $projection.CompanyCode        = _ReceivablesPayablesItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _ReceivablesPayablesItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _ReceivablesPayablesItem.AccountingDocument

{

      //@ObjectModel.foreignKey.association: '_CompanyCode'  //TODO required by VDM check, but inner join -><- association to be clarified

  key Taxitem.CompanyCode,
  key AccountingDocument,
  key FiscalYear,
  key TaxItem,
  key hextobin('00000000000000000000000000000000') as TaxItemUUID,  
      TaxCode,
      //@ObjectModel.foreignKey.association: '_GLAccount' //Inserted by VDM CDS Suite Plugin => Implies also FK asoc for _CompanyCode

      GLAccount,
      TaxItemGroup,
      //DebitCreditCode,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      TaxBaseAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      TaxBaseAmountInTransCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      TaxAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      TaxAmount,
      TransactionTypeDetermination,
      ConditionRecord,
      Taxitem.VATRegistration                  as VATRegistration,
      DestinationCountry,
      SupplyingCountry,
      // @ObjectModel.foreignKey.association: '_TaxJurisdiction' //Inserted by VDM CDS Suite Plugin  // Key KALSM missing [0..*]!

      TaxJurisdiction,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      TaxAmountInAdditionalCurrency1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      TaxAmountInAdditionalCurrency2,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      TaxBaseAmtInAdditionalCrcy1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      TaxBaseAmtInAdditionalCrcy2,
      ConditionType,
      TaxReturnDate,
      cast( TaxReturnExecutionTime as glo_fi_bset_stmti) as TaxReturnExecutionTime,
      TaxReportingDate,
      --@Semantics.amount.currencyCode: 'CountryCurrency'
      cast ( TaxRate as fitaxrate ) as TaxRate,
      //STBKZ as PostingIndicator,   // !!! New global field name!

      TaxReturnCountry,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxAmountInCountryCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxBaseAmountInCountryCrcy,
      TaxDeterminationDate,
      BusinessPlace,
      LowestLevelTaxJurisdiction,
      TaxJurisdictionLevel,
      TaxItemAcctgDocItemRef  ,
      TaxResultManualModification,
      DebitCreditCode,
      TaxRateValidityStartDate,
      TaxCountry,
      @Semantics.currencyCode:true
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency' //Inserted by VDM CDS Suite Plugin

      _CompanyCode.Currency                    as CompanyCodeCurrency,
      @ObjectModel.foreignKey.association: '_CompanyCodeCountry' //Inserted by VDM CDS Suite Plugin

      _CompanyCode.Country                     as CompanyCodeCountry,
      @Semantics.currencyCode:true
      _JournalEntry.TransactionCurrency            as DocumentCurrency,
      @Semantics.currencyCode:true
      _JournalEntry.AdditionalCurrency1 as AdditionalCurrency1,
      @Semantics.currencyCode:true
      _JournalEntry.AdditionalCurrency2 as AdditionalCurrency2,
      @Semantics.currencyCode:true
      case 
      when TaxCountry <> '' then _TaxCountry.CountryCurrency 
      when TaxReturnCountry <> '' then _TaxReturnCountry.CountryCurrency 
      end  as CountryCurrency,
      '1' as TaxDataSource,
      _JournalEntry,
      
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: '_JournalEntry'
      _AccountingDocument,
      _CompanyCode._Currency                  as _Currency,
      _GLAccount,
      _CompanyCodeCurrency,
      _CompanyCodeCountry,
      _TaxJurisdiction,
      _DebtorCreditorRblsPyblsItem,
      _TaxReceivablesPayablesItem,
      _ReceivablesPayablesItem,
      _TaxReturnCountry,
      _TaxCountry


}
union all 
select from I_IndirectTaxItem as TaxItem2 
  inner join I_TaxRegisterActiveTaxCountry on  TaxItem2.TaxCountry = I_TaxRegisterActiveTaxCountry.TaxCountry
                                           and TaxItem2.TaxationType = 'VAT'
  
  association  [0..1] to I_CompanyCode as _CompanyCode                            on $projection.CompanyCode = _CompanyCode.CompanyCode


  association [0..1] to I_JournalEntry            as _JournalEntry                on  $projection.AccountingDocument      = _JournalEntry.AccountingDocument
                                                                                  and $projection.CompanyCode             = _JournalEntry.CompanyCode
                                                                                  and $projection.FiscalYear              = _JournalEntry.FiscalYear
  
  association [0..1] to I_AccountingDocument      as _AccountingDocument          on  $projection.CompanyCode        = _AccountingDocument.CompanyCode
                                                                                  and $projection.AccountingDocument = _AccountingDocument.AccountingDocument
                                                                                  and $projection.FiscalYear         = _AccountingDocument.FiscalYear



  association [0..1] to I_GLAccount               as _GLAccount                   on  $projection.GLAccount   = _GLAccount.GLAccount
                                                                                  and $projection.CompanyCode = _GLAccount.CompanyCode

  association [0..1] to I_Country                 as _CompanyCodeCountry          on  $projection.CompanyCodeCountry = _CompanyCodeCountry.Country

  association [0..1] to I_Country                 as _TaxReturnCountry            on  $projection.TaxReturnCountry = _TaxReturnCountry.Country
  
  association [0..1] to I_Country                 as _TaxCountry                  on  $projection.TaxCountry = _TaxCountry.Country

  association [0..*] to I_TaxJurisdiction         as _TaxJurisdiction             on  $projection.TaxJurisdiction = _TaxJurisdiction.TaxJurisdiction

  association [0..1] to I_Currency                as _CompanyCodeCurrency         on  $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency

  association [0..1] to I_Currency                as _DocumentCurrency            on  $projection.DocumentCurrency = _DocumentCurrency.Currency

  association [0..1] to I_Currency                as _DocumentAdditionalCurrency1 on  $projection.AdditionalCurrency1 = _DocumentAdditionalCurrency1.Currency

  association [0..1] to I_Currency                as _DocumentAdditionalCurrency2 on  $projection.AdditionalCurrency2 = _DocumentAdditionalCurrency2.Currency

  association [0..*] to I_OperationalAcctgDocItem as _DebtorCreditorRblsPyblsItem on  $projection.CompanyCode        = _DebtorCreditorRblsPyblsItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _DebtorCreditorRblsPyblsItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _DebtorCreditorRblsPyblsItem.AccountingDocument
                                                                                  and (
     $projection.TaxCode                                                                                             = _DebtorCreditorRblsPyblsItem.TaxCode
     or _DebtorCreditorRblsPyblsItem.TaxCode                                                                         = '**'
     or _DebtorCreditorRblsPyblsItem.TaxCode                                                                         = ''
   )
  and $projection.TaxCountry                                                                                         = _DebtorCreditorRblsPyblsItem.TaxCountry
  and $projection.TaxJurisdiction                                                                                    = _DebtorCreditorRblsPyblsItem.TaxJurisdiction
  and(
    _DebtorCreditorRblsPyblsItem.FinancialAccountType                                                                = 'D'
    or _DebtorCreditorRblsPyblsItem.FinancialAccountType                                                             = 'K'
  )
  
  association [0..*] to I_OperationalAcctgDocItem as _TaxReceivablesPayablesItem  on  $projection.CompanyCode        = _TaxReceivablesPayablesItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _TaxReceivablesPayablesItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _TaxReceivablesPayablesItem.AccountingDocument
                                                                                  and $projection.TaxItemGroup       = _TaxReceivablesPayablesItem.TaxItemGroup
                                                                                  and $projection.TaxCode            = _TaxReceivablesPayablesItem.TaxCode
                                                                                  and $projection.TaxCountry         = _TaxReceivablesPayablesItem.TaxCountry
                                                                                  and $projection.TaxJurisdiction    = _TaxReceivablesPayablesItem.TaxJurisdiction
                                                                                  and (
     _TaxReceivablesPayablesItem.TaxType                                                                             = 'A'
     or _TaxReceivablesPayablesItem.TaxType                                                                          = 'V'
   )

  association [0..*] to I_OperationalAcctgDocItem as _ReceivablesPayablesItem     on  $projection.CompanyCode        = _ReceivablesPayablesItem.CompanyCode
                                                                                  and $projection.FiscalYear         = _ReceivablesPayablesItem.FiscalYear
                                                                                  and $projection.AccountingDocument = _ReceivablesPayablesItem.AccountingDocument

{
  key TaxItem2.CompanyCode,
  key TaxItem2.AccountingDocument,
  key TaxItem2.FiscalYear,
  key '000' as TaxItem,
  key TaxItem2.TaxItemUUID,  
      TaxItem2.TaxCode,
      //@ObjectModel.foreignKey.association: '_GLAccount' //Inserted by VDM CDS Suite Plugin => Implies also FK asoc for _CompanyCode

      TaxItem2.GLAccount,
      TaxItem2.TaxItemGroup,
      //DebitCreditCode,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      TaxItem2.TaxBaseAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      TaxItem2.TaxBaseAmountInTransCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      TaxItem2.TaxAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      TaxItem2.TaxAmountInTransCrcy as TaxAmount,
      TaxItem2.TransactionTypeDetermination,
      '' as ConditionRecord,
      '' as VATRegistration,
      '' as DestinationCountry,
      '' as SupplyingCountry,
      // @ObjectModel.foreignKey.association: '_TaxJurisdiction' //Inserted by VDM CDS Suite Plugin  // Key KALSM missing [0..*]!

      '' as TaxJurisdiction,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      cast('0' as h2ste ) as TaxAmountInAdditionalCurrency1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      cast('0' as h3ste ) as TaxAmountInAdditionalCurrency2,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      cast('0' as h3ste ) as TaxBaseAmtInAdditionalCrcy1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      cast('0' as h3ste ) as TaxBaseAmtInAdditionalCrcy2,
      TaxItem2.ConditionType,
      '' as TaxReturnDate,
      '' as TaxReturnExecutionTime,
      TaxItem2.TaxReportingDate,
      --@Semantics.amount.currencyCode: 'CountryCurrency'
      TaxItem2.TaxRateInPercent  as TaxRate,
      //STBKZ as PostingIndicator,   // !!! New global field name!

      TaxItem2.TaxCountry as TaxReturnCountry,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxItem2.TaxAmountInRptgCrcy as TaxAmountInCountryCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxItem2.TaxBaseAmountInRptgCrcy as TaxBaseAmountInCountryCrcy,
      TaxItem2.TaxReportingDate as TaxDeterminationDate,
      '' as BusinessPlace,// not available in tax register in first release

      '' as LowestLevelTaxJurisdiction,
      '' as TaxJurisdictionLevel,
      cast('000000' as tax_posnr ) as TaxItemAcctgDocItemRef  ,
      cast('0' as tax_mod ) as TaxResultManualModification,
      TaxItem2.DebitCreditCode,
      TaxRateValidityStartDate,
      TaxItem2.TaxCountry,
      @Semantics.currencyCode:true
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency' //Inserted by VDM CDS Suite Plugin

      _CompanyCode.Currency                    as CompanyCodeCurrency,
      @ObjectModel.foreignKey.association: '_CompanyCodeCountry' //Inserted by VDM CDS Suite Plugin

      _CompanyCode.Country                     as CompanyCodeCountry,
      @Semantics.currencyCode:true
      _JournalEntry.TransactionCurrency            as DocumentCurrency,
      @Semantics.currencyCode:true
      _JournalEntry.AdditionalCurrency1 as AdditionalCurrency1,
      @Semantics.currencyCode:true
      _JournalEntry.AdditionalCurrency2 as AdditionalCurrency2,
      @Semantics.currencyCode:true
      TaxItem2.ReportingCurrency as CountryCurrency,
      '2' as TaxDataSource,
      _JournalEntry,
      
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: '_JournalEntry'
      _AccountingDocument,
      _CompanyCode._Currency                  as _Currency,
      _GLAccount,
      _CompanyCodeCurrency,
      _CompanyCodeCountry,
      _TaxJurisdiction,
      _DebtorCreditorRblsPyblsItem,
      _TaxReceivablesPayablesItem,
      _ReceivablesPayablesItem,
      _TaxReturnCountry,
      _TaxCountry

}
;