I_FinSGLDocumentReference
Document Reference table for Reversal
I_FinSGLDocumentReference is a Basic CDS View that provides data about "Document Reference table for Reversal" in SAP S/4HANA. It reads from 2 data sources (gle_fdocref, bkpf) and exposes 19 fields with key fields FinSGLApplicationKey, CompanyCode, FiscalYear, AccountingDocument. It has 3 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| gle_fdocref | _doc | from |
| bkpf | _header | inner |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_CompanyCode | _CompanyCode | $projection.CompanyCode = _CompanyCode.CompanyCode |
| [0..1] | I_FiscalYearForCompanyCode | _FiscalYear | $projection.FiscalYear = _FiscalYear.FiscalYear and $projection.CompanyCode = _FiscalYear.CompanyCode |
| [0..1] | I_JournalEntry | _JournalEntry | $projection.CompanyCode = _JournalEntry.CompanyCode and $projection.FiscalYear = _JournalEntry.FiscalYear and $projection.AccountingDocument = _JournalEntry.AccountingDocument |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Document Reference table for Reversal | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| VDM.viewType | #BASIC | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | FinSGLApplicationKey | gle_fdocref | applk | ApplicationArea |
| KEY | CompanyCode | gle_fdocref | bukrs | Value |
| KEY | FiscalYear | |||
| KEY | AccountingDocument | gle_fdocref | belnr | SD Document |
| FinSGLRunID | gle_fdocref | runid | UUID | |
| ReverseDocumentFiscalYear | ||||
| ReverseDocument | gle_fdocref | stblg | Reversed With | |
| ReferenceDocumentType | bkpf | awtyp | Reference Document Type | |
| OriginalReferenceDocument | bkpf | awkey | RefKey GJE | |
| PostingDate | bkpf | budat | Posting Date | |
| FiscalPeriod | ||||
| IntercompanyTransaction | bkpf | bvorg | Intercompany Transac | |
| AccountingDocumentType | bkpf | blart | Rep. rec. doc. type | |
| LedgerGroup | bkpf | ldgrp | Target Ledger Group | |
| PlannedReversalDate | bkpf | stodt | Reversal Date | |
| ReversalReason | bkpf | stgrd | Reversal Reason | |
| _CompanyCode | _CompanyCode | |||
| _JournalEntry | _JournalEntry | |||
| _FiscalYear | _FiscalYear |
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_FinSGLDocumentReference.
-- 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_FinSGLDocumentReference AS
SELECT
_doc.applk AS FinSGLApplicationKey,
_doc.bukrs AS CompanyCode,
cast(_doc.gjahr as fis_gjahr preserving type ) AS FiscalYear,
_doc.belnr AS AccountingDocument,
_doc.runid AS FinSGLRunID,
cast(_doc.stjah as fis_stjah preserving type ) AS ReverseDocumentFiscalYear,
_doc.stblg AS ReverseDocument,
_header.awtyp AS ReferenceDocumentType,
_header.awkey AS OriginalReferenceDocument,
_header.budat AS PostingDate,
cast( cast( concat( '0', _header.monat ) as abap.numc( 3 ) ) as fins_fiscalperiod preserving type ) AS FiscalPeriod,
_header.bvorg AS IntercompanyTransaction,
_header.blart AS AccountingDocumentType,
_header.ldgrp AS LedgerGroup,
_header.stodt AS PlannedReversalDate,
_header.stgrd AS ReversalReason
FROM gle_fdocref AS _doc
INNER JOIN bkpf AS _header ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_FiscalYearForCompanyCode AS _FiscalYear ON FiscalYear = _FiscalYear.FiscalYear AND CompanyCode = _FiscalYear.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_JournalEntry AS _JournalEntry ON CompanyCode = _JournalEntry.CompanyCode AND FiscalYear = _JournalEntry.FiscalYear AND AccountingDocument = _JournalEntry.AccountingDocument -- 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