Faa_Anlc1_Adoc

DDL: FAA_ANLC1_ADOC SQL: FAAV_ANLC1_ADOC Type: view

Intern: Verdichten auf SLALITTYPE-Ebene

Faa_Anlc1_Adoc is a CDS View that provides data about "Intern: Verdichten auf SLALITTYPE-Ebene" in SAP S/4HANA. It reads from 3 data sources (acdoca, acdoca, Faa_Rep_Ledger) and exposes 37 fields.

Data Sources (3)

SourceAliasJoin Type
acdoca adoc inner
acdoca adoc inner
Faa_Rep_Ledger ldnr from

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName FAAV_ANLC1_ADOC view
EndUserText.label Intern: Verdichten auf SLALITTYPE-Ebene view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #P view

Fields (37)

KeyFieldSource TableSource FieldDescription
mandt rclnt
bukrs rbukrs
anln1 anln1
anln2 anln2
gjahr ryear
afabe afabe
rldnr Faa_Rep_Ledger rep_ledger
slalittype slalittype
movcat movcat
hsl
ksl
osl
vsl
bsl
csl
dsl
esl
fsl
xstoreXrclntasmandt
bukrs rbukrs
anln1 anlgr
anln2 anlgr2
gjahr ryear
afabe afabe
rldnr Faa_Rep_Ledger rep_ledger
slalittype slalittype
movcat movcat
hsl
ksl
osl
vsl
bsl
csl
dsl
esl
fsl
gsl
@AbapCatalog.sqlViewName: 'FAAV_ANLC1_ADOC'
@EndUserText.label: 'Intern: Verdichten auf SLALITTYPE-Ebene'

@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #P

// this view is just to condense the data on slalittype level

-------------------------------------------------------------
define view Faa_Anlc1_Adoc

as select from Faa_Rep_Ledger as ldnr

inner join     acdoca         as adoc
   on ldnr.bukrs      = adoc.rbukrs
   and (    (    ldnr.rep_ledger  = adoc.rldnr 
             and ldnr.lead_afabe = adoc.afabe )
         or (    ldnr.tech_ledger = adoc.rldnr 
             and ldnr.lead_afabe = adoc.afabe ) )
  and ldnr.xstore     = 'X'

{     rclnt  as mandt,
      rbukrs as bukrs,
      anln1,
      anln2,
      ryear  as gjahr,
      afabe,
      ldnr.rep_ledger as rldnr,
      slalittype,
      movcat,
// case when ( slalittype >= '07203' and slalittype <= '07209' ) and adoc.depr_period  >= '001'

//      then adoc.depr_period 

//      else adoc.poper 

//      end as poperx,                                            // note 2364559, 2381967 - performance optimization - ANLC ext. with period

 case when ( bstat  = 'C' and movcat <> '06' )
        or ( movcat = 'C7' )                                    // 'C7' = unterjährige Altdatenübernahme

        or ( movcat = '77' or movcat = '87' or movcat = '97' )  // note 2252940

      then '000'                                                // balance carried forward

      else '999' end as poper,                                  // current year


  sum ( hsl ) as hsl,
  sum ( ksl ) as ksl,
  sum ( osl ) as osl,
  sum ( vsl ) as vsl,
  sum ( bsl ) as bsl,
  sum ( csl ) as csl,
  sum ( dsl ) as dsl,
  sum ( esl ) as esl,
  sum ( fsl ) as fsl,
  sum ( gsl ) as gsl }

  where anln1      <> ''
    and ( mig_source = 'A' or mig_source = '' )
    and ( slalittype = '07000' or
          slalittype = '07001' or slalittype = '07002' or slalittype = '07003' or slalittype = '07004' or
          slalittype = '07005' or slalittype = '07006' or slalittype = '07007' or slalittype = '07008' or
          slalittype = '07009' or slalittype = '07022' or slalittype = '07023' or slalittype = '07024' or  //  note 2609067

          slalittype = '07025' or slalittype = '07026' or slalittype = '07027' or slalittype = '07028' or
          slalittype = '07040' or
          slalittype = '07041' or slalittype = '07042' or slalittype = '07043' or slalittype = '07044' or
          slalittype = '07045' or slalittype = '07046' or slalittype = '07047' or slalittype = '07048' or
                                                          slalittype = '07203' or slalittype = '07204' or
          slalittype = '07205' or slalittype = '07206' or slalittype = '07207' or slalittype = '07208' or
          slalittype = '07209' )
  //  and not       -- no legacy data transfer ( keine Altdatenübernahme )         // note 2252940

  //      ( movcat     = '77'    or movcat     = '87'    or movcat     = '97'    )


  group by rclnt,
           rbukrs,
           anln1,
           anln2,
           ryear,
           afabe,
           ldnr.rep_ledger,
           slalittype,
           movcat,
