P_CL_GLAccountBalance

DDL: P_CL_GLACCOUNTBALANCE Type: view_entity CONSUMPTION Package: GLO_FIN_IS_CL

GL Account Balance in Reporting Currency for Chile

P_CL_GLAccountBalance is a Consumption CDS View that provides data about "GL Account Balance in Reporting Currency for Chile" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemRawData) and exposes 78 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 1 association to related views. Part of development package GLO_FIN_IS_CL.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItemRawData GLAccountLineItem from

Parameters (1)

NameTypeDefault
P_ReportingCurrency glo_reporting_currency

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_Currency _ReportingCurrency _ReportingCurrency.Currency = $parameters.P_ReportingCurrency

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.private true view
VDM.viewType #CONSUMPTION view

Fields (78)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger SourceLedger
KEY CompanyCode CompanyCode
KEY FiscalYear FiscalYear
KEY AccountingDocument AccountingDocument
KEY LedgerGLLineItem LedgerGLLineItem
LedgerFiscalYear LedgerFiscalYear
ChartOfAccounts ChartOfAccounts
ControllingArea ControllingArea
FinancialTransactionType FinancialTransactionType
GLBusinessTransactionType GLBusinessTransactionType
BusinessTransactionCategory BusinessTransactionCategory
BusinessTransactionType BusinessTransactionType
ReferenceDocumentType ReferenceDocumentType
ReferenceDocumentContext ReferenceDocumentContext
ReferenceDocument ReferenceDocument
ReferenceDocumentItem ReferenceDocumentItem
ReferenceDocumentItemGroup ReferenceDocumentItemGroup
OffsettingLedgerGLLineItem OffsettingLedgerGLLineItem
IsReversal IsReversal
IsReversed IsReversed
ReversalReferenceDocumentType ReversalReferenceDocumentType
ReversalReferenceDocumentCntxt ReversalReferenceDocumentCntxt
ReversalReferenceDocument ReversalReferenceDocument
ReversalTransactionSubitem ReversalTransactionSubitem
IsSettlement IsSettlement
IsSettled IsSettled
GLRecordType GLRecordType
GLAccount GLAccount
CostCenter CostCenter
ProfitCenter ProfitCenter
FunctionalArea FunctionalArea
BusinessArea BusinessArea
Segment Segment
DebitCreditCode DebitCreditCode
FiscalPeriod FiscalPeriod
FiscalYearVariant FiscalYearVariant
FiscalYearPeriod FiscalYearPeriod
PostingDate PostingDate
DocumentDate DocumentDate
AccountingDocumentType AccountingDocumentType
AccountingDocumentItem AccountingDocumentItem
AssignmentReference AssignmentReference
AccountingDocumentCategory AccountingDocumentCategory
JournalEntryItemCategory JournalEntryItemCategory
PostingKey PostingKey
TransactionTypeDetermination TransactionTypeDetermination
SubLedgerAcctLineItemType SubLedgerAcctLineItemType
AccountingDocCreatedByUser AccountingDocCreatedByUser
LastChangeDateTime LastChangeDateTime
CreationDateTime CreationDateTime
CreationDate CreationDate
GLAccountType GLAccountType
AlternativeGLAccount AlternativeGLAccount
CountryChartOfAccounts CountryChartOfAccounts
InvoiceReference InvoiceReference
InvoiceReferenceFiscalYear InvoiceReferenceFiscalYear
FollowOnDocumentType FollowOnDocumentType
InvoiceItemReference InvoiceItemReference
ReferencePurchaseOrderCategory ReferencePurchaseOrderCategory
PurchasingDocument PurchasingDocument
PurchasingDocumentItem PurchasingDocumentItem
AccountAssignmentNumber AccountAssignmentNumber
DocumentItemText DocumentItemText
SalesDocument SalesDocument
SalesDocumentItem SalesDocumentItem
Product Product
Plant Plant
Supplier Supplier
Customer Customer
ExchangeRateDate ExchangeRateDate
FinancialAccountType FinancialAccountType
SpecialGLCode SpecialGLCode
ClearingDate ClearingDate
ClearingJournalEntryFiscalYear ClearingJournalEntryFiscalYear
ClearingJournalEntry ClearingJournalEntry
ReportingCurrency
_ReportingCurrency _ReportingCurrency
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
@AccessControl.authorizationCheck: #NOT_REQUIRED

