C_MX_JrnlEntryOperationalViewC is a Consumption CDS View (Cube) that provides data about "Journal Entries Items Cube" in SAP S/4HANA. It reads from 1 data source (I_JournalEntryOperationalView) and exposes 28 fields with key fields SourceLedger, Ledger, CompanyCode, FiscalYear, AccountingDocument. It has 2 associations to related views.
@AbapCatalog.sqlViewName: 'CMXJEDETAILSC'
@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Journal Entries Items Cube'
@AbapCatalog.preserveKey:true@Analytics: { dataCategory: #CUBE }@VDM.viewType: #CONSUMPTION@ClientHandling.algorithm: #SESSION_VARIABLE@ObjectModel.usageType: { sizeCategory: #XL , serviceQuality: #D, dataClass: #MIXED }@Metadata: {
ignorePropagatedAnnotations:true,
allowExtensions: true
}@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED@Analytics.internalName:#LOCALdefineview C_MX_JrnlEntryOperationalViewC
withparameters@EndUserText.label: 'Alternative Account'
P_AlternativeGLAccount : figlmx_prim
asselectfrom I_JournalEntryOperationalView as DocumentItem
association [0..*] to I_StRpJournalEntryHeaderLog as _ReportedItemsLog on _ReportedItemsLog.CompanyCode = DocumentItem.CompanyCode
and _ReportedItemsLog.FiscalYear = DocumentItem.FiscalYear
and _ReportedItemsLog.AccountingDocument = DocumentItem.AccountingDocument
association [0..1] to I_MX_ExtPaymentMethodMapping as _ExtPaymentMethodMapping on _ExtPaymentMethodMapping.PaymentMethod = $projection.PaymentMethod
{
key DocumentItem.SourceLedger,
key DocumentItem.Ledger,
key DocumentItem.CompanyCode,
keycast( DocumentItem.FiscalYear as fis_gjahr_no_conv preserving type ) as FiscalYear,
key DocumentItem.AccountingDocument,
key DocumentItem.LedgerGLLineItem,
key _ReportedItemsLog.StatryRptgEntity,
key _ReportedItemsLog.StatryRptCategory,
key _ReportedItemsLog.StatryRptRunID,
DocumentItem.AccountingDocumentItem,
cast( case $parameters.P_AlternativeGLAccount
when 'X' then DocumentItem.AlternativeGLAccount
else DocumentItem.GLAccount
endas fis_racct preserving type) as GLAccount,
cast( case $parameters.P_AlternativeGLAccount
when 'X' then
( casewhen DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName = '' or
DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName isnullthen 'Sin descripción'
else DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName
end )
else ( casewhen DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName = '' or
DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName isnullthen 'Sin descripción'
else DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName
end )
endas txt50_skat preserving type) as GLAccountLongName,
cast( case DocumentItem.DocumentItemText
when '' then 'Sin descripción'
else DocumentItem.DocumentItemText
endas farp_sgtxt preserving type) as DocumentItemText,
/* This CAST operation had the 'preserving type' removed because it causes error during migrations and installations of the S4HANA */cast( case DocumentItem._JournalEntry.AccountingDocumentHeaderText
when '' then
( casewhen DocumentItem. _JournalEntry.DocumentReferenceID = '' or DocumentItem._JournalEntry.DocumentReferenceID isnullthen 'Sin descripción'
else DocumentItem._JournalEntry.DocumentReferenceID
end )
else _JournalEntry.AccountingDocumentHeaderText endas bktxt) as AccountingDocumentHeaderText,
DocumentItem._JournalEntry.DocumentReferenceID,
DocumentItem.ChartOfAccounts,
DocumentItem.FiscalPeriod,
DocumentItem.PostingDate,
DocumentItem.DocumentDate,
DocumentItem.AccountingDocumentType,
DocumentItem.AssignmentReference,
DocumentItem.AccountingDocumentCategory,
DocumentItem.PaymentMethod,
_ExtPaymentMethodMapping.MX_ExternalPaymentMethod as MX_ExternalPaymentMethod,
DocumentItem.Supplier,
DocumentItem.Customer,
DocumentItem.TaxCode,
DocumentItem.BusinessPlace,
/* MX_InvoiceReceiptReference.ReferenceDocument as ReferenceDocument,
MX_InvoiceReceiptReference.ReferenceDocumentContext, */@Semantics.currencyCode:true
DocumentItem.CompanyCodeCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast ( DocumentItem.DebitAmountInCoCodeCrcy as fis_dr_hsl preserving type ) as DebitAmountInCoCodeCrcy,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast ( DocumentItem.CreditAmountInCoCodeCrcy as fis_cr_hsl preserving type) as CreditAmountInCoCodeCrcy,
@Semantics.currencyCode:truecast( 'MXN' as glo_reporting_currency ) as ReportingCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'ReportingCurrency'} }
cast( casewhen DocumentItem.CompanyCodeCurrency = 'MXN' then DocumentItem.DebitAmountInCoCodeCrcy
when DocumentItem.GlobalCurrency = 'MXN' then DocumentItem.DebitAmountInGlobalCrcy
when DocumentItem.TransactionCurrency = 'MXN' then DocumentItem.DebitAmountInTransCrcy
when DocumentItem.FreeDefinedCurrency1 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy1
when DocumentItem.FreeDefinedCurrency2 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy2
when DocumentItem.FreeDefinedCurrency3 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy3
when DocumentItem.FreeDefinedCurrency4 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy4
when DocumentItem.FreeDefinedCurrency5 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy5
when DocumentItem.FreeDefinedCurrency6 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy6
when DocumentItem.FreeDefinedCurrency7 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy7
when DocumentItem.FreeDefinedCurrency8 = 'MXN' then DocumentItem.DebitAmountInFreeDefinedCrcy8
else 0
endas glo_debit_amount_rptg_crcy preserving type ) as DebitAmountInReportingCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'ReportingCurrency'} }
cast( casewhen DocumentItem.CompanyCodeCurrency = 'MXN' then DocumentItem.CreditAmountInCoCodeCrcy
when DocumentItem.GlobalCurrency = 'MXN' then DocumentItem.CreditAmountInGlobalCrcy
when DocumentItem.TransactionCurrency = 'MXN' then DocumentItem.CreditAmountInTransCrcy
when DocumentItem.FreeDefinedCurrency1 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy1
when DocumentItem.FreeDefinedCurrency2 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy2
when DocumentItem.FreeDefinedCurrency3 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy3
when DocumentItem.FreeDefinedCurrency4 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy4
when DocumentItem.FreeDefinedCurrency5 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy5
when DocumentItem.FreeDefinedCurrency6 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy6
when DocumentItem.FreeDefinedCurrency7 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy7
when DocumentItem.FreeDefinedCurrency8 = 'MXN' then DocumentItem.CreditAmountInFreeDefinedCrcy8
else 0
endas glo_credit_amount_rptg_crcy preserving type ) as CreditAmountInReportingCrcy
}
where
DocumentItem.AccountingDocumentCategory <> 'S' --Noted Items