P_EBWIP_OrderCost2

DDL: P_EBWIP_ORDERCOST2 SQL: PEBWIPORDCST2 Type: view COMPOSITE

P_EBWIP_OrderCost2 is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (I_LedgerCompanyCodeCrcyRolesVH, I_ProductCostCtrlgOrder, P_EBWIP_OrderCost1, P_EBWIP_WIP3) and exposes 27 fields with key fields CompanyCode, OrderID.

Data Sources (4)

SourceAliasJoin Type
I_LedgerCompanyCodeCrcyRolesVH _LdgrCompCodeCrcy inner
I_ProductCostCtrlgOrder _OrderHeader inner
P_EBWIP_OrderCost1 P_EBWIP_OrderCost1 from
P_EBWIP_WIP3 P_EBWIP_WIP3 inner

Parameters (3)

NameTypeDefault
P_KeyDate fins_fperiod_enddate
P_Ledger fins_ledger
P_CurrencyRole fac_crcyrole

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PEBWIPORDCST2 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode _OrderCost CompanyCode Receiver Company Code
KEY OrderID _OrderCost OrderID Order ID
ObjectInternalID I_ProductCostCtrlgOrder ObjectInternalID Object number
OrderDescription OrderDescription
OrderType OrderType Order Type
OrderCategory OrderCategory Order Category
Material _OrderCost Material Vehicle Model
Plant I_ProductCostCtrlgOrder Plant Valuation Area
ProfitCenter ProfitCenter Profit Center
ControllingArea ControllingArea Controlling Area
FunctionalArea I_ProductCostCtrlgOrder FunctionalArea Sendr Fctl Area
StorageLocation _RepresentativeOrderItem StorageLocation StorageLocation
MRPArea _RepresentativeOrderItem MRPArea MRP Area
MRPPlant _RepresentativeOrderItem MRPPlant Plant
MfgOrderHasMultipleItems MfgOrderHasMultipleItems
DisplayCurrency I_LedgerCompanyCodeCrcyRolesVH Currency Valuation Crcy
WIPCostInDspCrcy WIPCostInDspCrcy
ReservesUnrealizedCostsAmount ReservesUnrealizedCostsAmount
ProducedAmountInDspCrcy
CompletedQuantityToDate
ActualOutputQuantity
curr232else0endasPlanCostAmountInDspCrcy
UnitOfMeasure _RepresentativeOrderItem BaseUnit Unit of Measure
CreatedByUser I_ProductCostCtrlgOrder CreatedByUser User Name
CreationDate I_ProductCostCtrlgOrder CreationDate Time Stamp
LastChangedByUser I_ProductCostCtrlgOrder LastChangedByUser User Name
LastChangeDate I_ProductCostCtrlgOrder LastChangeDate Time Stamp

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_EBWIP_OrderCost2.
-- 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: PEBWIPORDCST2
-- Parameters: P_KeyDate : fins_fperiod_enddate, P_Ledger : fins_ledger, P_CurrencyRole : fac_crcyrole

CREATE VIEW P_EBWIP_OrderCost2 AS
SELECT
  _OrderCost.CompanyCode AS CompanyCode,
  _OrderCost.OrderID AS OrderID,
  _OrderHeader.ObjectInternalID AS ObjectInternalID,
  OrderDescription,
  OrderType,
  OrderCategory,
  _OrderCost.Material AS Material,
  _OrderHeader.Plant AS Plant,
  ProfitCenter,
  ControllingArea,
  _OrderHeader.FunctionalArea AS FunctionalArea,
  _RepresentativeOrderItem.StorageLocation AS StorageLocation,
  _RepresentativeOrderItem.MRPArea AS MRPArea,
  _RepresentativeOrderItem.MRPPlant AS MRPPlant,
  MfgOrderHasMultipleItems,
  _LdgrCompCodeCrcy.Currency AS DisplayCurrency,
  WIPCostInDspCrcy,
  ReservesUnrealizedCostsAmount,
  coalesce(ProducedAmountInDspCrcy, 0) AS ProducedAmountInDspCrcy,
  coalesce(CompletedQuantityToDate, 0) AS CompletedQuantityToDate,
  coalesce(ActualOutputQuantity, 0) AS ActualOutputQuantity,
  case when CostingLotSize <> 0 and OrderCategory <> '05' then cast( _mce_wip.LotSizeIndependentCosts + ( round(cast(division((_RepresentativeOrderItem.ItemQuantity - _RepresentativeOrderItem.MfgOrderItemPlannedScrapQty), CostingLotSize, 6) as abap.dec(14, 6)) * _mce_wip.PlanCostInDspCrcy, 2) ) as abap.curr( 23, 2 ) ) else 0 end as PlanCostAmountInDspCrcy AS curr232else0endasPlanCostAmountInDspCrcy,
  _RepresentativeOrderItem.BaseUnit AS UnitOfMeasure,
  _OrderHeader.CreatedByUser AS CreatedByUser,
  _OrderHeader.CreationDate AS CreationDate,
  _OrderHeader.LastChangedByUser AS LastChangedByUser,
  _OrderHeader.LastChangeDate AS LastChangeDate
FROM P_EBWIP_OrderCost1
INNER JOIN I_ProductCostCtrlgOrder AS _OrderHeader ON /* join condition not captured in parsed metadata */
INNER JOIN P_EBWIP_WIP3 ON /* join condition not captured in parsed metadata */
INNER JOIN I_LedgerCompanyCodeCrcyRolesVH AS _LdgrCompCodeCrcy ON /* join condition not captured in parsed metadata */
;