//           poper,                               // note 2364559, 2381967 

//           depr_period,                         // note 2364559, 2381967   

           bstat

union all

// the same for group assets

-----------------------------
select from Faa_Rep_Ledger as ldnr

inner join     acdoca      as adoc
   on ldnr.bukrs      = adoc.rbukrs
   and (    (    ldnr.rep_ledger  = adoc.rldnr 
             and ldnr.lead_afabe = adoc.afabe )
         or (    ldnr.tech_ledger = adoc.rldnr 
             and ldnr.lead_afabe = adoc.afabe ) )
  and ldnr.xstore     = 'X'

{     rclnt  as mandt,
      rbukrs as bukrs,
      anlgr  as anln1,
      anlgr2 as anln2,
      ryear  as gjahr,
      afabe,
      ldnr.rep_ledger as rldnr,
      slalittype,
      movcat,
//  case when ( slalittype >= '07203' and slalittype <= '07209' ) and adoc.depr_period  >= '001'

//      then adoc.depr_period 

//      else adoc.poper 

//      end as poperx,                                            // note 2364559, 2381967  - performance optimization - ANLC ext. with period

 case when ( bstat  = 'C' and movcat <> '06' )
        or ( movcat = 'C7' )                                    // 'C7' = unterjährige Altdatenübernahme

        or ( movcat = '77' or movcat = '87' or movcat = '97' )  // note 2252940

      then '000'                                                // balance carried forward

      else '999' end as poper,                                  // current year


  sum ( hsl ) as hsl,
  sum ( ksl ) as ksl,
  sum ( osl ) as osl,
  sum ( vsl ) as vsl,
  sum ( bsl ) as bsl,
  sum ( csl ) as csl,
  sum ( dsl ) as dsl,
  sum ( esl ) as esl,
  sum ( fsl ) as fsl,
  sum ( gsl ) as gsl }

  where anlgr      <> ''
    and ( mig_source = 'A' or mig_source = '' )
    and (    ( adoc.anlgr  <> adoc.anln1                               )
          or ( adoc.anlgr  =  adoc.anln1 and adoc.anlgr2 <> adoc.anln2 ) )
    and ( slalittype = '07000' or
          slalittype = '07001' or slalittype = '07002' or slalittype = '07003' or slalittype = '07004' or
          slalittype = '07005' or slalittype = '07006' or slalittype = '07007' or slalittype = '07008' or
          slalittype = '07009' or slalittype = '07022' or slalittype = '07023' or slalittype = '07024' or  //  note 2609067

          slalittype = '07025' or slalittype = '07026' or slalittype = '07027' or slalittype = '07028' or
          slalittype = '07040' or
          slalittype = '07041' or slalittype = '07042' or slalittype = '07043' or slalittype = '07044' or
          slalittype = '07045' or slalittype = '07046' or slalittype = '07047' or slalittype = '07048' or
                                                          slalittype = '07203' or slalittype = '07204' or
          slalittype = '07205' or slalittype = '07206' or slalittype = '07207' or slalittype = '07208' or
          slalittype = '07209' )
  //  and not       -- no legacy data transfer ( keine Altdatenübernahme )         // note 2252940

  //      ( movcat     = '77'    or movcat     = '87'    or movcat     = '97'    )


  group by rclnt,
           rbukrs,
           anlgr,
           anlgr2,
           ryear,
           afabe,
           ldnr.rep_ledger,
           slalittype,
           movcat,
//           poper,                               // note 2364559, 2381967 

//           depr_period,                         // note 2364559, 2381967  

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