I_FinSGLDocumentReference

DDL: I_FINSGLDOCUMENTREFERENCE Type: view_entity BASIC Package: ODATA_REVERSE_DOCUMENTS

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. Part of development package ODATA_REVERSE_DOCUMENTS.

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
KEY CompanyCode gle_fdocref bukrs
KEY FiscalYear
KEY AccountingDocument gle_fdocref belnr
FinSGLRunID gle_fdocref runid
ReverseDocumentFiscalYear
ReverseDocument gle_fdocref stblg
ReferenceDocumentType bkpf awtyp
OriginalReferenceDocument bkpf awkey
PostingDate bkpf budat
FiscalPeriod
IntercompanyTransaction bkpf bvorg
AccountingDocumentType bkpf blart
LedgerGroup bkpf ldgrp
PlannedReversalDate bkpf stodt
ReversalReason bkpf stgrd
_CompanyCode _CompanyCode
_JournalEntry _JournalEntry
_FiscalYear _FiscalYear
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED //to be added

@EndUserText.label: 'Document Reference table for Reversal'
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType:#BASIC
@ObjectModel.usageType:{
  serviceQuality: #D,
  sizeCategory: #XL,
  dataClass: #TRANSACTIONAL
}
@ObjectModel.semanticKey:  [ 'FinSGLApplicationKey' , 'CompanyCode', 'FiscalYear', 'AccountingDocument' ]
define view entity I_FinSGLDocumentReference
  as select from gle_fdocref as _doc
    inner join   bkpf        as _header on  _header.belnr = _doc.belnr
                                        and _header.bukrs = _doc.bukrs
                                        and _header.gjahr = _doc.gjahr
  /*Associations*/
  association [0..1] to I_CompanyCode              as _CompanyCode  on  $projection.CompanyCode        = _CompanyCode.CompanyCode
  association [0..1] to I_FiscalYearForCompanyCode as _FiscalYear   on  $projection.FiscalYear         = _FiscalYear.FiscalYear
                                                                    and $projection.CompanyCode        = _FiscalYear.CompanyCode
  association [0..1] to I_JournalEntry             as _JournalEntry on  $projection.CompanyCode        = _JournalEntry.CompanyCode
                                                                    and $projection.FiscalYear         = _JournalEntry.FiscalYear
                                                                    and $projection.AccountingDocument = _JournalEntry.AccountingDocument
{
      @ObjectModel.readOnly:true
  key _doc.applk                                                                                          as FinSGLApplicationKey,
      @ObjectModel.foreignKey.association: '_CompanyCode' 
  key _doc.bukrs                                                                                          as CompanyCode,

      @ObjectModel.foreignKey.association: '_FiscalYear'
  key cast(_doc.gjahr as fis_gjahr preserving type )                                                      as FiscalYear,

      @ObjectModel.foreignKey.association: '_JournalEntry'
  key _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,
      @Semantics.fiscal.period: true
      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,
      _CompanyCode,
      _JournalEntry,
      _FiscalYear
}
where
      _doc.applk = 'ECS'
  and _doc.stblg is initial