P_SK_StRpVATCSTaxItem is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_StRpTaxItem) and exposes 33 fields with key fields ReportingCountry, CompanyCode, AccountingDocument, FiscalYear, TaxCode. It has 1 association to related views.
TxItem.ReportingCountry = _NonDcblTxItem.ReportingCountry and TxItem.CompanyCode = _NonDcblTxItem.CompanyCode and TxItem.AccountingDocument = _NonDcblTxItem.AccountingDocument and TxItem.FiscalYear = _NonDcblTxItem.FiscalYear and TxItem.TaxCode = _NonDcblTxItem.TaxCode and TxItem.TaxItemGroup = _NonDcblTxItem.TaxItemGroup and TxItem.DebitCreditCode = _NonDcblTxItem.DebitCreditCode and _NonDcblTxItem.TaxIsNotDeductible = 'X'
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view P_SK_StRpVATCSTaxItem.-- Reconstructed from parsed metadata (data sources, associations, fields).-- SAP annotations are omitted and the structure is reformulated as SQL;-- this is a functional approximation, not the verbatim SAP source. Some join-- conditions may be unavailable and a few CDS constructs are kept as-is.-- SQL view name: PSKSRVATCSTI-- Parameters: P_KeyDate : fiskvatc_valid_onCREATE VIEW P_SK_StRpVATCSTaxItem ASSELECT
TxItem.ReportingCountry AS ReportingCountry,
TxItem.CompanyCode AS CompanyCode,
TxItem.AccountingDocument AS AccountingDocument,
TxItem.FiscalYear AS FiscalYear,
TxItem.TaxCode AS TaxCode,
TxItem.TransactionTypeDetermination AS TransactionTypeDetermination,
TxItem.TaxReportingDate AS TaxReportingDate,
min (TxItem.TaxItem) AS TaxItem,
min (TxGroup.TaxGroup) AS TaxGroup,
min (casewhen TxItem.Customer <> '' then coalesce (TxItem._CustomerSupplierLineItem._OneTimeAccountBP.IsVATLiable, TxItem._CustomerSupplierLineItem._Customer.VATLiability) else '' end) as IsVATLiable AS VATLiabilityelseendasIsVATLiable,
min (TxItem.CustomerSupplierVATRegn) AS VATRegistration,
cast (min (TxItem._JournalEntry.JrnlEntryCntrySpecificRef4) as fisk_doc_num) AS InvoiceNumber,
cast (min (TxItem._JournalEntry.JrnlEntryCntrySpecificRef5) as fisk_ref_doc_num) AS ReferenceInvoiceNumber,
min (TxItem.TaxFulfillmentDate) AS TaxFulfillmentDate,
min (TxItem.ExchangeRate) AS ExchangeRate,
min (casewhen TxItem.TaxType = 'V' then TxItem.TaxRate + coalesce (_NonDcblTxItem.TaxRate, 0) else TxItem.TaxRate end) as TaxRate AS TaxRateendasTaxRate,
sum (TxItem.TaxBaseAmountInRptgCrcy) AS TaxBaseAmount,
sum (casewhen TxItem.TaxType = 'V' then TxItem.TaxAmountInRptgCrcy + coalesce (_NonDcblTxItem.TaxAmountInRptgCrcy, 0) else TxItem.TaxAmountInRptgCrcy end) as TaxAmount AS TaxAmountInRptgCrcyendasTaxAmount,
min (TxItem.ReportingCurrency) AS ReportingCurrency,
min (TxItem.IsReversal) AS IsReversal,
min (TxItem.IsReversed) AS IsReversed,
min (TxItem.SenderLogicalSystem) AS SenderLogicalSystem,
min (TxItem.OriginalReferenceDocument) AS OriginalReferenceDocument,
min (TxItem.ReferenceDocumentType) AS ReferenceDocumentType,
min (TxItem.DocumentReferenceID) AS DocumentReferenceID,
min (TxItem.TaxType) AS TaxType,
min (TxItem.DebitCreditCode) AS DebitCreditCode,
min (TxItem.Customer) AS Customer,
min (TxItem.Supplier) AS Supplier,
min (TxGroup.TaxBoxStrucValidityStartDate) AS TaxBoxStrucValidityStartDate,
min (TxGroup.TaxBoxStrucValidityEndDate) AS TaxBoxStrucValidityEndDate,
min (TxGroup.TaxRateValidityStartDate) AS TaxRateValidityStartDate,
min (TxGroup.TaxRateValidityEndDate) AS TaxRateValidityEndDate
FROM I_StRpTaxItem AS TxItem
LEFTOUTERJOIN I_StRpTaxItem AS _NonDcblTxItem ON TxItem.ReportingCountry = _NonDcblTxItem.ReportingCountry AND TxItem.CompanyCode = _NonDcblTxItem.CompanyCode AND TxItem.AccountingDocument = _NonDcblTxItem.AccountingDocument AND TxItem.FiscalYear = _NonDcblTxItem.FiscalYear AND TxItem.TaxCode = _NonDcblTxItem.TaxCode AND TxItem.TaxItemGroup = _NonDcblTxItem.TaxItemGroup AND TxItem.DebitCreditCode = _NonDcblTxItem.DebitCreditCode AND _NonDcblTxItem.TaxIsNotDeductible = 'X' -- association [0..1]
;