I_TaxDocumentStRpActivity is a Composite CDS View that provides data about "Tax Document Reporting Activity" in SAP S/4HANA. It has 2 associations to related views.
TaxItem.CompanyCode = _CustomerSupplierLineItem.CompanyCode and TaxItem.AccountingDocument = _CustomerSupplierLineItem.AccountingDocument and TaxItem.FiscalYear = _CustomerSupplierLineItem.FiscalYear and _CustomerSupplierLineItem.ReportingDate between $parameters.P_TaxReportingFromDate and $parameters.P_TaxReportingToDate and ( _CustomerSupplierLineItem.FinancialAccountType = 'D' or _CustomerSupplierLineItem.FinancialAccountType = 'K' )
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 I_TaxDocumentStRpActivity.-- 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: ISTRPTAXDOCACTVT-- Parameters: P_TaxReportingFromDate : vatdate, P_TaxReportingToDate : vatdateCREATE VIEW I_TaxDocumentStRpActivity ASSELECT
TaxItem.CompanyCode AS CompanyCode,
TaxItem.AccountingDocument AS AccountingDocument,
TaxItem.FiscalYear AS FiscalYear,
TaxItem.TaxItem AS TaxItem,
TaxItem._JournalEntry.PostingDate AS PostingDate,
TaxItem._JournalEntry.DocumentDate AS DocumentDate,
TaxItem._JournalEntry.AccountingDocumentType AS AccountingDocumentType,
TaxItem._JournalEntry.TaxReportingDate AS TaxReportingDate,
casewhen ( TaxItem._JournalEntry.TaxReportingDate = '00000000' ) then TaxItem._JournalEntry.PostingDate else TaxItem._JournalEntry.TaxReportingDate endas ReportingDate AS TaxReportingDateendasReportingDate,
TaxItem.TransactionTypeDetermination AS TransactionTypeDetermination,
TaxItem.GLAccount AS GLAccount,
TaxItem.TaxJurisdiction AS TaxJurisdiction,
TaxItem.TaxCode AS TaxCode,
P_T007B_GLO.stazf AS TaxIsNotDeductible,
TaxItem._JournalEntry.SenderCompanyCode AS SenderCompanyCode,
TaxItem._JournalEntry.SenderAccountingDocument AS SenderAccountingDocument,
TaxItem._JournalEntry.SenderFiscalYear AS SenderFiscalYear,
TaxItem._JournalEntry.SenderLogicalSystem AS SenderLogicalSystem,
TaxItem._JournalEntry.ReferenceDocumentType AS ReferenceDocumentType,
casewhen TaxItem.TaxCountry <> '' then TaxItem.TaxCountry when TaxItem.TaxReturnCountry <> '' then TaxItem.TaxReturnCountry else TaxItem.CompanyCodeCountry endas ReportingCountry AS CompanyCodeCountryendasReportingCountry,
cast( casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem.Customer when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem.Supplier endas bu_partner ) as BusinessPartner AS Supplierendasbu_partnerasBusinessPartner,
cast(concat( TaxItem.CompanyCode,concat( TaxItem.AccountingDocument,TaxItem.FiscalYear)) as awkey ) AS OriginalReferenceDocument,
TaxItem.BusinessPlace AS BusinessPlace,
TaxItem._JournalEntry.ReverseDocument AS ReverseDocument,
TaxItem._JournalEntry.ReverseDocumentFiscalYear AS ReverseDocumentFiscalYear,
TaxItem._JournalEntry.IsReversal AS IsReversal,
TaxItem._JournalEntry.IsReversed AS IsReversed,
TaxItem._JournalEntry.DocumentReferenceID AS DocumentReferenceID,
cast( casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber2 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber2 endas stcd2 ) as TaxNumber2 AS TaxNumber2endasstcd2asTaxNumber2,
cast( casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.AddressID when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.AddressID endas adrnr ) as AddressID AS AddressIDendasadrnrasAddressID,
TaxItem.VATRegistration AS VATRegistration,
TaxCountry,
DebitCreditCode,
TaxRateValidityStartDate,
_JournalEntry.TaxFulfillmentDate AS TaxFulfillmentDate,
TaxCalculationProcedure,
_TaxCode.OneStopShopScheme AS OneStopShopScheme,
_TaxCode.OneStopShopTaxReportingCountry AS OneStopShopTaxReportingCountry,
_TaxCode._Text[1:Language=$session.system_language].TaxCodeName AS TaxCodeName,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber1 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber1 else '' endas TaxNumber1 AS TaxNumber1elseendasTaxNumber1,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber3 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber3 else '' endas TaxNumber3 AS TaxNumber3elseendasTaxNumber3,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber4 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber4 else '' endas TaxNumber4 AS TaxNumber4elseendasTaxNumber4,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.StreetName when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.StreetName else '' endas StreetName AS StreetNameelseendasStreetName,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.HouseNumber when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.HouseNumber else '' endas HouseNumber AS HouseNumberelseendasHouseNumber,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.CityName when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.CityName else '' endas CityName AS CityNameelseendasCityName,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.Country when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.Country else '' endas Country AS CountryelseendasCountry,
casewhen _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.PostalCode when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.PostalCode else '' endas PostalCode AS PostalCodeelseendasPostalCode
LEFTOUTERJOIN I_StRpCustomerSupplierLineItem AS _CustomerSupplierLineItem ON TaxItem.CompanyCode = _CustomerSupplierLineItem.CompanyCode AND TaxItem.AccountingDocument = _CustomerSupplierLineItem.AccountingDocument AND TaxItem.FiscalYear = _CustomerSupplierLineItem.FiscalYear AND _CustomerSupplierLineItem.ReportingDate between $parameters.P_TaxReportingFromDate AND $parameters.P_TaxReportingToDate AND ( _CustomerSupplierLineItem.FinancialAccountType = 'D' OR _CustomerSupplierLineItem.FinancialAccountType = 'K' ) -- association [0..1]LEFTOUTERJOIN I_TaxCode AS _TaxCode ON TaxItem.TaxCode = _TaxCode.TaxCode AND TaxItem.TaxCalculationProcedure = _TaxCode.TaxCalculationProcedure -- association [0..1]
;