P_TH_StRpTaxReturn2

DDL: P_TH_STRPTAXRETURN2 Type: view_entity COMPOSITE Package: GLO_FIN_IS_VAT_TH

Private view of Tax Return Statutory Reporting for Thailand

P_TH_StRpTaxReturn2 is a Composite CDS View that provides data about "Private view of Tax Return Statutory Reporting for Thailand" in SAP S/4HANA. Part of development package GLO_FIN_IS_VAT_TH.

Parameters (5)

NameTypeDefault
P_RelevantAmountPosition relevantamountposition
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id
P_ReportingCountry land1

Annotations (7)

NameValueLevelField
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view

Fields (76)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_TH_StRpAverageTaxReturn CompanyCode Receiver Company Code
KEY AccountingDocument P_TH_StRpAverageTaxReturn AccountingDocument Journal Entry
KEY FiscalYear P_TH_StRpAverageTaxReturn FiscalYear G/L Fiscal Year
KEY TaxItem P_TH_StRpAverageTaxReturn TaxItem Tax Item
KEY TaxCode P_TH_StRpAverageTaxReturn TaxCode Tax Code
KEY TransactionTypeDetermination P_TH_StRpAverageTaxReturn TransactionTypeDetermination Transaction Key
KEY TaxBox P_TH_StRpAverageTaxReturn TaxBox Tax.Bs.Gp.No.
KEY TaxDeclnAmountType P_TH_StRpAverageTaxReturn TaxDeclnAmountType
KEY TaxItemGroupingVersion P_TH_StRpAverageTaxReturn TaxItemGroupingVersion Tax Grping Ver.
KEY TaxBoxStrucValidityStartDate P_TH_StRpAverageTaxReturn TaxBoxStrucValidityStartDate
KEY TaxBoxStructureType P_TH_StRpAverageTaxReturn TaxBoxStructureType
KEY TaxGroup P_TH_StRpAverageTaxReturn TaxGroup Tax Group
TaxBoxStructure P_TH_StRpAverageTaxReturn TaxBoxStructure
TaxBoxStrucValidityEndDate P_TH_StRpAverageTaxReturn TaxBoxStrucValidityEndDate
BranchCode I_OperationalAcctgDocItem BranchCode Branch Code
SalesDocument P_TH_StRpAverageTaxReturn SalesDocument SD Document
BillingDocument P_TH_StRpAverageTaxReturn BillingDocument SD Document
Customer I_StRpBPTaxItem Customer Sold-to Party
Supplier I_StRpBPTaxItem Supplier Supplier
ReportingDate P_TH_StRpAverageTaxReturn ReportingDate
PostingDate P_TH_StRpAverageTaxReturn PostingDate Posting Date for GR
DocumentDate P_TH_StRpAverageTaxReturn DocumentDate Journal Entry Date
TaxReportingDate P_TH_StRpAverageTaxReturn TaxReportingDate Tax Reporting Date
FiscalPeriod P_TH_StRpAverageTaxReturn FiscalPeriod Tax period
IsReversal P_TH_StRpAverageTaxReturn IsReversal Reversal doc.
IsReversed P_TH_StRpAverageTaxReturn IsReversed Reversed?
AccountingDocumentType P_TH_StRpAverageTaxReturn AccountingDocumentType Journal Entry Type
TaxCalculationProcedure P_TH_StRpAverageTaxReturn TaxCalculationProcedure Tax Procedure
DocumentReferenceID P_TH_StRpAverageTaxReturn DocumentReferenceID Reference
CompanyCodeCountry P_TH_StRpAverageTaxReturn CompanyCodeCountry Reporting Ctry/Reg.
ReportingCountry P_TH_StRpAverageTaxReturn ReportingCountry
TaxReturnCountry P_TH_StRpAverageTaxReturn TaxReturnCountry Reporting C/R
ExchangeRate P_TH_StRpAverageTaxReturn ExchangeRate Exchange rate
TaxRate P_TH_StRpAverageTaxReturn TaxRate Tax Rate
TaxRateValidityStartDate P_TH_StRpAverageTaxReturn TaxRateValidityStartDate Tax Rate Validity Start Date
GLAccount P_TH_StRpAverageTaxReturn GLAccount General Ledger
BusinessPlace P_TH_StRpAverageTaxReturn BusinessPlace Business place
TaxJurisdiction P_TH_StRpAverageTaxReturn TaxJurisdiction Tax Jurisdiction
AlternativeReferenceDocument P_TH_StRpAverageTaxReturn AlternativeReferenceDocument Alternative Reference Document
LowestLevelTaxJurisdiction P_TH_StRpAverageTaxReturn LowestLevelTaxJurisdiction Jurisdict. Code
BillToParty _SDDocumentPartner Customer Sold-to Party
TaxNumber1endasTaxNumber1
BusinessPartnerCategory
TaxNumber2endasTaxNumber2
TaxNumber3endasTaxNumber3
SupplierendasBusinessPartner
AddressIDendasBusinessPartnerAddressID
CountryendasBusinessPartnerCountry
BPSupplierNameendasBusinessPartnerName
TaxType P_TH_StRpAverageTaxReturn TaxType Tax Type
CompanyCodeCurrency P_TH_StRpAverageTaxReturn CompanyCodeCurrency Local Currency
CountryCurrency P_TH_StRpAverageTaxReturn CountryCurrency Currency
DocumentCurrency P_TH_StRpAverageTaxReturn DocumentCurrency Document Currency
ReportingCurrency P_TH_StRpAverageTaxReturn ReportingCurrency Currency
AdditionalCurrency1 P_TH_StRpAverageTaxReturn AdditionalCurrency1 Local curr. 2
AdditionalCurrency2 P_TH_StRpAverageTaxReturn AdditionalCurrency2 Local curr. 3
AmountInReportingCurrency
AmountInTransactionCurrency P_TH_StRpAverageTaxReturn AmountInTransactionCurrency Pt Crcy Amt
TaxBaseAmountInCoCodeCrcy P_TH_StRpAverageTaxReturn TaxBaseAmountInCoCodeCrcy TxBaseAmt CoCodeCrcy
TaxAmountInCoCodeCrcy P_TH_StRpAverageTaxReturn TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
TaxBaseAmountInTransCrcy P_TH_StRpAverageTaxReturn TaxBaseAmountInTransCrcy Value-Added Tax
TaxAmount P_TH_StRpAverageTaxReturn TaxAmount Tax Amt in Rptg Crcy
TaxBaseAmountInRptgCrcy P_TH_StRpAverageTaxReturn TaxBaseAmountInRptgCrcy Base Amount
TaxAmountInRptgCrcy P_TH_StRpAverageTaxReturn TaxAmountInRptgCrcy Tax Rept. Crcy
AmountInAdditionalCurrency1 P_TH_StRpAverageTaxReturn AmountInAdditionalCurrency1 Amount in Additional Currency 1
AmountInAdditionalCurrency2 P_TH_StRpAverageTaxReturn AmountInAdditionalCurrency2 LC2 Amount
TaxBaseAmtInAdditionalCrcy1 P_TH_StRpAverageTaxReturn TaxBaseAmtInAdditionalCrcy1 LC 2 Base
TaxBaseAmtInAdditionalCrcy2 P_TH_StRpAverageTaxReturn TaxBaseAmtInAdditionalCrcy2 LC 3 Base
TaxAmountInAdditionalCurrency1 P_TH_StRpAverageTaxReturn TaxAmountInAdditionalCurrency1 LC 2 Tax
TaxAmountInAdditionalCurrency2 P_TH_StRpAverageTaxReturn TaxAmountInAdditionalCurrency2 LC 3 Tax
TaxIsNotDeductible P_TH_StRpAverageTaxReturn TaxIsNotDeductible Non-Deductible
_JournalEntry P_TH_StRpAverageTaxReturn _JournalEntry
_TaxJurisdiction P_TH_StRpAverageTaxReturn _TaxJurisdiction
_ReceivablesPayablesItem P_TH_StRpAverageTaxReturn _ReceivablesPayablesItem
_TaxTypeText P_TH_StRpAverageTaxReturn _TaxTypeText
_TaxCodeText P_TH_StRpAverageTaxReturn _TaxCodeText

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_TH_StRpTaxReturn2.
-- 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.
-- Parameters: P_RelevantAmountPosition : relevantamountposition, P_StatryRptgEntity : srf_reporting_entity, P_StatryRptCategory : srf_rep_cat_id, P_StatryRptRunID : srf_report_run_id, P_ReportingCountry : land1

