P_MfgOrdTargetCost1V2

DDL: P_MFGORDTARGETCOST1V2 SQL: PMFGORDTGTCST1V2 Type: view COMPOSITE

P_MfgOrdTargetCost1V2 is a Composite CDS View in SAP S/4HANA. It reads from 5 data sources (P_AMDP_DET_MAT_COST_EST, P_MfgOrderSpclStockValStrategy, P_PCCCostEstimateItem2V2, P_PCCCostEstimateItem2V2, P_PCCOrderActualOutputQuantity) and exposes 37 fields with key fields OrderID, OrderItem, CompanyCode, AccountAssignmentType, ControllingArea.

Data Sources (5)

SourceAliasJoin Type
P_AMDP_DET_MAT_COST_EST P_AMDP_DET_MAT_COST_EST from
P_MfgOrderSpclStockValStrategy P_MfgOrderSpclStockValStrategy union_all
P_PCCCostEstimateItem2V2 P_PCCCostEstimateItem2V2 inner
P_PCCCostEstimateItem2V2 P_PCCCostEstimateItem2V2 inner
P_PCCOrderActualOutputQuantity P_PCCOrderActualOutputQuantity inner

Parameters (4)

NameTypeDefault
P_FromFiscalYearPeriod fis_jahrper
P_ToFiscalYearPeriod fis_jahrper
P_Ledger fins_ledger
P_CurrencyRole fac_crcyrole

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PMFGORDTGTCST1V2 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 (37)

KeyFieldSource TableSource FieldDescription
KEY OrderID _amdp_mce OrderID Order ID
KEY OrderItem _amdp_mce OrderItem
KEY CompanyCode _CostEstimate CompanyCode Receiver Company Code
KEY AccountAssignmentType AccountAssignmentType Sndr AcctAssgmt Type
KEY ControllingArea ControllingArea Controlling Area
KEY product product Product Sold
KEY Plant _CostEstimate Plant Valuation Area
KEY GLAccount CostElement G/L Account
KEY WorkCenterInternalID WorkCenterInternalID Work Center
KEY OrderOperation OrderOperation Operation or Phase
KEY TargetCostVariant
KEY ControllingValueType
KEY ControllingDebitCreditCode ControllingDebitCreditCode Dr/Cr ind. CO
KEY PartnerCostCenter PartnerCostCenter Sender Cost Ctr
KEY PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
KEY UnitOfMeasure CostSourceUnit
KEY IsLotSizeIndependent IsLotSizeIndependent
KEY ValuationStrategy ValuationStrategy
OrderID Order ID
KEY OrderItem _TargetCostStrategy OrderItem
KEY CompanyCode _CostEstimate CompanyCode Receiver Company Code
KEY AccountAssignmentType AccountAssignmentType Sndr AcctAssgmt Type
KEY ControllingArea ControllingArea Controlling Area
KEY product product Product Sold
KEY Plant _CostEstimate Plant Valuation Area
KEY GLAccount CostElement G/L Account
KEY WorkCenterInternalID WorkCenterInternalID Work Center
KEY OrderOperation OrderOperation Operation or Phase
KEY TargetCostVariant
KEY ControllingValueType
KEY ControllingDebitCreditCode ControllingDebitCreditCode Dr/Cr ind. CO
KEY PartnerCostCenter PartnerCostCenter Sender Cost Ctr
KEY PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
KEY UnitOfMeasure CostSourceUnit
KEY IsLotSizeIndependent IsLotSizeIndependent
KEY ValuationStrategy ValuationStrategy
quan233else0endendasTotalQuantity

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_MfgOrdTargetCost1V2.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PMFGORDTGTCST1V2
-- Parameters: P_FromFiscalYearPeriod : fis_jahrper, P_ToFiscalYearPeriod : fis_jahrper, P_Ledger : fins_ledger, P_CurrencyRole : fac_crcyrole

CREATE VIEW P_MfgOrdTargetCost1V2 AS
SELECT
  _amdp_mce.OrderID AS OrderID,
  _amdp_mce.OrderItem AS OrderItem,
  _CostEstimate.CompanyCode AS CompanyCode,
  AccountAssignmentType,
  ControllingArea,
  product,
  _CostEstimate.Plant AS Plant,
  CostElement AS GLAccount,
  WorkCenterInternalID,
  OrderOperation,
  cast('000' as fis_awvrs ) AS TargetCostVariant,
  cast('05' as co_wrttp) AS ControllingValueType,
  ControllingDebitCreditCode,
  PartnerCostCenter,
  PartnerCostCtrActivityType,
  CostSourceUnit AS UnitOfMeasure,
  IsLotSizeIndependent,
  ValuationStrategy,
  case when IsLotSizeIndependent = 'X' then TotalQuantity else case when CostingLotSize <> 0 then cast( round(cast(division(-ActualOutputQuantity, CostingLotSize, 6) as abap.dec(14, 6)) * TotalQuantity, 3) as abap.quan(23, 3) ) else 0 end end as TotalQuantity AS quan233else0endendasTotalQuantity
FROM P_AMDP_DET_MAT_COST_EST
INNER JOIN P_PCCCostEstimateItem2V2 ON /* join condition not captured in parsed metadata */
INNER JOIN P_PCCOrderActualOutputQuantity ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_MfgOrderSpclStockValStrategy
;