I_PT_SAFTSalesInvcBillingTax

DDL: I_PT_SAFTSALESINVCBILLINGTAX Type: view_entity COMPOSITE

Billing Document Item Tax Information

I_PT_SAFTSalesInvcBillingTax is a Composite CDS View that provides data about "Billing Document Item Tax Information" in SAP S/4HANA. It reads from 5 data sources (I_PT_SAFTBillgSlsInvcHeader, I_PT_SAFTBillingItemTaxCheck, I_BillingDocumentItem, I_PT_SAFTBillgMasterDataTax, I_PT_SAFTTaxNotConfigured) and exposes 10 fields with key fields CompanyCode, PT_SAFTDocumentNumber, PT_SAFTLineNumber.

Data Sources (5)

SourceAliasJoin Type
I_PT_SAFTBillgSlsInvcHeader Head from
I_PT_SAFTBillingItemTaxCheck ItemTax inner
I_BillingDocumentItem Line inner
I_PT_SAFTBillgMasterDataTax TaxInfo inner
I_PT_SAFTTaxNotConfigured TaxNotConf inner

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #COMPOSITE view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label Billing Document Item Tax Information view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_PT_SAFTBillgSlsInvcHeader CompanyCode Receiver Company Code
KEY PT_SAFTDocumentNumber I_PT_SAFTBillgSlsInvcHeader PT_SAFTDocumentNumber
KEY PT_SAFTLineNumber
PortugueseInvoiceDate I_PT_SAFTBillgSlsInvcHeader PortugueseInvoiceDate Date
CompanyCodeCurrency I_PT_SAFTBillgSlsInvcHeader CompanyCodeCurrency Local Currency
TaxCode
ConditionRateValue
TaxAmountendasTaxAmount
TaxReturnCountryendasCountryRegion
ExemptionReasonelseendasExemptionReason

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_PT_SAFTSalesInvcBillingTax.
-- 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.

CREATE VIEW I_PT_SAFTSalesInvcBillingTax AS
SELECT
  Head.CompanyCode AS CompanyCode,
  Head.PT_SAFTDocumentNumber AS PT_SAFTDocumentNumber,
  cast(concat('', Line.BillingDocumentItem) as saft_pt_doclinenumber) AS PT_SAFTLineNumber,
  Head.PortugueseInvoiceDate AS PortugueseInvoiceDate,
  Head.CompanyCodeCurrency AS CompanyCodeCurrency,
  coalesce(ItemTax.TaxCode,'') AS TaxCode,
  coalesce(ItemTax.ConditionRateValue, 0) AS ConditionRateValue,
  case when TaxInfo.TaxAmount is not null or TaxInfo.TaxAmount is not initial then TaxInfo.TaxAmount else TaxNotConf.TaxAmount end as TaxAmount AS TaxAmountendasTaxAmount,
  case when TaxInfo.CountryRegion is not null or TaxInfo.CountryRegion is not initial then TaxInfo.CountryRegion else TaxNotConf.TaxReturnCountry end as CountryRegion AS TaxReturnCountryendasCountryRegion,
  case when TaxInfo.ExemptionReason is not null or TaxInfo.ExemptionReason is not initial then TaxInfo.ExemptionReason when TaxInfo.TaxCode is null then TaxNotConf.ExemptionReason else '' end as ExemptionReason AS ExemptionReasonelseendasExemptionReason
FROM I_PT_SAFTBillgSlsInvcHeader AS Head
INNER JOIN I_BillingDocumentItem AS Line ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTBillingItemTaxCheck AS ItemTax ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTBillgMasterDataTax AS TaxInfo ON /* join condition not captured in parsed metadata */
INNER JOIN I_PT_SAFTTaxNotConfigured AS TaxNotConf ON /* join condition not captured in parsed metadata */
;