P_PL_SAFTTaxItemBasic

DDL: P_PL_SAFTTAXITEMBASIC SQL: PPLSAFTTAXITMBSC Type: view COMPOSITE Package: GLO_FIN_IS_SAFT_PL

SAF-T PL Tax Item Basic

P_PL_SAFTTaxItemBasic is a Composite CDS View that provides data about "SAF-T PL Tax Item Basic" in SAP S/4HANA. It reads from 1 data source (P_PL_SAFTTaxItemAgg) and exposes 31 fields with key fields TaxType, CompanyCode, AccountingDocument, FiscalYear. It has 2 associations to related views. Part of development package GLO_FIN_IS_SAFT_PL.

Data Sources (1)

SourceAliasJoin Type
P_PL_SAFTTaxItemAgg TaxItemAgg from

Associations (2)

CardinalityTargetAliasCondition
[0..1] P_PL_SAFTDocItemVat _DocItemVat TaxItemAgg.TaxType = _DocItemVat.TaxType and TaxItemAgg.CompanyCode = _DocItemVat.CompanyCode and TaxItemAgg.AccountingDocument = _DocItemVat.AccountingDocument and TaxItemAgg.FiscalYear = _DocItemVat.FiscalYear
[0..1] P_PL_SAFTBPTaxNumber _SAFTBPTaxNumber TaxItemAgg.TaxType = _SAFTBPTaxNumber.TaxType and TaxItemAgg.CompanyCode = _SAFTBPTaxNumber.CompanyCode and TaxItemAgg.AccountingDocument = _SAFTBPTaxNumber.AccountingDocument and TaxItemAgg.FiscalYear = _SAFTBPTaxNumber.FiscalYear

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PPLSAFTTAXITMBSC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #X view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY TaxType P_PL_SAFTTaxItemAgg TaxType Tax Type
KEY CompanyCode P_PL_SAFTTaxItemAgg CompanyCode Receiver Company Code
KEY AccountingDocument P_PL_SAFTTaxItemAgg AccountingDocument Journal Entry
KEY FiscalYear P_PL_SAFTTaxItemAgg FiscalYear G/L Fiscal Year
PL_SAFTTaxAmountBox P_PL_SAFTTaxItemAgg PL_SAFTTaxAmountBox
PL_SAFTBaseAmountBoxMultiple P_PL_SAFTTaxItemAgg PL_SAFTBaseAmountBoxMultiple
PL_SAFTDocumentType P_PL_SAFTTaxItemAgg PL_SAFTDocumentType
PL_SAFTTaxItemHasMarginAmount P_PL_SAFTTaxItemAgg PL_SAFTTaxItemHasMarginAmount
PL_SAFTAddlClassification P_PL_SAFTTaxItemAgg PL_SAFTAddlClassification
PL_SAFTInvcExclRsnFromTotals P_PL_SAFTTaxItemAgg PL_SAFTInvcExclRsnFromTotals
TaxReportingDate P_PL_SAFTTaxItemAgg TaxReportingDate Tax Reporting Date
TaxReturnCountry P_PL_SAFTTaxItemAgg TaxReturnCountry Reporting C/R
TaxCalculationProcedure P_PL_SAFTTaxItemAgg TaxCalculationProcedure Tax Procedure
Customer P_PL_SAFTTaxItemAgg Customer Sold-to Party
Supplier P_PL_SAFTTaxItemAgg Supplier Supplier
ReferenceDocumentType P_PL_SAFTTaxItemAgg ReferenceDocumentType Reference Document Type
OriginalReferenceDocument P_PL_SAFTTaxItemAgg OriginalReferenceDocument Reference Key
DocumentItemText P_PL_SAFTTaxItemAgg DocumentItemText Text
CountryendendasBusinessPartnerCountry
BPTaxNumberendendendendasVATRegistration
BusinessPartnerName P_PL_SAFTTaxItemAgg BusinessPartnerName Extracted Customer Name
CustomerSupplierAddress P_PL_SAFTTaxItemAgg CustomerSupplierAddress
DocumentReferenceID P_PL_SAFTTaxItemAgg DocumentReferenceID Reference
DocumentDate P_PL_SAFTTaxItemAgg DocumentDate Journal Entry Date
CompanyCodeCurrency P_PL_SAFTTaxItemAgg CompanyCodeCurrency Local Currency
TaxAmountInCoCodeCrcy P_PL_SAFTTaxItemAgg TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
TaxBaseAmountInCoCodeCrcy P_PL_SAFTTaxItemAgg TaxBaseAmountInCoCodeCrcy TxBaseAmt CoCodeCrcy
DocumentCurrency P_PL_SAFTTaxItemAgg DocumentCurrency Document Currency
TaxBaseAmountInCountryCrcy P_PL_SAFTTaxItemAgg TaxBaseAmountInCountryCrcy Base Amount
TaxAmountInCountryCrcy P_PL_SAFTTaxItemAgg TaxAmountInCountryCrcy Tax Rept. Crcy
_AccountingDocument _AccountingDocument

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_PL_SAFTTaxItemBasic.
-- 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: PPLSAFTTAXITMBSC

