P_ProcOrdNxtOpAggr
P_ProcOrdNxtOpAggr is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_ProcOrdAORListDistinct, I_ProcOrdMgmtOpBasic) and exposes 5 fields with key field MfgOrderInternalID. It has 2 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_ProcOrdAORListDistinct | _AORList | inner |
| I_ProcOrdMgmtOpBasic | Op | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_ProcOrdLatestOpAggr | _ProcOrdLatestOp | _ProcOrdLatestOp.MfgOrderInternalID = Op.OrderInternalID and _ProcOrdLatestOp.ProcessOrder = Op.ProcessOrder and _ProcOrdLatestOp.ProductionPlant = Op.ProductionPlant and _ProcOrdLatestOp.ProductionSupervisor = Op.ProductionSupervisor |
| [0..1] | P_ProcOrdFirstOpAggr | _ProcOrdFirstOp | _ProcOrdFirstOp.MfgOrderInternalID = Op.OrderInternalID and _ProcOrdFirstOp.ProcessOrder = Op.ProcessOrder and _ProcOrdFirstOp.ProductionPlant = Op.ProductionPlant and _ProcOrdFirstOp.ProductionSupervisor = Op.ProductionSupervisor |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PROCORDNXTOPAGGR | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (5)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | MfgOrderInternalID | I_ProcOrdMgmtOpBasic | OrderInternalID | |
| ProcessOrder | I_ProcOrdMgmtOpBasic | ProcessOrder | ||
| ProductionPlant | I_ProcOrdMgmtOpBasic | ProductionPlant | ||
| ProductionSupervisor | I_ProcOrdMgmtOpBasic | ProductionSupervisor | ||
| NextOperation |
@AbapCatalog.sqlViewName: 'PROCORDNXTOPAGGR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
//@EndUserText.label: 'Process order next operation'
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
// Calculate next operation based on operation number
define view P_ProcOrdNxtOpAggr
as select from I_ProcOrdMgmtOpBasic as Op
inner join P_ProcOrdAORListDistinct as _AORList on _AORList.OrderID = Op.ProcessOrder
association [0..1] to P_ProcOrdLatestOpAggr as _ProcOrdLatestOp on _ProcOrdLatestOp.MfgOrderInternalID = Op.OrderInternalID
and _ProcOrdLatestOp.ProcessOrder = Op.ProcessOrder
and _ProcOrdLatestOp.ProductionPlant = Op.ProductionPlant
and _ProcOrdLatestOp.ProductionSupervisor = Op.ProductionSupervisor
// association [0..1] to P_ProcOrdCurOpRelshpAggrgn as _ProcOrdCurOpRel on _ProcOrdCurOpRel.MfgOrderInternalID = Op.OrderInternalID
// and _ProcOrdCurOpRel.ProcessOrder = Op.ProcessOrder
// and _ProcOrdCurOpRel.ProductionPlant = Op.ProductionPlant
// and _ProcOrdCurOpRel.ProductionSupervisor = Op.ProductionSupervisor
association [0..1] to P_ProcOrdFirstOpAggr as _ProcOrdFirstOp on _ProcOrdFirstOp.MfgOrderInternalID = Op.OrderInternalID
and _ProcOrdFirstOp.ProcessOrder = Op.ProcessOrder
and _ProcOrdFirstOp.ProductionPlant = Op.ProductionPlant
and _ProcOrdFirstOp.ProductionSupervisor = Op.ProductionSupervisor
{
key Op.OrderInternalID as MfgOrderInternalID,
Op.ProcessOrder,
Op.ProductionPlant,
Op.ProductionSupervisor,
min(Op.Operation) as NextOperation
}
where
(
Op.ManufacturingOrderCategory = '40'
and Op.MfgOrderOperationIsPhase = '' //phases are not relevant
and Op.Sequence = '000000' //only standard sequence
and Op.SuperiorOperationInternalID = '00000000'
)
and(
Op.OpActualExecutionStartDate = '00000000' //orders not yet in pcnf or cnf or del status
and(
(
_ProcOrdLatestOp.LatestOperation is not null
and Op.Operation > _ProcOrdLatestOp.LatestOperation
)
// or(
// _ProcOrdLatestOp.LatestOperation is null
// and _ProcOrdCurOpRel.CurOperation is not null
// and Op.Operation > _ProcOrdCurOpRel.CurOperation
// )
or(
_ProcOrdLatestOp.LatestOperation is null
// and _ProcOrdCurOpRel.CurOperation is null
and _ProcOrdFirstOp.FirstOperation is not null
and Op.Operation > _ProcOrdFirstOp.FirstOperation
)
)
)
group by
Op.OrderInternalID,
Op.ProcessOrder,
Op.ProductionPlant,
Op.ProductionSupervisor;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PROCORDMGMTOPBASIC",
"P_PROCORDAORLISTDISTINCT",
"P_PROCORDFIRSTOPAGGR",
"P_PROCORDLATESTOPAGGR"
],
"ASSOCIATED":
[
"P_PROCORDFIRSTOPAGGR",
"P_PROCORDLATESTOPAGGR"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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