I_FinSGLDocumentReference

DDL: I_FINSGLDOCUMENTREFERENCE Type: view_entity BASIC

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)

SourceAliasJoin Type
gle_fdocref _doc from
bkpf _header inner

Associations (3)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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]
;