P_BG_SAFTJournalEntryItem
BG SAFT GL Item
P_BG_SAFTJournalEntryItem is a Consumption CDS View that provides data about "BG SAFT GL Item" in SAP S/4HANA. It reads from 2 data sources (I_JournalEntryItem, I_JournalEntry) and exposes 44 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. Part of development package GLO_FIN_IS_SAFT_BG.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntryItem | Acdoca | from |
| I_JournalEntry | Bkpf | 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 | #TRANSACTIONAL | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view | |
| AccessControl.authorizationCheck | #MANDATORY | view |
Fields (44)
| 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 | |
| FinancialAccountType | I_JournalEntryItem | FinancialAccountType | Fin. Account Type | |
| Customer | I_JournalEntryItem | Customer | Sold-to Party | |
| Supplier | I_JournalEntryItem | Supplier | Supplier | |
| DebitCreditCode | I_JournalEntryItem | DebitCreditCode | Single-Character Flag | |
| Product | I_JournalEntryItem | Product | Product Sold | |
| Plant | I_JournalEntryItem | Plant | Valuation Area | |
| TaxCode | I_JournalEntryItem | TaxCode | Tax Code | |
| TaxCountry | I_JournalEntryItem | TaxCountry | Tax Ctry/Reg. | |
| GLAccountendassaknrasActiveGLAccount | ||||
| PostingDate | I_JournalEntryItem | PostingDate | Posting Date for GR | |
| DocumentDate | I_JournalEntryItem | DocumentDate | Journal Entry Date | |
| AccountingDocumentCreationDate | I_JournalEntry | AccountingDocumentCreationDate | Journal Entry Date | |
| AccountingDocCreatedByUser | I_JournalEntry | AccountingDocCreatedByUser | User which created overhead document | |
| AccountingDocumentType | I_JournalEntryItem | AccountingDocumentType | Journal Entry Type | |
| ValueDate | I_JournalEntryItem | ValueDate | Value Date | |
| DocumentItemTextendasDocumentItemText | ||||
| BaseUnit | I_JournalEntryItem | BaseUnit | Unit of Measure | |
| ControllingArea | I_JournalEntryItem | ControllingArea | Controlling Area | |
| ProfitCenter | I_JournalEntryItem | ProfitCenter | Profit Center | |
| _ProfitCenterTxt | I_JournalEntryItem | _ProfitCenterTxt | ||
| Segment | I_JournalEntryItem | Segment | Segment number | |
| _SegmentText | I_JournalEntryItem | _SegmentText | ||
| CostCenter | I_JournalEntryItem | CostCenter | Cost Center | |
| _CostCenterTxt | I_JournalEntryItem | _CostCenterTxt | ||
| OrderID | I_JournalEntryItem | OrderID | Order ID | |
| _Order | I_JournalEntryItem | _Order | ||
| WBSElement | ||||
| WBSElementInternalID | I_JournalEntryItem | WBSElementInternalID | WBS Internal ID | |
| _WBSElementBasicDataText | I_JournalEntryItem | _WBSElementBasicDataText | ||
| TransactionTypeDetermination | I_JournalEntryItem | TransactionTypeDetermination | Transaction Key | |
| VATRegistrationendasCustomerTaxID5 | ||||
| VATRegistrationendasSupplierTaxID5 | ||||
| ReportingCurrency | ||||
| PostingDateasAmountInReportingCurrency | ||||
| TransactionCurrency | I_JournalEntryItem | TransactionCurrency | Transaction Currency | |
| LogicalSystem | I_JournalEntryItem | LogicalSystem | Logical System | |
| TransactionCode | I_JournalEntry | TransactionCode | Transaction Code |
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_SAFTJournalEntryItem.
-- 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_SAFTJournalEntryItem 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.FinancialAccountType AS FinancialAccountType,
Acdoca.Customer AS Customer,
Acdoca.Supplier AS Supplier,
Acdoca.DebitCreditCode AS DebitCreditCode,
Acdoca.Product AS Product,
Acdoca.Plant AS Plant,
Acdoca.TaxCode AS TaxCode,
Acdoca.TaxCountry AS TaxCountry,
cast(case when $parameters.P_AlternativeGLAccountIsUsed = 'X' then Acdoca.AlternativeGLAccount else Acdoca.GLAccount end as saknr) as ActiveGLAccount AS GLAccountendassaknrasActiveGLAccount,
Acdoca.PostingDate AS PostingDate,
Acdoca.DocumentDate AS DocumentDate,
Bkpf.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
Bkpf.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
Acdoca.AccountingDocumentType AS AccountingDocumentType,
Acdoca.ValueDate AS ValueDate,
case Acdoca.DocumentItemText when '' then 'N.A' else Acdoca.DocumentItemText end as DocumentItemText AS DocumentItemTextendasDocumentItemText,
Acdoca.BaseUnit AS BaseUnit,
Acdoca.ControllingArea AS ControllingArea,
Acdoca.ProfitCenter AS ProfitCenter,
Acdoca._ProfitCenterTxt AS _ProfitCenterTxt,
Acdoca.Segment AS Segment,
Acdoca._SegmentText AS _SegmentText,
Acdoca.CostCenter AS CostCenter,
Acdoca._CostCenterTxt AS _CostCenterTxt,
Acdoca.OrderID AS OrderID,
Acdoca._Order AS _Order,
cast(Acdoca.WBSElement as fis_wbs_no_conv) AS WBSElement,
Acdoca.WBSElementInternalID AS WBSElementInternalID,
Acdoca._WBSElementBasicDataText AS _WBSElementBasicDataText,
Acdoca.TransactionTypeDetermination AS TransactionTypeDetermination,
case when Acdoca.FinancialAccountType <> 'D' then '0' when Acdoca.Customer <> '' and Bseg.VATRegistration <> '' and BsegStcegCountry.IsEuropeanUnionMember = 'X' then case when BsegStcegCountry.Country = 'BG' then replace(Bseg.VATRegistration, 'BG', '10') else cast(concat('11', Bseg.VATRegistration) as bptaxnumxl) end when Acdoca.Customer = '' or CustomerTaxType.BPTaxLongNumber = 'EXCLUDE' then '0' when CustomerTaxType.BPTaxLongNumber <> '0' then CustomerTaxType.BPTaxLongNumber else OTC.VATRegistration end as CustomerTaxID5 AS VATRegistrationendasCustomerTaxID5,
case when Acdoca.FinancialAccountType <> 'K' then '0' when Acdoca.Supplier <> '' and Bseg.VATRegistration <> '' and BsegStcegCountry.IsEuropeanUnionMember = 'X' then case when BsegStcegCountry.Country = 'BG' then replace(Bseg.VATRegistration, 'BG', '10') else cast(concat('11', Bseg.VATRegistration) as bptaxnumxl) end when Acdoca.Supplier = '' or SupplierTaxType.BPTaxLongNumber = 'EXCLUDE' then '0' when SupplierTaxType.BPTaxLongNumber <> '0' then SupplierTaxType.BPTaxLongNumber else OTS.VATRegistration end as SupplierTaxID5 AS VATRegistrationendasSupplierTaxID5,
cast ('EUR' as fis_hwaer ) AS ReportingCurrency,
currency_conversion(amount => Acdoca.AmountInCompanyCodeCurrency, source_currency => Acdoca.CompanyCodeCurrency, target_currency =>ReportingCurrency, exchange_rate_date => Acdoca.PostingDate) as AmountInReportingCurrency AS PostingDateasAmountInReportingCurrency,
Acdoca.TransactionCurrency AS TransactionCurrency,
Acdoca.LogicalSystem AS LogicalSystem,
Bkpf.TransactionCode AS TransactionCode
FROM I_JournalEntryItem AS Acdoca
INNER JOIN I_JournalEntry AS Bkpf 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