I_PT_SAFTBillgSlsInvcAmount

DDL: I_PT_SAFTBILLGSLSINVCAMOUNT Type: view_entity COMPOSITE

Billing Document Total Amount

I_PT_SAFTBillgSlsInvcAmount is a Composite CDS View that provides data about "Billing Document Total Amount" in SAP S/4HANA. It reads from 3 data sources (I_BillingDocument, P_PT_SAFTSALESINVPLANT, I_PT_BillgDocDgtlSgntr) and exposes 13 fields with key fields PT_SAFTDocumentNumber, CompanyCode, FiscalYear. It has 1 association to related views.

Data Sources (3)

SourceAliasJoin Type
I_BillingDocument Doc from
P_PT_SAFTSALESINVPLANT InvPlant inner
I_PT_BillgDocDgtlSgntr Sig inner

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_PT_SAFTPrcgElmntTaxCheck _Tax $projection.BillingDocument = _Tax.BillingDocument

Annotations (7)

NameValueLevelField
EndUserText.label Billing Document Total Amount view
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

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY PT_SAFTDocumentNumber
KEY CompanyCode I_PT_BillgDocDgtlSgntr CompanyCode Receiver Company Code
KEY FiscalYear I_BillingDocument FiscalYear G/L Fiscal Year
BillingDocument I_BillingDocument BillingDocument SD Document
TransactionCurrency I_BillingDocument TransactionCurrency Transaction Currency
ExchangeRateDate I_BillingDocument ExchangeRateDate Translatn Date
ConditionAmount _Tax ConditionAmount Condition Value
TotalNetAmountendasCnvrtdTotalNetAmount
TotalTaxAmount
TotalNetAmount
TotalGrossAmount
CompanyCodeCurrency
curr152endasInvoiceAmountInFrgnCurrency

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_SAFTBillgSlsInvcAmount.
-- 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_SAFTBillgSlsInvcAmount AS
SELECT
  cast( Sig.PortugueseInvoiceNumber as saft_pt_documentnumber ) AS PT_SAFTDocumentNumber,
  Sig.CompanyCode AS CompanyCode,
  Doc.FiscalYear AS FiscalYear,
  Doc.BillingDocument AS BillingDocument,
  Doc.TransactionCurrency AS TransactionCurrency,
  Doc.ExchangeRateDate AS ExchangeRateDate,
  _Tax.ConditionAmount AS ConditionAmount,
  case when BillingPlanHdr.PT_SAFTDocumentNumber is not initial or BillingPlanHdr.PT_SAFTDocumentNumber is not null then Doc.TotalNetAmount - cast( BillingPlanHdr.TotalAmountInTransactionCrcy as netwr_ak ) else Doc.TotalNetAmount end as CnvrtdTotalNetAmount AS TotalNetAmountendasCnvrtdTotalNetAmount,
  cast( coalesce(abs(ConditionAmount ), cast(0 as abap.curr( 15, 2 ))) as abap.dec(15,2) ) AS TotalTaxAmount,
  cast( coalesce(abs(CnvrtdTotalNetAmount), cast(0 as abap.curr( 15, 2 ))) as abap.dec(15,2)) AS TotalNetAmount,
  cast(Sig.TotalGrossAmount as abap.dec(15,2)) AS TotalGrossAmount,
  Doc._CompanyCode.Currency AS CompanyCodeCurrency,
  case when Doc.TransactionCurrency <> Doc._CompanyCode.Currency then Doc.TotalNetAmount + Doc.TotalTaxAmount else cast(0 as abap.curr( 15, 2 )) end as InvoiceAmountInFrgnCurrency AS curr152endasInvoiceAmountInFrgnCurrency
FROM I_BillingDocument AS Doc
INNER JOIN I_PT_BillgDocDgtlSgntr AS Sig ON /* join condition not captured in parsed metadata */
INNER JOIN P_PT_SAFTSALESINVPLANT AS InvPlant ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PT_SAFTPrcgElmntTaxCheck AS _Tax ON BillingDocument = _Tax.BillingDocument  -- association [0..1]
;