P_EBPC_TargetCost_F5

DDL: P_EBPC_TARGETCOST_F5 Type: view_entity COMPOSITE Package: ODATA_CO_RT_PRODUCTION_COSTS

Event-Based Order Target Cost

P_EBPC_TargetCost_F5 is a Composite CDS View that provides data about "Event-Based Order Target Cost" in SAP S/4HANA. It reads from 6 data sources and exposes 12 fields with key fields OrderID, OrderItem, ObjectInternalID, OrderItem, ObjectInternalID. Part of development package ODATA_CO_RT_PRODUCTION_COSTS.

Data Sources (6)

SourceAliasJoin Type
P_EBOrderActualOutputQty P_EBOrderActualOutputQty inner
P_EBOrderHdrAndItemValStrategy P_EBOrderHdrAndItemValStrategy from
P_EBOrderHdrAndItemValStrategy P_EBOrderHdrAndItemValStrategy union_all
P_EBPC_CostEstimate_F5_2 P_EBPC_CostEstimate_F5_2 inner
P_EBPC_CostEstimate_F5_2 P_EBPC_CostEstimate_F5_2 inner
P_EBPC_MfgOutputQuantity P_EBPC_MfgOutputQuantity inner

Parameters (4)

NameTypeDefault
P_Ledger fins_ledger
P_FromFiscalYearPeriod fis_jahrper
P_ToFiscalYearPeriod fis_jahrper
P_CurrencyRole fac_crcyrole

Annotations (4)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY OrderID _TargetCostStrategy OrderID Order ID
KEY OrderItem _TargetCostStrategy OrderItem
KEY ObjectInternalID _TargetCostStrategy ObjectInternalID Object number
ValuationStrategy _TargetCostStrategy ValuationStrategy
CompanyCode _TargetCostStrategy CompanyCode Receiver Company Code
P_Ledger
P_FromFiscalYearPeriod
OrderID Order ID
KEY OrderItem _TargetCostStrategy OrderItem
KEY ObjectInternalID _TargetCostStrategy ObjectInternalID Object number
ValuationStrategy _TargetCostStrategy ValuationStrategy
CompanyCode _TargetCostStrategy CompanyCode Receiver Company Code

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_EBPC_TargetCost_F5.
-- 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.
-- Parameters: P_Ledger : fins_ledger, P_FromFiscalYearPeriod : fis_jahrper, P_ToFiscalYearPeriod : fis_jahrper, P_CurrencyRole : fac_crcyrole

CREATE VIEW P_EBPC_TargetCost_F5 AS
SELECT
  _TargetCostStrategy.OrderID AS OrderID,
  _TargetCostStrategy.OrderItem AS OrderItem,
  _TargetCostStrategy.ObjectInternalID AS ObjectInternalID,
  _TargetCostStrategy.ValuationStrategy AS ValuationStrategy,
  _TargetCostStrategy.CompanyCode AS CompanyCode,
  sum( case when _CostEstimate.ControllingDebitCreditCode = 'H' or _CostEstimate.ControllingDebitCreditCode = 'S' then case when _CostEstimate.IsLotSizeIndependent = 'X' then _CostEstimate.AmountInDisplayCurrency else case when _CostEstimate.CostingLotSize <> 0 then cast( round(cast(division(cast(_ActualQuantity.ActualOutputQuantity as abap.dec(15, 3)), cast(_CostEstimate.CostingLotSize as abap.dec(15, 3)), 6) as abap.dec(14, 6)) * _CostEstimate.AmountInDisplayCurrency * -1, 2) as abap.dec( 23, 2 ) ) else 0 end end else 0 end ) as DebitTargetCostInDspCrcy AS P_Ledger,
  P_CurrencyRole : $parameters.P_CurrencyRole) as _TargetCostStrategy inner join P_EBPC_MfgOutputQuantity( P_FromFiscalYearPeriod : $parameters.P_FromFiscalYearPeriod AS P_FromFiscalYearPeriod
FROM P_EBOrderHdrAndItemValStrategy
INNER JOIN P_EBOrderActualOutputQty ON /* join condition not captured in parsed metadata */
INNER JOIN P_EBPC_CostEstimate_F5_2 ON /* join condition not captured in parsed metadata */
INNER JOIN P_EBPC_MfgOutputQuantity ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_EBOrderHdrAndItemValStrategy
;