P_FSTMT_ACDOC_ITEMS

DDL: P_FSTMT_ACDOC_ITEMS SQL: P_FSTMTACDOC_ITM Type: view COMPOSITE

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

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItem acd from

Parameters (1)

NameTypeDefault
p_keydate_acdoc abap.dats

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName P_FSTMTACDOC_ITM 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 (21)

KeyFieldSource TableSource FieldDescription
KEY rldnr I_GLAccountLineItem Ledger
KEY rbukrs I_GLAccountLineItem CompanyCode
KEY gjahr I_GLAccountLineItem LedgerFiscalYear
KEY racct I_GLAccountLineItem GLAccount
KEY Segment I_GLAccountLineItem Segment
KEY prctr I_GLAccountLineItem ProfitCenter
KEY rwcur I_GLAccountLineItem TransactionCurrency
KEY bstat AccountingDocumentCategory
hsl
ksl
osl
vsl
bsl
csl
dsl
esl
fsl
gsl
aging GeneralLedgerAgingScope
rrcty GLRecordType
FiscalYearPeriod FiscalYearPeriod
@AbapCatalog.sqlViewName: 'P_FSTMTACDOC_ITM'
@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_ITEMS
  with parameters 
    p_keydate_acdoc   :abap.dats 
//    p_FiscalYear      :gjahr

  as select from I_GLAccountLineItem  as acd
     
 {
  key acd.Ledger as  rldnr , 
  key acd.CompanyCode as rbukrs ,
  key acd.LedgerFiscalYear as gjahr ,
  key acd.GLAccount as racct ,
  key acd.Segment ,
  key acd.ProfitCenter as prctr ,
  key acd.TransactionCurrency as rwcur,
  key case  when GLAccountType = 'X' and NetDueDate >= '00010101' then NetDueDate 
            else '00000000'
            end as netduedate,
  key  AccountingDocumentCategory as bstat,
  sum(acd.AmountInCompanyCodeCurrency) as   hsl,
  sum(acd.AmountInGlobalCurrency) as   ksl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency1) as   osl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency2) as   vsl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency3) as   bsl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency4) as   csl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency5) as   dsl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency6) as   esl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency7) as   fsl,                                                                                                              
  sum(acd.AmountInFreeDefinedCurrency8) as   gsl,
  case when GLAccountType = 'C'
   then HouseBank else '' end as hbkid,
  case when GLAccountType = 'C' 
  then HouseBankAccount else '' end as hktid,
  case when GLAccountType = 'X' or GLAccountType = 'C'
        then ''
        else FunctionalArea  end as funcarea,
  GeneralLedgerAgingScope as aging,
  GeneralLedgerAgingIncrement as posted_incrmnt,
  GLRecordType as rrcty,
  FiscalYearPeriod    
      
                                                   
}                                                                                                                                                                                                                            
   where PostingDate <=  $parameters.p_keydate_acdoc and 
         FiscalYear  =  left( $parameters.p_keydate_acdoc, 4 )   and
         AccountingDocumentCategory <> 'J' and
         AccountingDocumentCategory <> 'D' and
         AccountingDocumentCategory <> 'M' and
//         bstat <> 'P' and

         AccountingDocumentCategory <> 'V' and
         AccountingDocumentCategory <> 'W' and
         AccountingDocumentCategory <> 'Z' 
//         rrcty  = '0'  

  group by Ledger, CompanyCode, LedgerFiscalYear, FiscalYearPeriod, FunctionalArea, GLAccount, Segment, ProfitCenter, TransactionCurrency, GLAccountType, NetDueDate, AccountingDocumentCategory, HouseBank, HouseBankAccount , GeneralLedgerAgingScope, GeneralLedgerAgingIncrement, GLRecordType    
 
                                        
//  union all   select from P_FSTMT_ACDOC_OI( p_keydate_acdoc  : $parameters.p_keydate_acdoc

//                                         )   as acd 

//

//    inner join    P_FSTMT_duplicate_OI  as dup

//            on  acd.rbukrs = dup.bukrs

//  

//   

// {

//  key acd.rldnr , 

//  key acd.rbukrs ,

//  key '0000' as gjahr ,

//  key acd.racct ,

//  key acd.Segment ,

//  key acd.prctr ,

//  key acd.rwcur,

//  key case dup.bstat 

//      when 'C' then '00000000'

//               else acd.netduedate end as netduedate,

//  key dup.bstat as bstat,

//     case dup.bstat

//       when 'C' then 0 - acd.hsl 

//                else acd.hsl end as hsl, 

//     case dup.bstat

//       when 'C' then 0 - acd.ksl 

//                else acd.ksl end as ksl, 

//     case dup.bstat

//       when 'C' then 0 - acd.osl 

//                else acd.osl end as osl, 

//     case dup.bstat

//       when 'C' then 0 - acd.vsl 

//                else acd.vsl end as vsl, 

//     case dup.bstat

//       when 'C' then 0 - acd.bsl 

//                else acd.bsl end as bsl,                                                                                                                                                                    

//     case dup.bstat

//       when 'C' then 0 - acd.csl 

//                else acd.csl end as csl,

//     case dup.bstat

//       when 'C' then 0 - acd.dsl 

//                else acd.dsl end as dsl, 

//     case dup.bstat

//       when 'C' then 0 - acd.esl 

//                else acd.esl end as esl,

//     case dup.bstat

//       when 'C' then 0 - acd.fsl 

//                else acd.fsl end as fsl,

//     case dup.bstat

//       when 'C' then 0 - acd.gsl 

//                else acd.gsl end as gsl,

//                

//     acd.hbkid as hbkid,

//     acd.hktid as hktid,

//     '' as funcarea,

//     acd.aging,

//     acd.posted_incrmnt,

//     '' as rrcty,

//     acd.FiscalYearPeriod

//                                                           

//}

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GLACCOUNTLINEITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/