@ObjectModel.usageType: { serviceQuality: #D, sizeCategory: #XXL, dataClass: #TRANSACTIONAL }

@VDM.private: true
@VDM.viewType: #CONSUMPTION

define view entity P_CL_GLAccountBalance
  with parameters
    P_ReportingCurrency : glo_reporting_currency

  as select from I_GLAccountLineItemRawData as GLAccountLineItem

  association [0..1] to I_Currency as _ReportingCurrency on _ReportingCurrency.Currency = $parameters.P_ReportingCurrency

{
  key SourceLedger,
  key CompanyCode,
  key FiscalYear,
  key AccountingDocument,
  key LedgerGLLineItem,

      LedgerFiscalYear,
      ChartOfAccounts,
      ControllingArea,
      FinancialTransactionType,
      GLBusinessTransactionType,
      BusinessTransactionCategory,
      BusinessTransactionType,
      ReferenceDocumentType,
      ReferenceDocumentContext,
      ReferenceDocument,
      ReferenceDocumentItem,
      ReferenceDocumentItemGroup,
      OffsettingLedgerGLLineItem,
      IsReversal,
      IsReversed,
      ReversalReferenceDocumentType,
      ReversalReferenceDocumentCntxt,
      ReversalReferenceDocument,
      ReversalTransactionSubitem,
      IsSettlement,
      IsSettled,
      GLRecordType,
      GLAccount,
      CostCenter,
      ProfitCenter,
      FunctionalArea,
      BusinessArea,
      Segment,
      DebitCreditCode,
      FiscalPeriod,
      FiscalYearVariant,
      FiscalYearPeriod,
      PostingDate,
      DocumentDate,
      AccountingDocumentType,
      AccountingDocumentItem,
      AssignmentReference,
      AccountingDocumentCategory,
      JournalEntryItemCategory,
      PostingKey,
      TransactionTypeDetermination,
      SubLedgerAcctLineItemType,
      AccountingDocCreatedByUser,
      LastChangeDateTime,
      CreationDateTime,
      CreationDate,
      GLAccountType,
      AlternativeGLAccount,
      CountryChartOfAccounts,
      InvoiceReference,
      InvoiceReferenceFiscalYear,
      FollowOnDocumentType,
      InvoiceItemReference,
      ReferencePurchaseOrderCategory,
      PurchasingDocument,
      PurchasingDocumentItem,
      AccountAssignmentNumber,
      DocumentItemText,
      SalesDocument,
      SalesDocumentItem,
      Product,
      Plant,
      Supplier,
      Customer,
      ExchangeRateDate,
      FinancialAccountType,
      SpecialGLCode,
      ClearingDate,
      ClearingJournalEntryFiscalYear,
      ClearingJournalEntry,

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

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        case $parameters.P_ReportingCurrency
          when CompanyCodeCurrency
            then AmountInCompanyCodeCurrency
          when GlobalCurrency
            then AmountInGlobalCurrency
          when FreeDefinedCurrency1
            then AmountInFreeDefinedCurrency1
          when FreeDefinedCurrency2
            then AmountInFreeDefinedCurrency2
          when FreeDefinedCurrency3
            then AmountInFreeDefinedCurrency3
          when FreeDefinedCurrency4
            then AmountInFreeDefinedCurrency4
          when FreeDefinedCurrency5
            then AmountInFreeDefinedCurrency5
          when FreeDefinedCurrency6
            then AmountInFreeDefinedCurrency6
          when FreeDefinedCurrency7
            then AmountInFreeDefinedCurrency7
          when FreeDefinedCurrency8
            then AmountInFreeDefinedCurrency8
          when BalanceTransactionCurrency
            then AmountInBalanceTransacCrcy
          when TransactionCurrency
            then AmountInTransactionCurrency
          else
            abap.curr'0.00'
        end
      as glo_amount_rptg_crcy)                                                        as AmountInReportingCurrency,

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        case DebitCreditCode
          when 'H'
            then
              case $parameters.P_ReportingCurrency
                when CompanyCodeCurrency
                  then abs(AmountInCompanyCodeCurrency)
                when GlobalCurrency
                  then abs(AmountInGlobalCurrency)
                when FreeDefinedCurrency1
                  then abs(AmountInFreeDefinedCurrency1)
                when FreeDefinedCurrency2
                  then abs(AmountInFreeDefinedCurrency2)
                when FreeDefinedCurrency3
                  then abs(AmountInFreeDefinedCurrency3)
                when FreeDefinedCurrency4
                  then abs(AmountInFreeDefinedCurrency4)
                when FreeDefinedCurrency5
                  then abs(AmountInFreeDefinedCurrency5)
                when FreeDefinedCurrency6
                  then abs(AmountInFreeDefinedCurrency6)
                when FreeDefinedCurrency7
                  then abs(AmountInFreeDefinedCurrency7)
                when FreeDefinedCurrency8
                  then abs(AmountInFreeDefinedCurrency8)
                when BalanceTransactionCurrency
                  then abs(AmountInBalanceTransacCrcy)
                when TransactionCurrency
                  then abs(AmountInTransactionCurrency)
                else
                  abap.curr'0.00'
              end
            else
              abap.curr'0.00'
        end
      as glo_credit_amount_rptg_crcy)                                                 as CreditAmountInReportingCrcy,

      @Aggregation.default: #SUM
      @Semantics.amount.currencyCode: 'ReportingCurrency'
      cast(
        case DebitCreditCode
          when 'S'
            then
              case $parameters.P_ReportingCurrency
                when CompanyCodeCurrency
                  then AmountInCompanyCodeCurrency
                when GlobalCurrency
                  then AmountInGlobalCurrency
                when FreeDefinedCurrency1
                  then AmountInFreeDefinedCurrency1
                when FreeDefinedCurrency2
                  then AmountInFreeDefinedCurrency2
                when FreeDefinedCurrency3
                  then AmountInFreeDefinedCurrency3
                when FreeDefinedCurrency4
                  then AmountInFreeDefinedCurrency4
                when FreeDefinedCurrency5
                  then AmountInFreeDefinedCurrency5
                when FreeDefinedCurrency6
                  then AmountInFreeDefinedCurrency6
                when FreeDefinedCurrency7
                  then AmountInFreeDefinedCurrency7
                when FreeDefinedCurrency8
                  then AmountInFreeDefinedCurrency8
                when BalanceTransactionCurrency
                  then AmountInBalanceTransacCrcy
                when TransactionCurrency
                  then AmountInTransactionCurrency
                else
                  abap.curr'0.00'
              end
            else
              abap.curr'0.00'
        end
      as glo_debit_amount_rptg_crcy)                                                  as DebitAmountInReportingCurrency,

      _ReportingCurrency,
      _GLAccountInChartOfAccounts
}