CREATE VIEW P_PL_SAFTTaxItemBasic AS
SELECT
  TaxItemAgg.TaxType AS TaxType,
  TaxItemAgg.CompanyCode AS CompanyCode,
  TaxItemAgg.AccountingDocument AS AccountingDocument,
  TaxItemAgg.FiscalYear AS FiscalYear,
  TaxItemAgg.PL_SAFTTaxAmountBox AS PL_SAFTTaxAmountBox,
  TaxItemAgg.PL_SAFTBaseAmountBoxMultiple AS PL_SAFTBaseAmountBoxMultiple,
  TaxItemAgg.PL_SAFTDocumentType AS PL_SAFTDocumentType,
  TaxItemAgg.PL_SAFTTaxItemHasMarginAmount AS PL_SAFTTaxItemHasMarginAmount,
  TaxItemAgg.PL_SAFTAddlClassification AS PL_SAFTAddlClassification,
  TaxItemAgg.PL_SAFTInvcExclRsnFromTotals AS PL_SAFTInvcExclRsnFromTotals,
  TaxItemAgg.TaxReportingDate AS TaxReportingDate,
  TaxItemAgg.TaxReturnCountry AS TaxReturnCountry,
  TaxItemAgg.TaxCalculationProcedure AS TaxCalculationProcedure,
  TaxItemAgg.Customer AS Customer,
  TaxItemAgg.Supplier AS Supplier,
  TaxItemAgg.ReferenceDocumentType AS ReferenceDocumentType,
  TaxItemAgg.OriginalReferenceDocument AS OriginalReferenceDocument,
  TaxItemAgg.DocumentItemText AS DocumentItemText,
  case substring(_DocItemVat.VATRegistration,1,1) when '1' then _DocItemVat.SupplyingCountry when '2' then _DocItemVat.SupplyingCountry when '3' then _DocItemVat.SupplyingCountry when '4' then _DocItemVat.SupplyingCountry when '5' then _DocItemVat.SupplyingCountry when '6' then _DocItemVat.SupplyingCountry when '7' then _DocItemVat.SupplyingCountry when '8' then _DocItemVat.SupplyingCountry when '9' then _DocItemVat.SupplyingCountry when '0' then _DocItemVat.SupplyingCountry else case when _DocItemVat.VATRegistration <> '' and _DocItemVat.VatCountry <> 'UN' then substring(_DocItemVat.VATRegistration,1,2) when TaxItemAgg.BusinessPartnerCountry = 'GR' then 'EL' when _DocItemVat.VatCountry = 'UN' then 'BY' when TaxItemAgg.VATRegistration <> '' then TaxItemAgg.BusinessPartnerCountry else _SAFTBPTaxNumber.Country end end as BusinessPartnerCountry AS CountryendendasBusinessPartnerCountry,
  case substring(_DocItemVat.VATRegistration,1,1) when '1' then _DocItemVat.VATRegistration when '2' then _DocItemVat.VATRegistration when '3' then _DocItemVat.VATRegistration when '4' then _DocItemVat.VATRegistration when '5' then _DocItemVat.VATRegistration when '6' then _DocItemVat.VATRegistration when '7' then _DocItemVat.VATRegistration when '8' then _DocItemVat.VATRegistration when '9' then _DocItemVat.VATRegistration when '0' then _DocItemVat.VATRegistration else case when _DocItemVat.VatCountry = 'EL' then substring(_DocItemVat.VATRegistration,3,18) when _DocItemVat.VATRegistration <> '' and TaxItemAgg.VATCountry <> 'UN' then substring(_DocItemVat.VATRegistration,3,18) when _DocItemVat.VATRegistration <> '' then _DocItemVat.VATRegistration else case substring(TaxItemAgg.VATRegistration,1,1) when '1' then TaxItemAgg.VATRegistration when '2' then TaxItemAgg.VATRegistration when '3' then TaxItemAgg.VATRegistration when '4' then TaxItemAgg.VATRegistration when '5' then TaxItemAgg.VATRegistration when '6' then TaxItemAgg.VATRegistration when '7' then TaxItemAgg.VATRegistration when '8' then TaxItemAgg.VATRegistration when '9' then TaxItemAgg.VATRegistration when '0' then TaxItemAgg.VATRegistration else case when TaxItemAgg.VATCountry = 'EL' then substring(TaxItemAgg.VATRegistration,3,18) when TaxItemAgg.VATRegistration <> '' and TaxItemAgg.VATCountry = _Country.Country then substring(TaxItemAgg.VATRegistration,3,18) else _SAFTBPTaxNumber.BPTaxNumber end end end end as VATRegistration AS BPTaxNumberendendendendasVATRegistration,
  TaxItemAgg.BusinessPartnerName AS BusinessPartnerName,
  TaxItemAgg.CustomerSupplierAddress AS CustomerSupplierAddress,
  TaxItemAgg.DocumentReferenceID AS DocumentReferenceID,
  TaxItemAgg.DocumentDate AS DocumentDate,
  TaxItemAgg.CompanyCodeCurrency AS CompanyCodeCurrency,
  TaxItemAgg.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcy,
  TaxItemAgg.TaxBaseAmountInCoCodeCrcy AS TaxBaseAmountInCoCodeCrcy,
  TaxItemAgg.DocumentCurrency AS DocumentCurrency,
  TaxItemAgg.TaxBaseAmountInCountryCrcy AS TaxBaseAmountInCountryCrcy,
  TaxItemAgg.TaxAmountInCountryCrcy AS TaxAmountInCountryCrcy
FROM P_PL_SAFTTaxItemAgg AS TaxItemAgg
LEFT OUTER JOIN P_PL_SAFTDocItemVat AS _DocItemVat ON TaxItemAgg.TaxType = _DocItemVat.TaxType AND TaxItemAgg.CompanyCode = _DocItemVat.CompanyCode AND TaxItemAgg.AccountingDocument = _DocItemVat.AccountingDocument AND TaxItemAgg.FiscalYear = _DocItemVat.FiscalYear  -- association [0..1]
LEFT OUTER JOIN P_PL_SAFTBPTaxNumber AS _SAFTBPTaxNumber ON TaxItemAgg.TaxType = _SAFTBPTaxNumber.TaxType AND TaxItemAgg.CompanyCode = _SAFTBPTaxNumber.CompanyCode AND TaxItemAgg.AccountingDocument = _SAFTBPTaxNumber.AccountingDocument AND TaxItemAgg.FiscalYear = _SAFTBPTaxNumber.FiscalYear  -- association [0..1]
;