P_EBPAO_OrderPlanCost
P_EBPAO_OrderPlanCost is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (P_EBPAO_OrderContextForHdrOnly, I_MfgOrdPlngCat, I_FinancialPlanningEntryItem) and exposes 21 fields with key fields OrderID, CompanyCode, ControllingArea, Plant, ProfitCenter.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| P_EBPAO_OrderContextForHdrOnly | OrderContext | inner |
| I_MfgOrdPlngCat | PlanCategory | inner |
| I_FinancialPlanningEntryItem | PlanCost | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_Ledger | fins_ledger | |
| P_FromFiscalYearPeriod | fins_fyearperiod | |
| P_ToFiscalYearPeriod | fins_fyearperiod |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PEBPAOOPC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | OrderID | P_EBPAO_OrderContextForHdrOnly | OrderID | |
| KEY | CompanyCode | P_EBPAO_OrderContextForHdrOnly | CompanyCode | |
| KEY | ControllingArea | P_EBPAO_OrderContextForHdrOnly | ControllingArea | |
| KEY | Plant | P_EBPAO_OrderContextForHdrOnly | Plant | |
| KEY | ProfitCenter | P_EBPAO_OrderContextForHdrOnly | ProfitCenter | |
| KEY | OrderCategory | P_EBPAO_OrderContextForHdrOnly | OrderCategory | |
| KEY | OrderType | P_EBPAO_OrderContextForHdrOnly | OrderType | |
| KEY | StorageLocation | P_EBPAO_OrderContextForHdrOnly | StorageLocation | |
| KEY | Product | P_EBPAO_OrderContextForHdrOnly | Product | |
| KEY | ProductGroup | P_EBPAO_OrderContextForHdrOnly | ProductGroup | |
| BaseUnit | P_EBPAO_OrderContextForHdrOnly | BaseUnit | ||
| AmountInCompanyCodeCurrency | ||||
| AmountInGlobalCurrency | ||||
| AmountInFreeDefinedCurrency1 | ||||
| AmountInFreeDefinedCurrency2 | ||||
| AmountInFreeDefinedCurrency3 | ||||
| AmountInFreeDefinedCurrency4 | ||||
| AmountInFreeDefinedCurrency5 | ||||
| AmountInFreeDefinedCurrency6 | ||||
| AmountInFreeDefinedCurrency7 | ||||
| AmountInFreeDefinedCurrency8 |
@AbapCatalog.sqlViewName: 'PEBPAOOPC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType: {
serviceQuality: #D,
sizeCategory: #XL,
dataClass: #MIXED
}
@VDM: {
private: true,
viewType: #COMPOSITE
}
define view P_EBPAO_OrderPlanCost
with parameters
P_Ledger : fins_ledger,
P_FromFiscalYearPeriod : fins_fyearperiod,
P_ToFiscalYearPeriod : fins_fyearperiod
as select from I_FinancialPlanningEntryItem as PlanCost
inner join I_MfgOrdPlngCat as PlanCategory on PlanCategory.PlanningCategory = PlanCost.PlanningCategory
and PlanCategory.PlngCatIsForOrdReltdPlnCost = 'X'
inner join P_EBPAO_OrderContextForHdrOnly as OrderContext on PlanCost.CompanyCode = OrderContext.CompanyCode
and PlanCost.OrderID = OrderContext.OrderID
{
key OrderContext.OrderID,
key OrderContext.CompanyCode,
key OrderContext.ControllingArea,
key OrderContext.Plant,
key OrderContext.ProfitCenter,
key OrderContext.OrderCategory,
key OrderContext.OrderType,
key OrderContext.StorageLocation,
key OrderContext.Product,
key OrderContext.ProductGroup,
OrderContext.BaseUnit,
sum(PlanCost.AmountInCompanyCodeCurrency) as AmountInCompanyCodeCurrency,
sum(PlanCost.AmountInGlobalCurrency) as AmountInGlobalCurrency,
sum(PlanCost.AmountInFreeDefinedCurrency1) as AmountInFreeDefinedCurrency1,
sum(PlanCost.AmountInFreeDefinedCurrency2) as AmountInFreeDefinedCurrency2,
sum(PlanCost.AmountInFreeDefinedCurrency3) as AmountInFreeDefinedCurrency3,
sum(PlanCost.AmountInFreeDefinedCurrency4) as AmountInFreeDefinedCurrency4,
sum(PlanCost.AmountInFreeDefinedCurrency5) as AmountInFreeDefinedCurrency5,
sum(PlanCost.AmountInFreeDefinedCurrency6) as AmountInFreeDefinedCurrency6,
sum(PlanCost.AmountInFreeDefinedCurrency7) as AmountInFreeDefinedCurrency7,
sum(PlanCost.AmountInFreeDefinedCurrency8) as AmountInFreeDefinedCurrency8
}
where
(
PlanCost.AccountAssignmentType = 'OR'
or PlanCost.AccountAssignmentType = 'OP'
)
and PlanCost.FiscalYearPeriod >= :P_FromFiscalYearPeriod
and PlanCost.FiscalYearPeriod <= :P_ToFiscalYearPeriod
and PlanCost.Ledger = :P_Ledger
and(
OrderContext.MfgOrderHasMultipleItems = ''
or(
OrderContext.MfgOrderHasMultipleItems = 'X'
and( /* Debits on Header level - Goods Issues / Confirmations */
(
PlanCost.ControllingDebitCreditCode = 'H' /* Debit */
or PlanCost.ControllingDebitCreditCode = 'S' /* Debit */
)
and PlanCost.AccountAssignmentType = 'OR' /* Order Header */
)
or( /* Credits on Item level - Goods Receipts */
(
PlanCost.ControllingDebitCreditCode = 'A' /* Credit */
or PlanCost.ControllingDebitCreditCode = 'L' /* Credit */
)
and PlanCost.AccountAssignmentType = 'OP' /* Order Item */
)
)
)
group by
OrderContext.OrderID,
OrderContext.CompanyCode,
OrderContext.ControllingArea,
OrderContext.Plant,
OrderContext.ProfitCenter,
OrderContext.OrderCategory,
OrderContext.OrderType,
OrderContext.StorageLocation,
OrderContext.Product,
OrderContext.ProductGroup,
OrderContext.BaseUnit
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FINANCIALPLANNINGENTRYITEM",
"I_MFGORDPLNGCAT",
"P_EBPAO_ORDERCONTEXTFORHDRONLY"
],
"ASSOCIATED":
[],
"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