P_EBPC_MaxOrderStatusByPeriod
P_EBPC_MaxOrderStatusByPeriod is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_FiscalYearPeriodForLedger, I_StatusObjectStatusChange_2, I_SystemStatus) and exposes 5 fields with key fields Ledger, CompanyCode, StatusObject, StatusCode.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_FiscalYearPeriodForLedger | FiscalYearPeriodForLedger | inner |
| I_StatusObjectStatusChange_2 | StatusChange | from |
| I_SystemStatus | SystemStatus | inner |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_ToFiscalYearPeriod | fins_fyearperiod |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PEBPCMAXORDSTAT | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (5)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Ledger | I_FiscalYearPeriodForLedger | Ledger | |
| KEY | CompanyCode | I_FiscalYearPeriodForLedger | CompanyCode | |
| KEY | StatusObject | I_StatusObjectStatusChange_2 | StatusObject | |
| KEY | StatusCode | I_StatusObjectStatusChange_2 | StatusCode | |
| MaxObjectStatusChangeNumber |
@AbapCatalog.sqlViewName: 'PEBPCMAXORDSTAT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view P_EBPC_MaxOrderStatusByPeriod
with parameters
@Semantics.fiscal.yearPeriod: true
P_ToFiscalYearPeriod : fins_fyearperiod
as select from I_StatusObjectStatusChange_2 as StatusChange
inner join I_SystemStatus as SystemStatus on SystemStatus.SystemStatus = StatusChange.StatusCode
inner join I_FiscalYearPeriodForLedger as FiscalYearPeriodForLedger on FiscalYearPeriodForLedger.FiscalYearPeriod = :P_ToFiscalYearPeriod
{
key FiscalYearPeriodForLedger.Ledger,
key FiscalYearPeriodForLedger.CompanyCode,
key StatusChange.StatusObject,
key StatusChange.StatusCode,
max(StatusChange.StatusObjectStatusChangeNumber) as MaxObjectStatusChangeNumber // Get the highest Change Number per Object and Code
}
where
StatusChange.LastChangeDate <= FiscalYearPeriodForLedger.FiscalPeriodEndDate
and SystemStatus.StatusIsHidden = '' // Exclude hidden statuses
group by
FiscalYearPeriodForLedger.Ledger,
FiscalYearPeriodForLedger.CompanyCode,
StatusChange.StatusObject,
StatusChange.StatusCode
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