P_CN_GLAcctPerd

DDL: P_CN_GLACCTPERD SQL: PVCNGLAPERD Type: view CONSUMPTION Package: GLO_FIN_CN

Cartesian Product of G/L Account and Fiscal Period

P_CN_GLAcctPerd is a Consumption CDS View that provides data about "Cartesian Product of G/L Account and Fiscal Period" in SAP S/4HANA. It reads from 3 data sources (I_GLAccountInChartOfAccounts, I_GLAccountInCompanyCode, I_FiscalCalYearPeriodForLedger) and exposes 10 fields with key fields CompanyCode, FiscalYear, FiscalPeriod, Ledger, GLAccount. Part of development package GLO_FIN_CN.

Data Sources (3)

SourceAliasJoin Type
I_GLAccountInChartOfAccounts ChartOfAccounts inner
I_GLAccountInCompanyCode GlAccount inner
I_FiscalCalYearPeriodForLedger Yearperiod from

Parameters (4)

NameTypeDefault
P_CompanyCode fis_bukrs
P_FiscalYear fis_gjahr
P_DisplayAltvAcct figlcn_disalteracct
P_Ledger fis_rldnr

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PVCNGLAPERD view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
Search.searchable true view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #CONSUMPTION view
EndUserText.label Cartesian Product of G/L Account and Fiscal Period view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_FiscalCalYearPeriodForLedger CompanyCode
KEY FiscalYear I_FiscalCalYearPeriodForLedger FiscalYear
KEY FiscalPeriod I_FiscalCalYearPeriodForLedger FiscalPeriod
KEY Ledger I_FiscalCalYearPeriodForLedger Ledger
KEY GLAccount
AlternativeGLAccount I_GLAccountInCompanyCode AlternativeGLAccount
ChartOfAccounts I_GLAccountInChartOfAccounts ChartOfAccounts
GLAccountGroup I_GLAccountInChartOfAccounts GLAccountGroup
AccountIsMarkedForDeletion I_GLAccountInCompanyCode AccountIsMarkedForDeletion
AuthorizationGroup AuthorizationGroup
@AbapCatalog.sqlViewName: 'PVCNGLAPERD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@Search.searchable: true
@ClientHandling.algorithm:#SESSION_VARIABLE
@VDM.private:true
@VDM.viewType: #CONSUMPTION
@EndUserText.label: 'Cartesian Product of G/L Account and Fiscal Period'
define view P_CN_GLAcctPerd   with parameters P_CompanyCode     : fis_bukrs,
                  P_FiscalYear      : fis_gjahr,
                  P_DisplayAltvAcct : figlcn_disalteracct,
                  P_Ledger           : fis_rldnr
//as select from I_FiscalYearPeriodForCmpnyCode as Yearperiod inner join I_GLAccountInCompanyCode as GlAccount

as select from I_FiscalCalYearPeriodForLedger as Yearperiod inner join I_GLAccountInCompanyCode as GlAccount
on Yearperiod.CompanyCode = GlAccount.CompanyCode
inner join I_GLAccountInChartOfAccounts            as ChartOfAccounts           
 on  GlAccount.GLAccount = ChartOfAccounts.GLAccount
 //and GlAccount.ChartOfAccounts = ChartOfAccounts.ChartOfAccounts

{
 key Yearperiod.CompanyCode, 
 key Yearperiod.FiscalYear,
 key Yearperiod.FiscalPeriod,
 key Yearperiod.Ledger,
 key GlAccount. GLAccount,
     //GlAccount.AlternativeGLAccount,  CE2302

     GlAccount.AlternativeGLAccount as AlternativeGLAccount,  //CE2302

     //Remove usage of COA

     //GlAccount.ChartOfAccounts,

     ChartOfAccounts.ChartOfAccounts,
//         case  $parameters.P_DisplayAltvAcct when  'X'

//         then case when AlternativeGLAccount  <> ''

//              then  cast(AlternativeGLAccount as figlcn_glaccountinfo)

//              else cast(GlAccount.GLAccount as figlcn_glaccountinfo)

//              end

//         else cast(GlAccount.GLAccount as figlcn_glaccountinfo)

//        end                                             as        GLAccountInfo,

      @Search.defaultSearchElement
      @Search.fuzzinessThreshold: 0.7
      @Search.ranking: #HIGH  
         case  $parameters.P_DisplayAltvAcct when  'X'
//         then case when AlternativeGLAccount  <> ''

              then  cast(AlternativeGLAccount as figlcn_glaccountinfo)
              else cast(GlAccount.GLAccount as figlcn_glaccountinfo)
 //             end

 //        else cast(GlAccount.GLAccount as figlcn_glaccountinfo)

         end as GLAccountInfo,
     ChartOfAccounts.GLAccountGroup as  GLAccountGroup,
     GlAccount.AccountIsMarkedForDeletion as AccountIsMarkedForDeletion,
     AuthorizationGroup
}
where Yearperiod.CompanyCode = :P_CompanyCode
  and Yearperiod.FiscalYear  = :P_FiscalYear
  and Yearperiod.Ledger      = :P_Ledger;