ATPC_CDS_PREDECESSOR
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)
| Source | Alias | Join Type |
|---|---|---|
| eban | eban | inner |
| eket | eket | union |
| ekpo | ekpo | inner |
| I_ATPRlvtSDDocumentCategory | I_ATPRlvtSDDocumentCategory | inner |
| vbfa | vbfa | from |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| 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 |
@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 <> ''
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA