P_CL_JournalEntryItemDocAmount

DDL: P_CL_JOURNALENTRYITEMDOCAMOUNT SQL: PCLJEITMDOCAMT Type: view CONSUMPTION Package: GLO_FIN_IS_CL

Journal Entry Items with Doc Amt

P_CL_JournalEntryItemDocAmount is a Consumption CDS View that provides data about "Journal Entry Items with Doc Amt" in SAP S/4HANA. It reads from 3 data sources (I_JournalEntry, I_JournalEntryItem, I_StRpJournalEntryHeaderLog) and exposes 13 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem, Ledger. It has 1 association to related views. Part of development package GLO_FIN_IS_CL.

Data Sources (3)

SourceAliasJoin Type
I_JournalEntry I_JournalEntry from
I_JournalEntryItem I_JournalEntryItem inner
I_StRpJournalEntryHeaderLog I_StRpJournalEntryHeaderLog inner

Parameters (1)

NameTypeDefault
P_ReportingCurrency glo_reporting_currency

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_Currency _ReportingCurrency _ReportingCurrency.Currency = ReportingCurrency

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCLJEITMDOCAMT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode
KEY FiscalYear I_JournalEntry FiscalYear
KEY AccountingDocument I_JournalEntry AccountingDocument
KEY LedgerGLLineItem I_JournalEntryItem LedgerGLLineItem
KEY Ledger I_JournalEntryItem Ledger
KEY StatryRptgEntity I_StRpJournalEntryHeaderLog StatryRptgEntity
KEY StatryRptCategory I_StRpJournalEntryHeaderLog StatryRptCategory
KEY StatryRptRunID I_StRpJournalEntryHeaderLog StatryRptRunID
CL_ReportingDocumentType I_CL_DocTypeVchrTypeAssgmt CL_ReportingDocumentType
PostingDate I_JournalEntry PostingDate
AccountingDocumentHeaderText I_JournalEntry AccountingDocumentHeaderText
ReportingCurrency
_ReportingCurrency _ReportingCurrency
@AbapCatalog.sqlViewName: 'PCLJEITMDOCAMT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_CL_JournalEntryItemDocAmount
  with parameters
    P_ReportingCurrency : glo_reporting_currency

  as select from           I_JournalEntry

    inner join             I_JournalEntryItem         on  I_JournalEntry.CompanyCode        = I_JournalEntryItem.CompanyCode
                                                      and I_JournalEntry.FiscalYear         = I_JournalEntryItem.FiscalYear
                                                      and I_JournalEntry.AccountingDocument = I_JournalEntryItem.AccountingDocument

    inner join             I_StRpJournalEntryHeaderLog on  I_JournalEntry.CompanyCode        = I_StRpJournalEntryHeaderLog.CompanyCode
                                                       and I_JournalEntry.AccountingDocument = I_StRpJournalEntryHeaderLog.AccountingDocument
                                                       and I_JournalEntry.FiscalYear         = I_StRpJournalEntryHeaderLog.FiscalYear

    left outer to one join I_CL_DocTypeVchrTypeAssgmt on  I_CL_DocTypeVchrTypeAssgmt.Country    = 'CL'
                                                      and I_JournalEntry.CompanyCode            = I_CL_DocTypeVchrTypeAssgmt.CompanyCode
                                                      and I_JournalEntry.AccountingDocumentType = I_CL_DocTypeVchrTypeAssgmt.AccountingDocumentType

  association [0..1] to I_Currency as _ReportingCurrency on _ReportingCurrency.Currency = ReportingCurrency
{
  key I_JournalEntry.CompanyCode,
  key I_JournalEntry.FiscalYear,
  key I_JournalEntry.AccountingDocument,
  key I_JournalEntryItem.LedgerGLLineItem,
  key I_JournalEntryItem.Ledger,
  key I_StRpJournalEntryHeaderLog.StatryRptgEntity,
  key I_StRpJournalEntryHeaderLog.StatryRptCategory,
  key I_StRpJournalEntryHeaderLog.StatryRptRunID,
      I_CL_DocTypeVchrTypeAssgmt.CL_ReportingDocumentType,
      I_JournalEntry.PostingDate,
      I_JournalEntry.AccountingDocumentHeaderText,

      @ObjectModel.foreignKey.association: '_ReportingCurrency'
      @Semantics.currencyCode:true
      cast( $parameters.P_ReportingCurrency as glo_reporting_currency preserving type ) as ReportingCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast( case $parameters.P_ReportingCurrency
              when I_JournalEntryItem.CompanyCodeCurrency
                then I_JournalEntryItem.DebitAmountInCoCodeCrcy
              when I_JournalEntryItem.TransactionCurrency
                then I_JournalEntryItem.DebitAmountInTransCrcy
              when I_JournalEntryItem.GlobalCurrency
                then I_JournalEntryItem.DebitAmountInGlobalCrcy
              when I_JournalEntryItem.BalanceTransactionCurrency
                then I_JournalEntryItem.DebitAmountInBalanceTransCrcy
              when I_JournalEntryItem.FreeDefinedCurrency1
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy1
              when I_JournalEntryItem.FreeDefinedCurrency2
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy2
              when I_JournalEntryItem.FreeDefinedCurrency3
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy3
              when I_JournalEntryItem.FreeDefinedCurrency4
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy4
              when I_JournalEntryItem.FreeDefinedCurrency5
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy5
              when I_JournalEntryItem.FreeDefinedCurrency6
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy6
              when I_JournalEntryItem.FreeDefinedCurrency7
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy7
              when I_JournalEntryItem.FreeDefinedCurrency8
                then I_JournalEntryItem.DebitAmountInFreeDefinedCrcy8
              else
                0
            end
      as glo_debit_amount_rptg_crcy preserving type )                                   as DebitAmountInReportingCurrency,
      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast( case $parameters.P_ReportingCurrency
              when I_JournalEntryItem.CompanyCodeCurrency
                then abs(I_JournalEntryItem.CreditAmountInCoCodeCrcy)
              when I_JournalEntryItem.TransactionCurrency
                then abs(I_JournalEntryItem.CreditAmountInTransCrcy)
              when I_JournalEntryItem.GlobalCurrency
                then abs(I_JournalEntryItem.CreditAmountInGlobalCrcy)
              when I_JournalEntryItem.BalanceTransactionCurrency
                then abs(I_JournalEntryItem.CreditAmountInBalanceTransCrcy)
              when I_JournalEntryItem.FreeDefinedCurrency1
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy1)
              when I_JournalEntryItem.FreeDefinedCurrency2
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy2)
              when I_JournalEntryItem.FreeDefinedCurrency3
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy3)
              when I_JournalEntryItem.FreeDefinedCurrency4
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy4)
              when I_JournalEntryItem.FreeDefinedCurrency5
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy5)
              when I_JournalEntryItem.FreeDefinedCurrency6
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy6)
              when I_JournalEntryItem.FreeDefinedCurrency7
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy7)
              when I_JournalEntryItem.FreeDefinedCurrency8
                then abs(I_JournalEntryItem.CreditAmountInFreeDefinedCrcy8)
              else
                0
            end
      as glo_credit_amount_rptg_crcy preserving type )                                   as CreditAmountInReportingCrcy,      
      _ReportingCurrency
}