ATPC_CDS_PREDECESSOR

DDL: ATPC_CDS_PREDECESSOR SQL: ATPC_PREDECESSOR Type: view

Predecessor documents

ATPC_CDS_PREDECESSOR is a CDS View that provides data about "Predecessor documents" in SAP S/4HANA. It reads from 5 data sources (eban, eket, ekpo, I_ATPRlvtSDDocumentCategory, vbfa) and exposes 13 fields with key fields mandt, atpcat, delnr, delps, bstypLthenU4elseU1endasatpcat.

Data Sources (5)

SourceAliasJoin Type
eban eban inner
eket eket union
ekpo ekpo inner
I_ATPRlvtSDDocumentCategory I_ATPRlvtSDDocumentCategory inner
vbfa vbfa from

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName ATPC_PREDECESSOR view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Predecessor documents view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY mandt mandt
KEY atpcat
KEY delnr vbeln
KEY delps posnn
atpcat_pre
delnr_pre vbelv
mandt
KEY bstypLthenU4elseU1endasatpcat
KEY delnr eket ebeln
KEY delps
atpcat_pre
delnr_pre eket banfn
delps_pre
@AbapCatalog.sqlViewName: 'ATPC_PREDECESSOR'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Predecessor documents'
@ObjectModel: {
    usageType: {
      serviceQuality: #X,
      sizeCategory: #XXL,
      dataClass: #MIXED
    }
}
define view ATPC_CDS_PREDECESSOR
  as select from vbfa
    inner join   I_ATPRlvtSDDocumentCategory on vbfa.vbtyp_n = I_ATPRlvtSDDocumentCategory.SDDocumentCategory
{
  key   mandt,
  key   cast(concat('V',vbtyp_n) as abap.char(2)) as atpcat,
  key   vbeln                                     as delnr,
  key   posnn                                     as delps,
        cast(concat('V',vbtyp_v) as abap.char(2)) as atpcat_pre,
        vbelv                                     as delnr_pre,
        posnv                                     as delps_pre
}
where
  stufe = '00' -- only direct predecessor

union select from eket
  inner join      ekpo on  eket.ebeln = ekpo.ebeln
                       and eket.ebelp = ekpo.ebelp
  inner join      eban on  eket.banfn = eban.banfn
                       and eket.bnfpo = eban.bnfpo
{
  key eket.mandt,
  key case
        when ekpo.bstyp = 'F' then 'U1'
        when ekpo.bstyp = 'L' then 'U4'
                              else 'U1'
        end                                           as atpcat,
  key eket.ebeln                                      as delnr,
  key cast(concat('0', eket.ebelp) as abap.numc( 6 )) as delps,
      'U2'                                            as atpcat_pre,
      eket.banfn                                      as delnr_pre,
      cast(concat('0', eket.bnfpo) as abap.numc( 6 )) as delps_pre
}
where
  eket.banfn <> ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ATPRLVTSDDOCUMENTCATEGORY",
"EBAN",
"EKET",
"EKPO",
"VBFA"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/