I_TaxDocumentStRpActivity

DDL: I_TAXDOCUMENTSTRPACTIVITY SQL: ISTRPTAXDOCACTVT Type: view COMPOSITE

Tax Document Reporting Activity

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.

Parameters (2)

NameTypeDefault
P_TaxReportingFromDate vatdate
P_TaxReportingToDate vatdate

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_StRpCustomerSupplierLineItem _CustomerSupplierLineItem 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' )
[0..1] I_TaxCode _TaxCode TaxItem.TaxCode = _TaxCode.TaxCode and TaxItem.TaxCalculationProcedure = _TaxCode.TaxCalculationProcedure

Annotations (11)

NameValueLevelField
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName ISTRPTAXDOCACTVT view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Tax Document Reporting Activity view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #NOT_REQUIRED view
AbapCatalog.preserveKey true view

Fields (47)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode TaxItem CompanyCode Receiver Company Code
KEY AccountingDocument TaxItem AccountingDocument Journal Entry
KEY FiscalYear TaxItem FiscalYear G/L Fiscal Year
KEY TaxItem TaxItem TaxItem Tax Item
PostingDate
DocumentDate
AccountingDocumentType
TaxReportingDate
TaxReportingDateendasReportingDate
TransactionTypeDetermination TaxItem TransactionTypeDetermination Transaction Key
GLAccount TaxItem GLAccount General Ledger
TaxJurisdiction TaxItem TaxJurisdiction Tax Jurisdiction
TaxCode TaxItem TaxCode Tax Code
TaxIsNotDeductible P_T007B_GLO stazf Not deductible
SenderCompanyCode
SenderAccountingDocument
SenderFiscalYear
SenderLogicalSystem
ReferenceDocumentType
CompanyCodeCountryendasReportingCountry
Supplierendasbu_partnerasBusinessPartner
OriginalReferenceDocument
BusinessPlace TaxItem BusinessPlace Business place
ReverseDocument
ReverseDocumentFiscalYear
IsReversal
IsReversed
DocumentReferenceID
TaxNumber2endasstcd2asTaxNumber2
AddressIDendasadrnrasAddressID
VATRegistration TaxItem VATRegistration VAT Registration No.
TaxCountry TaxCountry Tax Ctry/Reg.
DebitCreditCode DebitCreditCode Single-Character Flag
TaxRateValidityStartDate TaxRateValidityStartDate Tax Rate Validity Start Date
TaxFulfillmentDate _JournalEntry TaxFulfillmentDate Tax Settlement Date
TaxCalculationProcedure TaxCalculationProcedure Tax Procedure
OneStopShopScheme _TaxCode OneStopShopScheme
OneStopShopTaxReportingCountry _TaxCode OneStopShopTaxReportingCountry
TaxCodeName
TaxNumber1elseendasTaxNumber1
TaxNumber3elseendasTaxNumber3
TaxNumber4elseendasTaxNumber4
StreetNameelseendasStreetName
HouseNumberelseendasHouseNumber
CityNameelseendasCityName
CountryelseendasCountry
PostalCodeelseendasPostalCode

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 : vatdate

CREATE VIEW I_TaxDocumentStRpActivity AS
SELECT
  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,
  case when ( TaxItem._JournalEntry.TaxReportingDate = '00000000' ) then TaxItem._JournalEntry.PostingDate else TaxItem._JournalEntry.TaxReportingDate end as 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,
  case when TaxItem.TaxCountry <> '' then TaxItem.TaxCountry when TaxItem.TaxReturnCountry <> '' then TaxItem.TaxReturnCountry else TaxItem.CompanyCodeCountry end as ReportingCountry AS CompanyCodeCountryendasReportingCountry,
  cast( case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem.Customer when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem.Supplier end as 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( case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber2 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber2 end as stcd2 ) as TaxNumber2 AS TaxNumber2endasstcd2asTaxNumber2,
  cast( case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.AddressID when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.AddressID end as 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,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber1 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber1 else '' end as TaxNumber1 AS TaxNumber1elseendasTaxNumber1,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber3 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber3 else '' end as TaxNumber3 AS TaxNumber3elseendasTaxNumber3,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer.TaxNumber4 when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier.TaxNumber4 else '' end as TaxNumber4 AS TaxNumber4elseendasTaxNumber4,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.StreetName when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.StreetName else '' end as StreetName AS StreetNameelseendasStreetName,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.HouseNumber when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.HouseNumber else '' end as HouseNumber AS HouseNumberelseendasHouseNumber,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.CityName when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.CityName else '' end as CityName AS CityNameelseendasCityName,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.Country when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.Country else '' end as Country AS CountryelseendasCountry,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem._Customer._AddressRepresentation.PostalCode when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem._Supplier._AddressRepresentation.PostalCode else '' end as PostalCode AS PostalCodeelseendasPostalCode
LEFT OUTER JOIN 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]
LEFT OUTER JOIN I_TaxCode AS _TaxCode ON TaxItem.TaxCode = _TaxCode.TaxCode AND TaxItem.TaxCalculationProcedure = _TaxCode.TaxCalculationProcedure  -- association [0..1]
;