P_MfgOrdTargetCost3V2
P_MfgOrdTargetCost3V2 is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_COMFGOrderOutputQuantities, P_MfgOrdPlanCostByLdgr2V2) and exposes 19 fields with key fields OrderID, OrderItem, CompanyCode, AccountAssignmentType, ControllingArea.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_COMFGOrderOutputQuantities | P_COMFGOrderOutputQuantities | from |
| P_MfgOrdPlanCostByLdgr2V2 | P_MfgOrdPlanCostByLdgr2V2 | inner |
Parameters (4)
| Name | Type | Default |
|---|---|---|
| P_FromFiscalYearPeriod | fis_jahrper | |
| P_ToFiscalYearPeriod | fis_jahrper | |
| P_Ledger | fins_ledger | |
| P_CurrencyRole | fac_crcyrole |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMFGORDTGTCST3V2 | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.viewType | #COMPOSITE | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.private | true | view |
Fields (19)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | OrderID | _PlanQuantity | OrderID | |
| KEY | OrderItem | _PlanQuantity | OrderItem | |
| KEY | CompanyCode | _PlanCost | CompanyCode | |
| KEY | AccountAssignmentType | AccountAssignmentType | ||
| KEY | ControllingArea | ControllingArea | ||
| KEY | product | _PlanCost | Material | |
| KEY | Plant | _PlanCost | Plant | |
| KEY | GLAccount | GLAccount | ||
| KEY | WorkCenterInternalID | WorkCenterInternalID | ||
| KEY | OrderOperation | OrderOperation | ||
| KEY | TargetCostVariant | |||
| KEY | ControllingValueType | |||
| KEY | ControllingDebitCreditCode | ControllingDebitCreditCode | ||
| KEY | PartnerCostCenter | PartnerCostCenter | ||
| KEY | PartnerCostCtrActivityType | PartnerCostCtrActivityType | ||
| KEY | UnitOfMeasure | CostSourceUnit | ||
| KEY | IsLotSizeIndependent | IsLotSizeIndependent | ||
| KEY | ValuationStrategy | |||
| quan233else0endendasTotalQuantity |
@AbapCatalog.sqlViewName: 'PMFGORDTGTCST3V2'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
@VDM.private: true
// PLANORD01 (Target Variant 1)
define view P_MfgOrdTargetCost3V2
with parameters
P_FromFiscalYearPeriod : fis_jahrper,
P_ToFiscalYearPeriod : fis_jahrper,
P_Ledger : fins_ledger,
P_CurrencyRole : fac_crcyrole
as select from P_COMFGOrderOutputQuantities( P_FromFiscalYearPeriod : :P_FromFiscalYearPeriod,
P_ToFiscalYearPeriod : :P_ToFiscalYearPeriod ) as _PlanQuantity
inner join P_MfgOrdPlanCostByLdgr2V2( P_Ledger : :P_Ledger,
P_CurrencyRole : :P_CurrencyRole ) as _PlanCost on _PlanCost.OrderID = _PlanQuantity.OrderID
and _PlanCost.OrderItem = _PlanQuantity.OrderItem
{
key _PlanQuantity.OrderID,
key _PlanQuantity.OrderItem,
key _PlanCost.CompanyCode,
key AccountAssignmentType,
key ControllingArea,
key _PlanCost.Material as product,
key _PlanCost.Plant,
key GLAccount,
key WorkCenterInternalID,
key OrderOperation,
key cast('001' as fis_awvrs ) as TargetCostVariant,
key cast('05' as co_wrttp) as ControllingValueType,
key ControllingDebitCreditCode,
key PartnerCostCenter,
key PartnerCostCtrActivityType,
key CostSourceUnit as UnitOfMeasure,
key IsLotSizeIndependent,
key cast('3' as ck_lbwst) as ValuationStrategy,
case
when IsLotSizeIndependent = 'X' then AmountInDisplayCurrency
else
case
when PlanOutputQuantity <> 0
then cast( round(cast(division(ActualOutputQuantity, PlanOutputQuantity, 6) as abap.dec(14, 6)) * AmountInDisplayCurrency, 2) as abap.curr( 23, 2 ) )
else 0
end
end as AmountInDisplayCurrency,
case
when IsLotSizeIndependent = 'X' then FixedAmountInDisplayCurrency
else
case
when PlanOutputQuantity <> 0
then cast( round(cast(division(ActualOutputQuantity, PlanOutputQuantity, 6) as abap.dec(14, 6)) * FixedAmountInDisplayCurrency, 2) as abap.curr( 23, 2 ) )
else 0
end
end as FixedAmountInDisplayCurrency,
case
when IsLotSizeIndependent = 'X' then TotalQuantity
else
case
when PlanOutputQuantity <> 0
then cast( round(cast(division(ActualOutputQuantity, PlanOutputQuantity, 6) as abap.dec(14, 6)) * TotalQuantity, 3) as abap.quan( 23, 3 ) )
else 0
end
end as TotalQuantity
}where _PlanQuantity.ActualOutputQuantity <> 0
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_COMFGORDEROUTPUTQUANTITIES",
"P_MFGORDPLANCOSTBYLDGR2V2"
],
"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