C_MX_JrnlEntryOperationalViewC

DDL: C_MX_JRNLENTRYOPERATIONALVIEWC SQL: CMXJEDETAILSC Type: view CONSUMPTION

Journal Entries Items Cube

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.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntryOperationalView DocumentItem from

Parameters (1)

NameTypeDefault
P_AlternativeGLAccount figlmx_prim

Associations (2)

CardinalityTargetAliasCondition
[0..*] I_StRpJournalEntryHeaderLog _ReportedItemsLog _ReportedItemsLog.CompanyCode = DocumentItem.CompanyCode and _ReportedItemsLog.FiscalYear = DocumentItem.FiscalYear and _ReportedItemsLog.AccountingDocument = DocumentItem.AccountingDocument
[0..1] I_MX_ExtPaymentMethodMapping _ExtPaymentMethodMapping _ExtPaymentMethodMapping.PaymentMethod = $projection.PaymentMethod

Annotations (15)

NameValueLevelField
AbapCatalog.sqlViewName CMXJEDETAILSC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Journal Entries Items Cube view
AbapCatalog.preserveKey true view
Analytics.dataCategory #CUBE view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
Analytics.internalName #LOCAL view

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_JournalEntryOperationalView SourceLedger
KEY Ledger I_JournalEntryOperationalView Ledger
KEY CompanyCode I_JournalEntryOperationalView CompanyCode
KEY FiscalYear
KEY AccountingDocument I_JournalEntryOperationalView AccountingDocument
KEY LedgerGLLineItem I_JournalEntryOperationalView LedgerGLLineItem
KEY StatryRptgEntity _ReportedItemsLog StatryRptgEntity
KEY StatryRptCategory _ReportedItemsLog StatryRptCategory
KEY StatryRptRunID _ReportedItemsLog StatryRptRunID
AccountingDocumentItem I_JournalEntryOperationalView AccountingDocumentItem
DocumentReferenceID
ChartOfAccounts I_JournalEntryOperationalView ChartOfAccounts
FiscalPeriod I_JournalEntryOperationalView FiscalPeriod
PostingDate I_JournalEntryOperationalView PostingDate
DocumentDate I_JournalEntryOperationalView DocumentDate
AccountingDocumentType I_JournalEntryOperationalView AccountingDocumentType
AssignmentReference I_JournalEntryOperationalView AssignmentReference
AccountingDocumentCategory I_JournalEntryOperationalView AccountingDocumentCategory
PaymentMethod I_JournalEntryOperationalView PaymentMethod
MX_ExternalPaymentMethod _ExtPaymentMethodMapping MX_ExternalPaymentMethod
Supplier I_JournalEntryOperationalView Supplier
Customer I_JournalEntryOperationalView Customer
TaxCode I_JournalEntryOperationalView TaxCode
BusinessPlace I_JournalEntryOperationalView BusinessPlace
CompanyCodeCurrency I_JournalEntryOperationalView CompanyCodeCurrency
DebitAmountInCoCodeCrcy
CreditAmountInCoCodeCrcy
ReportingCurrency
@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:#LOCAL

define view C_MX_JrnlEntryOperationalViewC
  with parameters
    @EndUserText.label: 'Alternative Account'
    P_AlternativeGLAccount : figlmx_prim

  as select from 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,
  key cast( 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
            end as fis_racct preserving type)                                     as GLAccount,

      cast( case $parameters.P_AlternativeGLAccount
              when 'X' then
                ( case
                    when DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName = '' or
                         DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName is null then 'Sin descripción'
                    else DocumentItem._AlternativeGLAccount._Text[1:Language = $session.system_language].GLAccountLongName
                  end )
              else ( case
                       when DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName = '' or
                            DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName is null then 'Sin descripción'
                       else DocumentItem._GLAccountInChartOfAccounts._Text[1:Language = $session.system_language].GLAccountLongName
                     end )
            end as txt50_skat preserving type)                                    as GLAccountLongName,

      cast( case DocumentItem.DocumentItemText
        when '' then 'Sin descripción'
        else DocumentItem.DocumentItemText
      end as 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
              ( case
                  when DocumentItem. _JournalEntry.DocumentReferenceID = '' or DocumentItem._JournalEntry.DocumentReferenceID is null
                  then 'Sin descripción'
                  else DocumentItem._JournalEntry.DocumentReferenceID
                end )
              else _JournalEntry.AccountingDocumentHeaderText end as 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:true
      cast( 'MXN' as glo_reporting_currency )                                     as ReportingCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'ReportingCurrency'} }
      cast( case
         when 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
       end as glo_debit_amount_rptg_crcy preserving type )                        as DebitAmountInReportingCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'ReportingCurrency'} }
      cast( case
        when 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
      end as glo_credit_amount_rptg_crcy preserving type )                        as CreditAmountInReportingCrcy
}
where
  DocumentItem.AccountingDocumentCategory <> 'S' --Noted Items