P_BG_SAFTSALESINVOICEITEM
P_BG_SAFTSALESINVOICEITEM is a Consumption CDS View in SAP S/4HANA. It reads from 5 data sources (I_JournalEntryItem, I_JournalEntry, I_OperationalAcctgDocItem, I_CompanyCode, I_BG_SAFTSourceDocumentTypeMap) and exposes 22 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntryItem | Acdoca | from |
| I_JournalEntry | Bkpf | inner |
| I_OperationalAcctgDocItem | Bseg | inner |
| I_CompanyCode | CompanyCode | inner |
| I_BG_SAFTSourceDocumentTypeMap | DocType | inner |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_AlternativeGLAccountIsUsed | saft_bg_alt_gl_account_flag |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view |
Fields (22)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | SourceLedger | I_JournalEntryItem | SourceLedger | Source Ledger |
| KEY | CompanyCode | I_JournalEntryItem | CompanyCode | Receiver Company Code |
| KEY | FiscalYear | I_JournalEntryItem | FiscalYear | G/L Fiscal Year |
| KEY | AccountingDocument | I_JournalEntryItem | AccountingDocument | Journal Entry |
| KEY | LedgerGLLineItem | I_JournalEntryItem | LedgerGLLineItem | Journal Entry Item |
| KEY | Ledger | I_JournalEntryItem | Ledger | Ledger |
| AccountingDocumentItem | I_JournalEntryItem | AccountingDocumentItem | Posting View Item | |
| AccountingDocumentType | I_JournalEntryItem | AccountingDocumentType | Journal Entry Type | |
| TransactionTypeDetermination | I_JournalEntryItem | TransactionTypeDetermination | Transaction Key | |
| PostingDate | I_JournalEntryItem | PostingDate | Posting Date for GR | |
| BG_SAFTGoodsService | GoodsService | BG_SAFTGoodsService | ||
| Product | I_JournalEntryItem | Product | Product Sold | |
| ProductDescription | ||||
| CompanyCodeCurrency | I_JournalEntryItem | CompanyCodeCurrency | Local Currency | |
| TransactionCurrency | I_JournalEntryItem | TransactionCurrency | Transaction Currency | |
| SourceUnitOfMeasureFactor | ||||
| BaseUnitendasmeinsasBaseUnit | ||||
| GLAccountendasActiveGLAccount | ||||
| QuantityendasQuantity | ||||
| TaxReportingDate | I_JournalEntry | TaxReportingDate | Tax Reporting Date | |
| ExchangeRate | I_JournalEntry | ExchangeRate | Exchange rate | |
| TransactionCurrencyDecimals | TCurrency | Decimals | Rounding Places |
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_BG_SAFTSALESINVOICEITEM.
-- 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_AlternativeGLAccountIsUsed : saft_bg_alt_gl_account_flag
CREATE VIEW P_BG_SAFTSALESINVOICEITEM AS
SELECT
Acdoca.SourceLedger AS SourceLedger,
Acdoca.CompanyCode AS CompanyCode,
Acdoca.FiscalYear AS FiscalYear,
Acdoca.AccountingDocument AS AccountingDocument,
Acdoca.LedgerGLLineItem AS LedgerGLLineItem,
Acdoca.Ledger AS Ledger,
Acdoca.AccountingDocumentItem AS AccountingDocumentItem,
Acdoca.AccountingDocumentType AS AccountingDocumentType,
Acdoca.TransactionTypeDetermination AS TransactionTypeDetermination,
Acdoca.PostingDate AS PostingDate,
GoodsService.BG_SAFTGoodsService AS BG_SAFTGoodsService,
Acdoca.Product AS Product,
coalesce(ProductText.ProductName, ProductTextE.ProductName) AS ProductDescription,
Acdoca.CompanyCodeCurrency AS CompanyCodeCurrency,
Acdoca.TransactionCurrency AS TransactionCurrency,
coalesce(UoM.BG_SAFTUnitOfMeasureFactor, RUoM.BG_SAFTUnitOfMeasureFactor) AS SourceUnitOfMeasureFactor,
cast(case when Acdoca.BaseUnit = '' then Acdoca.ReferenceQuantityUnit else Acdoca.BaseUnit end as meins) as BaseUnit AS BaseUnitendasmeinsasBaseUnit,
case when $parameters.P_AlternativeGLAccountIsUsed = 'X' then Acdoca.AlternativeGLAccount else Acdoca.GLAccount end as ActiveGLAccount AS GLAccountendasActiveGLAccount,
case when Acdoca.Quantity = 0 then abs(Acdoca.ReferenceQuantity) else abs(Acdoca.Quantity) end as Quantity AS QuantityendasQuantity,
Bkpf.TaxReportingDate AS TaxReportingDate,
Bkpf.ExchangeRate AS ExchangeRate,
TCurrency.Decimals AS TransactionCurrencyDecimals
FROM I_JournalEntryItem AS Acdoca
INNER JOIN I_JournalEntry AS Bkpf ON /* join condition not captured in parsed metadata */
INNER JOIN I_BG_SAFTSourceDocumentTypeMap AS DocType ON /* join condition not captured in parsed metadata */
INNER JOIN I_OperationalAcctgDocItem AS Bseg ON /* join condition not captured in parsed metadata */
INNER JOIN I_CompanyCode AS CompanyCode ON /* join condition not captured in parsed metadata */
;
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