I_PT_SAFTBillgSlsInvcAmount
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)
| Source | Alias | Join Type |
|---|---|---|
| I_BillingDocument | Doc | from |
| P_PT_SAFTSALESINVPLANT | InvPlant | inner |
| I_PT_BillgDocDgtlSgntr | Sig | inner |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_PT_SAFTPrcgElmntTaxCheck | _Tax | $projection.BillingDocument = _Tax.BillingDocument |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA