R_MANAGEJOURNALENTRYHISTORY

CDS View

Journal Entry - History

R_MANAGEJOURNALENTRYHISTORY is a CDS View in S/4HANA. Journal Entry - History. It contains 24 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
C_ManageJournalEntryHistory view_entity from CONSUMPTION Journal Entry History

Fields (24)

KeyField CDS FieldsUsed in Views
KEY AccountingDocument AccountingDocument 1
KEY ChangeDocDatabaseTableField ChangeDocDatabaseTableField 1
KEY ChangeDocTableKey ChangeDocTableKey 1
KEY ChangeDocument ChangeDocument 1
KEY CompanyCode CompanyCode 1
KEY DatabaseTable DatabaseTable 1
KEY FiscalYear FiscalYear 1
KEY JournalEntryItem JournalEntryItem 1
KEY Ledger Ledger 1
AccountingDocumentCategory AccountingDocumentCategory 1
AccountingDocumentType AccountingDocumentType 1
ChangedBy ChangedBy 1
ChangedFieldNewValue ChangedFieldNewValue 1
ChangedFieldOldValue ChangedFieldOldValue 1
CreationDate CreationDate 1
CreationDateTime CreationDateTime 1
CreationTime CreationTime 1
DatabaseTableFieldName DatabaseTableFieldName 1
DocumentDate DocumentDate 1
LastChangeDateTime LastChangeDateTime 1
LastChangedDate LastChangedDate 1
LastChangeTime LastChangeTime 1
LedgerName LedgerName 1
PostingDate PostingDate 1
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Journal Entry - History'
@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.usageType:{
  serviceQuality: #D,
  sizeCategory: #XL,
  dataClass: #MIXED
}

@VDM: {
  viewType: #TRANSACTIONAL,
  lifecycle.contract.type:#SAP_INTERNAL_API
}

@AccessControl.privilegedAssociations: ['_ChangedByContactCard']

define view entity R_ManageJournalEntryHistory

  as select from R_MngJrnlEntrChangeDocument as _Change

  association [0..1] to I_JournalFieldElementText as _FieldText            on  _Change.DatabaseTable                = _FieldText.DatabaseTable
                                                                           and _Change.ChangeDocDatabaseTableField  = _FieldText.DatabaseTableFieldName
                                                                           and _FieldText.Language                  = $session.system_language

  association [0..1] to I_DataElementLabelText    as _DeleText             on  _Change.ChangeDocDatabaseTableField  = _DeleText.ABAPDataElement
                                                                           and _DeleText.Language                   = $session.system_language

  association [0..1] to I_CompanyCode             as _CompanyCode          on  _Change.CompanyCode                  = _CompanyCode.CompanyCode

  association [0..1] to I_UserContactCard         as _ChangedByContactCard on  $projection.ChangedBy                = _ChangedByContactCard.ContactCardID

  association [0..1] to I_LedgerText              as _LedgerText           on  _Change.Ledger                       = _LedgerText.Ledger
                                                                           and _LedgerText.Language                 = $session.system_language
  
  association [0..1] to I_AccountingDocumentTypeText  as _AccountingDocumentTypeText    on $projection.AccountingDocumentType = _AccountingDocumentTypeText.AccountingDocumentType
                                                                                        and _AccountingDocumentTypeText.Language = $session.system_language
    
  association [0..1] to I_AccountingDocumentCategoryT as _AccountingDocumentCategoryT   on $projection.AccountingDocumentCategory = _AccountingDocumentCategoryT.AccountingDocumentCategory
                                                                                        and _AccountingDocumentCategoryT.Language = $session.system_language                                                                            

{
  key _Change.CompanyCode,
  key _Change.Ledger,
  key _Change.AccountingDocument,
  key _Change.ChangeDocument,
  key _Change.DatabaseTable,
  key _Change.ChangeDocTableKey,
  key _Change.ChangeDocDatabaseTableField,
  key _Change.JournalEntryItem,
  key _Change.FiscalYear,
      _Change.DocumentDate,
      _Change.PostingDate,
      _Change.ChangedBy,
      _Change.LastChangeTime,
      cast( _Change.ChangedFieldOldValue as fac_mje_fieldval_old preserving type ) as ChangedFieldOldValue,
      cast( _Change.ChangedFieldNewValue as fac_mje_fieldval_new preserving type ) as ChangedFieldNewValue,
      _Change.LastChangedDate,
      _Change.CreationDate,
      _Change.CreationTime,
      case when
        _FieldText.ABAPMediumFieldLabel <> '' then _FieldText.ABAPMediumFieldLabel
      else
        _DeleText.ABAPDataElementDescription
       end                                                               as DatabaseTableFieldName,
      cast(
        dats_tims_to_tstmp(
          _Change.LastChangedDate,
          _Change.LastChangeTime,
          abap_system_timezone( $session.client,'NULL' ),
          $session.client, 'NULL' ) as vdm_creationdatetime)             as LastChangeDateTime,
      cast(
        dats_tims_to_tstmp(
          _Change.CreationDate,
          _Change.CreationTime,
          abap_system_timezone( $session.client,'NULL' ),
          $session.client, 'NULL' ) as vdm_creationdatetime)             as CreationDateTime,          
      _CompanyCode.CompanyCodeName,
      _LedgerText.LedgerName,
      AccountingDocumentType,
      cast(AccountingDocumentCategory as fis_bstat preserving type ) as AccountingDocumentCategory,
      _ChangedByContactCard,
      _AccountingDocumentTypeText,
      _AccountingDocumentCategoryT
}