P_RO_SAFTCUSTACCTBAL

CDS View

Customer GL Account Balance

P_RO_SAFTCUSTACCTBAL is a CDS View in S/4HANA. Customer GL Account Balance. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_RO_SAFTCustomer view inner CONSUMPTION Customer Data for RO SAFT
@AbapCatalog.sqlViewName: 'PROSAFTCUSTACCB'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.private:true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MASTER
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Customer GL Account Balance'
define view P_RO_SAFTCustAcctBal
  with parameters
    P_FromPostingDate            : dats,
    P_ToPostingDate              : dats,
    P_FiscalYear                 : gjahr,
    P_AlternativeGLAccountIsUsed : saft_ro_alt_gl_account_flag

  as select from           P_RO_SAFTCustAcctBalEnd ( P_ToPostingDate: $parameters.P_ToPostingDate,
                                                    P_FiscalYear: $parameters.P_FiscalYear,
                                                    P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as end_bal

    left outer to one join P_RO_SAFTCustAcctBalMvt( P_FromPostingDate: $parameters.P_FromPostingDate ,
                                                P_ToPostingDate: $parameters.P_ToPostingDate,
                                                P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed )    as bal_mov    on  bal_mov.SourceLedger    = end_bal.SourceLedger
                                                                                                                                          and bal_mov.Ledger          = end_bal.Ledger
                                                                                                                                          and bal_mov.CompanyCode     = end_bal.CompanyCode
                                                                                                                                          and bal_mov.GLAccount       = end_bal.GLAccount
                                                                                                                                          and bal_mov.ChartOfAccounts = end_bal.ChartOfAccounts
                                                                                                                                          and bal_mov.FiscalYear      = end_bal.FiscalYear
                                                                                                                                          and bal_mov.Customer        = end_bal.Customer
                                                                                                                                          and bal_mov.VATRegistration = end_bal.VATRegistration

{
  key end_bal.SourceLedger,
  key end_bal.Ledger,
  key end_bal.CompanyCode,
  key end_bal.Customer,
  key end_bal.GLAccount,
  key end_bal.ChartOfAccounts,
  key end_bal.FiscalYear,
  key end_bal.VATRegistration,

      end_bal.ActiveChartOfAccounts,

      end_bal.ActiveGLAccount,

      end_bal.CompanyCodeCurrency,
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      cast(case
        when bal_mov.DebitAmountInCoCodeCrcy is not null and bal_mov.CreditAmountInCoCodeCrcy is not null
          then ((end_bal.DebitAmountInCoCodeCrcy + end_bal.CreditAmountInCoCodeCrcy)-(bal_mov.DebitAmountInCoCodeCrcy + bal_mov.CreditAmountInCoCodeCrcy))
        else (end_bal.DebitAmountInCoCodeCrcy + end_bal.CreditAmountInCoCodeCrcy)
      end as abap.curr(23,2) )                                                  as StartingBalanceAmtInCoCodeCrcy,

      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      (end_bal.DebitAmountInCoCodeCrcy + end_bal.CreditAmountInCoCodeCrcy)      as EndingBalanceAmtInCoCodeCrcy,
      bal_mov.NumberOfItems
}