P_FSTMT_ACDOC_OI

DDL: P_FSTMT_ACDOC_OI SQL: P_FSTMTACDOC_OI Type: view COMPOSITE

P_FSTMT_ACDOC_OI is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItem) and exposes 19 fields with key fields rldnr, rbukrs, racct, Segment, prctr.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItem I_GLAccountLineItem from

Parameters (1)

NameTypeDefault
p_keydate_acdoc abap.dats

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName P_FSTMTACDOC_OI view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY rldnr Ledger
KEY rbukrs CompanyCode
KEY racct GLAccount
KEY Segment Segment
KEY prctr ProfitCenter
KEY rwcur TransactionCurrency
KEY netduedate NetDueDate
hsl
ksl
osl
vsl
bsl
csl
dsl
esl
fsl
gsl
aging GeneralLedgerAgingScope
FiscalYearPeriod FiscalYearPeriod
@AbapCatalog.sqlViewName: 'P_FSTMTACDOC_OI'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private:true
@VDM.viewType: #COMPOSITE
@ObjectModel: {
                usageType.serviceQuality: #D,
                usageType.sizeCategory: #XXL,
                usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_FSTMT_ACDOC_OI
  with parameters 
    p_keydate_acdoc   :abap.dats     
//    p_FiscalYear      :gjahr 

  as select from I_GLAccountLineItem
 {
  key Ledger as rldnr , 
  key CompanyCode as rbukrs ,
  key GLAccount as racct ,
  key Segment ,
  key ProfitCenter as prctr ,
  key TransactionCurrency as rwcur,
  key NetDueDate as netduedate,

  sum(AmountInCompanyCodeCurrency) as   hsl,
  sum(AmountInGlobalCurrency) as   ksl,                                                                                                              
  sum(AmountInFreeDefinedCurrency1) as   osl,                                                                                                              
  sum(AmountInFreeDefinedCurrency2) as   vsl,                                                                                                              
  sum(AmountInFreeDefinedCurrency3) as   bsl,                                                                                                              
  sum(AmountInFreeDefinedCurrency4) as   csl,                                                                                                              
  sum(AmountInFreeDefinedCurrency5) as   dsl,                                                                                                              
  sum(AmountInFreeDefinedCurrency6) as   esl,                                                                                                              
  sum(AmountInFreeDefinedCurrency7) as   fsl,                                                                                                              
  sum(AmountInFreeDefinedCurrency8) as   gsl,

  case when GLAccountType = 'C'
   then HouseBank else '' end as hbkid,
  case when GLAccountType = 'C' 
  then HouseBankAccount else '' end as hktid,
  GeneralLedgerAgingScope as aging,
  GeneralLedgerAgingIncrement as posted_incrmnt, 
  case when GLAccountType = 'X' or GLAccountType = 'C'
        then ''
        else FunctionalArea  end as funcarea,
  FiscalYearPeriod                
                                                                                                                                                                   
                                                          
}                                                                                                                                                                                                                            
   where PostingDate <=  left( $parameters.p_keydate_acdoc, 4 )    and
         AccountingDocumentCategory <> 'J' and
         AccountingDocumentCategory <> 'D' and
         AccountingDocumentCategory <> 'M' and
         AccountingDocumentCategory <> 'P' and
         AccountingDocumentCategory <> 'V' and
         AccountingDocumentCategory <> 'W' and
         AccountingDocumentCategory <> 'Z' and 
   
         ( GLRecordType = '0' or GLRecordType = '5')  and
//       only open items in BS are relevant   

          GLAccountType           =  'X' or
          GLAccountType           =  'C' and
          IsOpenItemManaged                    =  'X' and
          FiscalYear                    <  left( $parameters.p_keydate_acdoc, 4 ) and //$parameters.p_FiscalYear and

          AccountingDocumentCategory                    <> 'C' and
//         items not yet cleared or

//         cleared in years after current year or

//         cleared in current year before keydate just to reduce carry forward amount          

          ( ClearingDocFiscalYear = '0000' or 
            ClearingDate > $parameters.p_keydate_acdoc )  // cleared items after current date

  
 group by Ledger, CompanyCode, FiscalYearPeriod, GLAccountType, GLAccount, FunctionalArea, Segment, ProfitCenter, TransactionCurrency, NetDueDate, HouseBank, HouseBankAccount, GeneralLedgerAgingScope, GeneralLedgerAgingIncrement