P_EventBasedOrder
P_EventBasedOrder is a Basic CDS View in SAP S/4HANA. It reads from 1 data source (aufk) and exposes 19 fields with key field OrderID.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| aufk | aufk | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_ToFiscalYearPeriod | fins_fyearperiod |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PFIEBORD | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.viewType | #BASIC | view | |
| VDM.private | true | view | |
| ObjectModel.representativeKey | OrderID | view | |
| ObjectModel.usageType.dataClass | #MASTER | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | OrderID | aufk | aufnr | |
| OrderDescription | ||||
| ControllingObject | aufk | objnr | ||
| OrderType | aufk | auart | ||
| OrderCategory | aufk | autyp | ||
| ControllingArea | aufk | kokrs | ||
| CompanyCode | aufk | bukrs | ||
| Material | afpo | matnr | ||
| Plant | aufk | werks | ||
| ProfitCenter | aufk | prctr | ||
| ResultsAnalysisKey | aufk | abgsl | ||
| ProductionUnit | afpo | amein | ||
| DeliveryDate | afpo | ltrmi | ||
| TechCompDate | aufk | idat2 | ||
| StatusCodeelseI0002endasStatusCode | ||||
| LogNumber | LogNumber | |||
| LogHandle | LogHandle | |||
| LogMessageText | LogMessageText | |||
| Severity | Severity |
@AbapCatalog.sqlViewName: 'PFIEBORD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
//@EndUserText.label: 'Event-based Order'
@VDM.viewType: #BASIC
@VDM.private:true
@ObjectModel.representativeKey: 'OrderID'
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
define view P_EventBasedOrder
with parameters
P_ToFiscalYearPeriod : fins_fyearperiod
as select from aufk
left outer to one join afpo on afpo.posnr = '0001'
and aufk.aufnr = afpo.aufnr
// left outer to one join jest on jest.stat = 'I0002'
// and aufk.objnr = jest.objnr
left outer to one join P_EBWObjectStatus as _ObjectStatus on _ObjectStatus.ControllingObject = aufk.objnr
left outer to one join I_FiscalYearPeriodForCmpnyCode as _PeriodForCC on aufk.bukrs = _PeriodForCC.CompanyCode
and _PeriodForCC.FiscalYearPeriod = $parameters.P_ToFiscalYearPeriod
left outer to one join P_EventBasedWIPLogHeader as _OrderLog on aufk.objnr = _OrderLog.ControllingObject
{
key aufk.aufnr as OrderID,
cast(aufk.ktext as fis_order_text) as OrderDescription,
aufk.objnr as ControllingObject,
aufk.auart as OrderType,
aufk.autyp as OrderCategory,
aufk.kokrs as ControllingArea,
aufk.bukrs as CompanyCode,
afpo.matnr as Material,
aufk.werks as Plant,
aufk.prctr as ProfitCenter,
aufk.abgsl as ResultsAnalysisKey,
afpo.amein as ProductionUnit,
afpo.ltrmi as DeliveryDate,
aufk.idat2 as TechCompDate,
// cast('X' as xfeld) as OrderIsReleased,
// cast(case when afpo.ltrmi <> '00000000' and afpo.ltrmi <= _PeriodForCC.FiscalPeriodEndDate
// then 'X'
// else '' end as xfeld) as OrderIsDelivered,
// cast(case when aufk.idat2 <> '00000000' and aufk.idat2 <= _PeriodForCC.FiscalPeriodEndDate
// then 'X'
// else ''
// end as xfeld) as OrderIsTechnicallyCompleted,
max(
case when _ObjectStatus.StatusCode = 'I0012'
and afpo.ltrmi <= _PeriodForCC.FiscalPeriodEndDate then _ObjectStatus.StatusCode //Delivery Date
when _ObjectStatus.StatusCode = 'I0045'
and aufk.idat2 <= _PeriodForCC.FiscalPeriodEndDate then _ObjectStatus.StatusCode //Technical Completion Date
else 'I0002' end ) as StatusCode,
LogNumber,
LogHandle,
LogMessageText,
Severity
}
where aufk.eb_post = 'X'
and ( aufk.autyp = '10' or aufk.autyp = '40' )
group by
_PeriodForCC.FiscalPeriodEndDate,
aufk.aufnr,
aufk.ktext,
aufk.kokrs,
aufk.bukrs,
aufk.objnr,
aufk.autyp,
afpo.matnr,
aufk.werks,
aufk.auart,
aufk.abgsl,
afpo.amein,
aufk.prctr,
afpo.ltrmi,
aufk.idat2,
LogNumber,
LogHandle,
LogMessageText,
Severity
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