Fco_Mig_Check_Coep11_L2

DDL: FCO_MIG_CHECK_COEP11_L2 SQL: FCOV_CHECK4_l2 Type: view Package: FINS_CO_MIG

Check ACDOCA-records against COEP-records with WRTTP=11

Fco_Mig_Check_Coep11_L2 is a CDS View that provides data about "Check ACDOCA-records against COEP-records with WRTTP=11" in SAP S/4HANA. It reads from 4 data sources (aufk, Fco_Mig_Check_Coep11_L1, csks, prps) and exposes 108 fields with key fields mandt, kokrs, belnr, buzei. Part of development package FINS_CO_MIG.

Data Sources (4)

SourceAliasJoin Type
aufk a left_outer
Fco_Mig_Check_Coep11_L1 c from
csks k left_outer
prps p left_outer

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName FCOV_CHECK4_l2 view
ClientDependent true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Check ACDOCA-records against COEP-records with WRTTP=11 view

Fields (108)

KeyFieldSource TableSource FieldDescription
KEY mandt Fco_Mig_Check_Coep11_L1 mandt
KEY kokrs Fco_Mig_Check_Coep11_L1 kokrs
KEY belnr belnr
KEY buzei buzei
PERIO PERIO
WTGBTR WTGBTR
WOGBTR WOGBTR
WKGBTR WKGBTR
WKFBTR WKFBTR
PAGBTR PAGBTR
PAFBTR PAFBTR
MEGBTR MEGBTR
MEFBTR MEFBTR
MBGBTR MBGBTR
MBFBTR MBFBTR
LEDNR LEDNR
objnr Fco_Mig_Check_Coep11_L1 objnr
GJAHR GJAHR
WRTTP
VERSN VERSN
KSTAR Fco_Mig_Check_Coep11_L1 KSTAR
hrkft hrkft
vrgng vrgng
PAROB PAROB
parob1 parob1
uspob uspob
VBUND VBUND
PARGB PARGB
beknz beknz
TWAER TWAER
OWAER OWAER
MEINH MEINH
MEINB MEINB
muvflg muvflg
sgtxt sgtxt
REFBZ REFBZ
zlenr zlenr
BW_REFBZ BW_REFBZ
gkont gkont
gkoar gkoar
werks Fco_Mig_Check_Coep11_L1 werks
matnr Fco_Mig_Check_Coep11_L1 matnr
rbest rbest
ebeln ebeln
ebelp ebelp
zekkn zekkn
erlkz erlkz
pernr pernr
BTRKL
beltp beltp
bukrs Fco_Mig_Check_Coep11_L1 BUKRS
gsber Fco_Mig_Check_Coep11_L1 GSBER
FKBER FKBER
scope Fco_Mig_Check_Coep11_L1 scope
logsyso logsyso
pkstar pkstar
pbukrs pbukrs
PFKBER PFKBER
pscope pscope
logsysp logsysp
dabrz dabrz
bwstrat bwstrat
objnr_hk objnr_hk
qmnum qmnum
GEBER GEBER
PGEBER PGEBER
GRANT_NBR GRANT_NBR
PGRANT_NBR PGRANT_NBR
REFBZ_FI REFBZ_FI
segment segment
psegment psegment
posnr posnr
prctr Fco_Mig_Check_Coep11_L1 prctr
PPRCT PPRCT
BUDGET_PD BUDGET_PD
PBUDGET_PD PBUDGET_PD
prodper prodper
awtyp awtyp
AWKEY AWKEY
awsys awsys
KWAER KWAER
KOSTL Fco_Mig_Check_Coep11_L1 KOSTL
lstar lstar
aufnr Fco_Mig_Check_Coep11_L1 aufnr
autyp Fco_Mig_Check_Coep11_L1 autyp
pspnr Fco_Mig_Check_Coep11_L1 pspnr
pspid pspid
vbeln vbeln
vbposnr vbposnr
ce4key ce4key
erkrs erkrs
paccas paccas
PKOSTL PKOSTL
plstar plstar
paufnr paufnr
pautyp pautyp
ppspnr ppspnr
ppspid ppspid
pvbeln pvbeln
pvbposnr pvbposnr
pce4key pce4key
zuonr zuonr
quant1 quant1
quant2 quant2
quant3 quant3
qunit1 qunit1
qunit2 qunit2
qunit3 qunit3
@AbapCatalog.sqlViewName: 'FCOV_CHECK4_l2'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Check ACDOCA-records against COEP-records with WRTTP=11'
define view Fco_Mig_Check_Coep11_L2 as 
    select from     Fco_Mig_Check_Coep11_L1 as c
    left outer join aufk                    as a
                                                on a.mandt = c.mandt
                                               and a.aufnr = c.aufnr
    left outer join csks                    as k
                                                on k.mandt = c.mandt
                                               and k.kokrs = c.kokrs
                                               and k.kostl = c.KOSTL
                                               and k.datbi >= c.budat
                                               and k.datab <= c.budat
    left outer join prps                    as p
                                                on p.mandt = c.mandt
                                               and p.posid = c.pspnr
{                   
          key c.mandt   as mandt,
          key c.kokrs   as kokrs,
          key belnr,
          key buzei,
          PERIO,
          WTGBTR,
          WOGBTR,
          WKGBTR,
          WKFBTR,
          PAGBTR,
          PAFBTR,
          MEGBTR,
          MEFBTR,
          MBGBTR,
          MBFBTR,
          LEDNR,
          c.objnr,
          GJAHR as GJAHR,
          '11'  as WRTTP,
          VERSN,
          c.KSTAR,
          hrkft,
          vrgng,
          PAROB,
          parob1,
          uspob,
          VBUND,
          PARGB,
          beknz,
          TWAER,
          OWAER,
          MEINH,
          MEINB,
          muvflg,
          sgtxt,
          REFBZ,
          zlenr,
          BW_REFBZ,
          gkont,
          gkoar,
          c.werks,
          c.matnr,
          rbest,
          ebeln,
          ebelp,
          zekkn,
          erlkz,
          pernr,
          '00'  as BTRKL,      --- obsolete?
          paobjnr,
          beltp,
          c.BUKRS   as bukrs,
          c.GSBER   as gsber,
          FKBER,
          c.scope,
          logsyso,
//          coalesce(k.logsystem,'') as logsyso_ks,

//          coalesce(a.logsystem,'') as logsyso_or,

//          coalesce(p.logsystem,'') as logsyso_pr,

          pkstar,
          pbukrs,
          PFKBER,
          pscope,
          logsysp,
          dabrz,
          bwstrat,
          objnr_hk,

          qmnum,
          GEBER,
          PGEBER,
          GRANT_NBR,
          PGRANT_NBR,
          REFBZ_FI,
          segment,
          psegment,
          posnr,
          c.prctr,
          PPRCT,
          BUDGET_PD,
          PBUDGET_PD,
          prodper,
          awtyp,
          AWKEY,
          awsys,
          KWAER,

          accasty,
          case
            when accas <>  ''        then accas
            when accasty = 'KS'      then c.KOSTL
            when accasty = 'KL'      then concat( concat(c.KOSTL,'/'), lstar)
            when accasty = 'OR'      then c.aufnr
            when accasty = 'PR'      then c.pspnr
            when accasty = 'VB'      then concat( concat(vbeln,'/'), vbposnr)
            else                          ''
          end as accas,

          c.KOSTL,
          lstar,
          c.aufnr as aufnr,
          c.autyp as autyp,
          c.pspnr as pspnr,
          pspid,
          vbeln,
          vbposnr,
          ce4key,

          co_accasty_n1,
          co_accasty_n2,
          co_accasty_n3,

          case
            when co_accasty_n3 <> '' then 4
            when co_accasty_n2 <> '' then 3
            when co_accasty_n1 <> '' then 2
            else                          1
          end as no_of_copies,

          case
            when co_accasty_n1 <> '' then
              case
                when co_accasty_n1 = 'KS'
                  then c.KOSTL
                when co_accasty_n1 = 'KL'
                  then concat(concat(c.KOSTL,'/'),lstar)
                when co_accasty_n1 = 'OR'
                  then c.aufnr
                when co_accasty_n1 = 'PR'
                  then c.pspnr
                else   ''
              end
            else ''
          end as accas_1,
          case
            when co_accasty_n2 <> '' then
              case
                when co_accasty_n2 = 'KS'
                  then c.KOSTL
                when co_accasty_n2 = 'KL'
                  then concat(concat(c.KOSTL,'/'),lstar)
                when co_accasty_n2 = 'OR'
                  then c.aufnr
                when co_accasty_n2 = 'PR'
                  then c.pspnr
                else   ''
              end
            else ''
          end as accas_2,
          case
            when co_accasty_n3 <> '' then
              case
                when co_accasty_n3 = 'KS'
                  then c.KOSTL
                when co_accasty_n3 = 'KL'
                  then concat(concat(c.KOSTL,'/'),lstar)
                when co_accasty_n3 = 'OR'
                  then c.aufnr
                when co_accasty_n3 = 'PR'
                  then c.pspnr
                else   ''
              end
            else ''
          end as accas_3,

          case
            when co_accasty_n1 <> '' then
              case
                when co_accasty_n1 = 'KS'
                  then concat( concat('KS',c.kokrs), c.KOSTL)
                when co_accasty_n1 = 'KL'
                  then concat( concat( concat('KL',c.kokrs), c.KOSTL), lstar)
                when co_accasty_n1 = 'OR'
                  then coalesce(a.objnr,'')                 -- concat('OR',aufnr)
                when co_accasty_n1 = 'PR'
                  then coalesce(p.objnr,'')
                else   ''
              end
            else ''
          end as objnr_1,
          case
            when co_accasty_n2 <> '' then
              case
                when co_accasty_n2 = 'KS'
                  then concat( concat('KS',c.kokrs), c.KOSTL)
                when co_accasty_n2 = 'KL'
                  then concat( concat( concat('KL',c.kokrs), c.KOSTL), lstar)
                when co_accasty_n2 = 'OR'
                  then coalesce(a.objnr,'')                 -- concat('OR',aufnr)
                when co_accasty_n2 = 'PR'
                  then coalesce(p.objnr,'')
                else   ''
              end
            else ''
          end as objnr_2,
          case
            when co_accasty_n3 <> '' then
              case
                when co_accasty_n3 = 'KS'
                  then concat( concat('KS',c.kokrs), c.KOSTL)
                when co_accasty_n3 = 'KL'
                  then concat( concat( concat('KL',c.kokrs), c.KOSTL), lstar)
                when co_accasty_n3 = 'OR'
                  then coalesce(a.objnr,'')                 -- concat('OR',aufnr)
                when co_accasty_n3 = 'PR'
                  then coalesce(p.objnr,'')
                else   ''
              end
            else ''
          end as objnr_3,

          erkrs,
          paccas,
          paccasty,
          PKOSTL,
          plstar,
          paufnr,
          pautyp,
          ppspnr,
          ppspid,
          pvbeln,
          pvbposnr,
          pce4key,
          zuonr,
          quant1,
          quant2,
          quant3,
          qunit1,
          qunit2,
          qunit3   
}