CREATE VIEW P_TH_StRpTaxReturn2 AS
SELECT
  P_TH_StRpAverageTaxReturn.CompanyCode AS CompanyCode,
  P_TH_StRpAverageTaxReturn.AccountingDocument AS AccountingDocument,
  P_TH_StRpAverageTaxReturn.FiscalYear AS FiscalYear,
  P_TH_StRpAverageTaxReturn.TaxItem AS TaxItem,
  P_TH_StRpAverageTaxReturn.TaxCode AS TaxCode,
  P_TH_StRpAverageTaxReturn.TransactionTypeDetermination AS TransactionTypeDetermination,
  P_TH_StRpAverageTaxReturn.TaxBox AS TaxBox,
  P_TH_StRpAverageTaxReturn.TaxDeclnAmountType AS TaxDeclnAmountType,
  P_TH_StRpAverageTaxReturn.TaxItemGroupingVersion AS TaxItemGroupingVersion,
  P_TH_StRpAverageTaxReturn.TaxBoxStrucValidityStartDate AS TaxBoxStrucValidityStartDate,
  P_TH_StRpAverageTaxReturn.TaxBoxStructureType AS TaxBoxStructureType,
  P_TH_StRpAverageTaxReturn.TaxGroup AS TaxGroup,
  P_TH_StRpAverageTaxReturn.TaxBoxStructure AS TaxBoxStructure,
  P_TH_StRpAverageTaxReturn.TaxBoxStrucValidityEndDate AS TaxBoxStrucValidityEndDate,
  I_OperationalAcctgDocItem.BranchCode AS BranchCode,
  P_TH_StRpAverageTaxReturn.SalesDocument AS SalesDocument,
  P_TH_StRpAverageTaxReturn.BillingDocument AS BillingDocument,
  I_StRpBPTaxItem.Customer AS Customer,
  I_StRpBPTaxItem.Supplier AS Supplier,
  P_TH_StRpAverageTaxReturn.ReportingDate AS ReportingDate,
  P_TH_StRpAverageTaxReturn.PostingDate AS PostingDate,
  P_TH_StRpAverageTaxReturn.DocumentDate AS DocumentDate,
  P_TH_StRpAverageTaxReturn.TaxReportingDate AS TaxReportingDate,
  P_TH_StRpAverageTaxReturn.FiscalPeriod AS FiscalPeriod,
  P_TH_StRpAverageTaxReturn.IsReversal AS IsReversal,
  P_TH_StRpAverageTaxReturn.IsReversed AS IsReversed,
  P_TH_StRpAverageTaxReturn.AccountingDocumentType AS AccountingDocumentType,
  P_TH_StRpAverageTaxReturn.TaxCalculationProcedure AS TaxCalculationProcedure,
  P_TH_StRpAverageTaxReturn.DocumentReferenceID AS DocumentReferenceID,
  P_TH_StRpAverageTaxReturn.CompanyCodeCountry AS CompanyCodeCountry,
  P_TH_StRpAverageTaxReturn.ReportingCountry AS ReportingCountry,
  P_TH_StRpAverageTaxReturn.TaxReturnCountry AS TaxReturnCountry,
  P_TH_StRpAverageTaxReturn.ExchangeRate AS ExchangeRate,
  P_TH_StRpAverageTaxReturn.TaxRate AS TaxRate,
  P_TH_StRpAverageTaxReturn.TaxRateValidityStartDate AS TaxRateValidityStartDate,
  P_TH_StRpAverageTaxReturn.GLAccount AS GLAccount,
  P_TH_StRpAverageTaxReturn.BusinessPlace AS BusinessPlace,
  P_TH_StRpAverageTaxReturn.TaxJurisdiction AS TaxJurisdiction,
  P_TH_StRpAverageTaxReturn.AlternativeReferenceDocument AS AlternativeReferenceDocument,
  P_TH_StRpAverageTaxReturn.LowestLevelTaxJurisdiction AS LowestLevelTaxJurisdiction,
  _SDDocumentPartner.Customer AS BillToParty,
  case when I_StRpBPTaxItem.Customer <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID1, I_StRpBPTaxItem._OneTimeAccountBP.TaxID1), I_StRpBPTaxItem._Customer.TaxNumber1) when I_StRpBPTaxItem.Supplier <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID1, I_StRpBPTaxItem._OneTimeAccountBP.TaxID1), I_StRpBPTaxItem._Supplier.TaxNumber1) end as TaxNumber1 AS TaxNumber1endasTaxNumber1,
  I_StRpBPTaxItem._BusinessPartner.BusinessPartnerCategory AS BusinessPartnerCategory,
  case when I_StRpBPTaxItem.Customer <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID2, I_StRpBPTaxItem._OneTimeAccountBP.TaxID2), I_StRpBPTaxItem._Customer.TaxNumber2) when I_StRpBPTaxItem.Supplier <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID2, I_StRpBPTaxItem._OneTimeAccountBP.TaxID2), I_StRpBPTaxItem._Supplier.TaxNumber2) end as TaxNumber2 AS TaxNumber2endasTaxNumber2,
  case when I_StRpBPTaxItem.Customer <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID3, I_StRpBPTaxItem._OneTimeAccountBP.TaxID3), I_StRpBPTaxItem._Customer.TaxNumber3) when I_StRpBPTaxItem.Supplier <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.TaxID3, I_StRpBPTaxItem._OneTimeAccountBP.TaxID3), I_StRpBPTaxItem._Supplier.TaxNumber3) end as TaxNumber3 AS TaxNumber3endasTaxNumber3,
  case when I_StRpBPTaxItem.Customer <> '' then I_StRpBPTaxItem.Customer when I_StRpBPTaxItem.Supplier <> '' then I_StRpBPTaxItem.Supplier end as BusinessPartner AS SupplierendasBusinessPartner,
  case when I_StRpBPTaxItem.Customer <> '' and I_StRpBPTaxItem._OneTimeDefTaxAccountBP.AccountingDocument is null and I_StRpBPTaxItem._OneTimeAccountBP.AccountingDocument is null then I_StRpBPTaxItem._Customer.AddressID when I_StRpBPTaxItem.Supplier <> '' and I_StRpBPTaxItem._OneTimeDefTaxAccountBP.AccountingDocument is null and I_StRpBPTaxItem._OneTimeAccountBP.AccountingDocument is null then I_StRpBPTaxItem._Supplier.AddressID end as BusinessPartnerAddressID AS AddressIDendasBusinessPartnerAddressID,
  case when I_StRpBPTaxItem.Customer <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.Country, I_StRpBPTaxItem._OneTimeAccountBP.Country), I_StRpBPTaxItem._Customer.Country) when I_StRpBPTaxItem.Supplier <> '' then coalesce(coalesce(I_StRpBPTaxItem._OneTimeDefTaxAccountBP.Country, I_StRpBPTaxItem._OneTimeAccountBP.Country), I_StRpBPTaxItem._Supplier.Country) end as BusinessPartnerCountry AS CountryendasBusinessPartnerCountry,
  case when I_StRpBPTaxItem.Customer <> '' then I_StRpBPTaxItem._Customer.BPCustomerName when I_StRpBPTaxItem.Supplier <> '' then I_StRpBPTaxItem._Supplier.BPSupplierName end as BusinessPartnerName AS BPSupplierNameendasBusinessPartnerName,
  P_TH_StRpAverageTaxReturn.TaxType AS TaxType,
  P_TH_StRpAverageTaxReturn.CompanyCodeCurrency AS CompanyCodeCurrency,
  P_TH_StRpAverageTaxReturn.CountryCurrency AS CountryCurrency,
  P_TH_StRpAverageTaxReturn.DocumentCurrency AS DocumentCurrency,
  P_TH_StRpAverageTaxReturn.ReportingCurrency AS ReportingCurrency,
  P_TH_StRpAverageTaxReturn.AdditionalCurrency1 AS AdditionalCurrency1,
  P_TH_StRpAverageTaxReturn.AdditionalCurrency2 AS AdditionalCurrency2,
  cast ( P_TH_StRpAverageTaxReturn.AmountInReportingCurrency as glo_amount_rptg_crcy ) AS AmountInReportingCurrency,
  P_TH_StRpAverageTaxReturn.AmountInTransactionCurrency AS AmountInTransactionCurrency,
  P_TH_StRpAverageTaxReturn.TaxBaseAmountInCoCodeCrcy AS TaxBaseAmountInCoCodeCrcy,
  P_TH_StRpAverageTaxReturn.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcy,
  P_TH_StRpAverageTaxReturn.TaxBaseAmountInTransCrcy AS TaxBaseAmountInTransCrcy,
  P_TH_StRpAverageTaxReturn.TaxAmount AS TaxAmount,
  P_TH_StRpAverageTaxReturn.TaxBaseAmountInRptgCrcy AS TaxBaseAmountInRptgCrcy,
  P_TH_StRpAverageTaxReturn.TaxAmountInRptgCrcy AS TaxAmountInRptgCrcy,
  P_TH_StRpAverageTaxReturn.AmountInAdditionalCurrency1 AS AmountInAdditionalCurrency1,
  P_TH_StRpAverageTaxReturn.AmountInAdditionalCurrency2 AS AmountInAdditionalCurrency2,
  P_TH_StRpAverageTaxReturn.TaxBaseAmtInAdditionalCrcy1 AS TaxBaseAmtInAdditionalCrcy1,
  P_TH_StRpAverageTaxReturn.TaxBaseAmtInAdditionalCrcy2 AS TaxBaseAmtInAdditionalCrcy2,
  P_TH_StRpAverageTaxReturn.TaxAmountInAdditionalCurrency1 AS TaxAmountInAdditionalCurrency1,
  P_TH_StRpAverageTaxReturn.TaxAmountInAdditionalCurrency2 AS TaxAmountInAdditionalCurrency2,
  P_TH_StRpAverageTaxReturn.TaxIsNotDeductible AS TaxIsNotDeductible,
  P_TH_StRpAverageTaxReturn._JournalEntry AS _JournalEntry,
  P_TH_StRpAverageTaxReturn._TaxJurisdiction AS _TaxJurisdiction,
  P_TH_StRpAverageTaxReturn._ReceivablesPayablesItem AS _ReceivablesPayablesItem,
  P_TH_StRpAverageTaxReturn._TaxTypeText AS _TaxTypeText,
  P_TH_StRpAverageTaxReturn._TaxCodeText AS _TaxCodeText
;