P_MngJrnlEntryLedgerViewAmount

DDL: P_MNGJRNLENTRYLEDGERVIEWAMOUNT Type: view_entity COMPOSITE Package: ODATA_MANAGE_JOURNAL_ENTRY_V2

Journal Entry

P_MngJrnlEntryLedgerViewAmount is a Composite CDS View that provides data about "Journal Entry" in SAP S/4HANA. It reads from 3 data sources (P_MJEJrnlEntrWthRprstvLdgr, I_GLAccountLineItemRawData, I_GLAccountLineItemRawData) and exposes 19 fields with key fields CompanyCode, FiscalYear, AccountingDocument, SourceLedger, FiscalYear. Part of development package ODATA_MANAGE_JOURNAL_ENTRY_V2.

Data Sources (3)

SourceAliasJoin Type
P_MJEJrnlEntrWthRprstvLdgr _JournalEntryRprstvLdgr inner
I_GLAccountLineItemRawData _LineItem from
I_GLAccountLineItemRawData _LineItem union

Annotations (9)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Journal Entry view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view
VDM.private true view
VDM.lifecycle.contract.type #NONE view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY SourceLedger I_GLAccountLineItemRawData SourceLedger
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency
AmountInCompanyCodeCurrency
TransactionCurrency I_GLAccountLineItemRawData TransactionCurrency
AmountInTransactionCurrency
FunctionalCurrency I_GLAccountLineItemRawData FunctionalCurrency
CompanyCode
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY SourceLedger I_GLAccountLineItemRawData SourceLedger
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency
AmountInCompanyCodeCurrency
TransactionCurrency I_GLAccountLineItemRawData TransactionCurrency
AmountInTransactionCurrency
FunctionalCurrency I_GLAccountLineItemRawData FunctionalCurrency
AmountInFunctionalCurrency
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Journal Entry'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #XXL,
  dataClass: #MIXED
}

@VDM: {
  viewType: #COMPOSITE,
  private: true,
  lifecycle.contract.type:#NONE
}
define view entity P_MngJrnlEntryLedgerViewAmount
  as select from I_GLAccountLineItemRawData as _LineItem

  inner join     P_MJEJrnlEntrWthRprstvLdgr  as _JournalEntryRprstvLdgr   on  _LineItem.CompanyCode              = _JournalEntryRprstvLdgr.CompanyCode 
                                                                          and _LineItem.FiscalYear               = _JournalEntryRprstvLdgr.FiscalYear
                                                                          and _LineItem.AccountingDocument       = _JournalEntryRprstvLdgr.AccountingDocument
                                                                          and _LineItem.SourceLedger             = _JournalEntryRprstvLdgr.Ledger

{
  key _LineItem.CompanyCode,
  key _LineItem.FiscalYear,
  key _LineItem.AccountingDocument,
  key _LineItem.SourceLedger,
  
  _LineItem.CompanyCodeCurrency,
  @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
  sum(_LineItem.AmountInCompanyCodeCurrency) as AmountInCompanyCodeCurrency,
  
  _LineItem.TransactionCurrency,
  @Semantics.amount.currencyCode: 'TransactionCurrency'
  sum(_LineItem.AmountInTransactionCurrency) as AmountInTransactionCurrency,
  
  _LineItem.FunctionalCurrency,
  @Semantics.amount.currencyCode: 'FunctionalCurrency'
  sum(_LineItem.AmountInFunctionalCurrency) as AmountInFunctionalCurrency

}
where
 _LineItem.DebitCreditCode = 'S'
 and (
  _LineItem.AccountingDocumentCategory = 'U'
  or
  _LineItem.AccountingDocumentType = 'AA'
 )
 and
 _LineItem.SubLedgerAcctLineItemType <> '01050'
group by
  _LineItem.SourceLedger,
  _LineItem.CompanyCode, 
  _LineItem.FiscalYear, 
  _LineItem.AccountingDocument,
  
  _LineItem.CompanyCodeCurrency, 
  _LineItem.TransactionCurrency,
  _LineItem.FunctionalCurrency
  
union

  select from I_GLAccountLineItemRawData as _LineItem
  
{
  key _LineItem.CompanyCode,
  key _LineItem.FiscalYear,
  key _LineItem.AccountingDocument,
  key _LineItem.SourceLedger,
  
  _LineItem.CompanyCodeCurrency,
  sum(_LineItem.AmountInCompanyCodeCurrency) as AmountInCompanyCodeCurrency,
  
  _LineItem.TransactionCurrency,
  sum(_LineItem.AmountInTransactionCurrency) as AmountInTransactionCurrency,
  
  _LineItem.FunctionalCurrency,
  sum(_LineItem.AmountInFunctionalCurrency) as AmountInFunctionalCurrency

}
where
 _LineItem.DebitCreditCode = 'S'
 and _LineItem._Ledger._PredictionLedger.PredictionLedger is not null
 and _LineItem.AccountingDocumentCategory = 'P'
group by
  _LineItem.SourceLedger,
  _LineItem.CompanyCode, 
  _LineItem.FiscalYear, 
  _LineItem.AccountingDocument,
  
  _LineItem.CompanyCodeCurrency, 
  _LineItem.TransactionCurrency,
  _LineItem.FunctionalCurrency