C_SchedProdnProdVersWeek

DDL: C_SCHEDPRODNPRODVERSWEEK Type: view_entity CONSUMPTION Package: ODATA_PP_CAP_SCHEDPRODN

Production Versions In Week Bucket

C_SchedProdnProdVersWeek is a Consumption CDS View that provides data about "Production Versions In Week Bucket" in SAP S/4HANA. It reads from 4 data sources (I_Capacity, I_SchedProdnOperations, I_ProductionVersion, I_WorkCenter) and exposes 45 fields with key fields SimulationSessionID, OrderID, CapacityRequirementItem, OrderCategory, CapacityRqmtItemCapacity. It has 5 associations to related views. Part of development package ODATA_PP_CAP_SCHEDPRODN.

Data Sources (4)

SourceAliasJoin Type
I_Capacity _Capacity inner
I_SchedProdnOperations _order left_outer
I_ProductionVersion _prodvers from
I_WorkCenter _WorkCenter inner

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_UnitOfMeasure _Uom _Uom.UnitOfMeasure = 'H'
[1..*] I_CalendarDate _calenderdate _calenderdate.CalendarDate >= _prodvers.ValidityStartDate and _calenderdate.CalendarDate <= _prodvers.ValidityEndDate and _calenderdate.WeekDay = '7'
[0..1] C_SchedProdnOrderCategoryVH _OrderCategory $projection.OrderCategory = _OrderCategory.OrderCategory
[0..*] I_WorkCenterText _WorkCenterText $projection.WorkCenterInternalID = _WorkCenterText.WorkCenterInternalID
[1..1] I_SOSTypeText _SOSTypeText _SOSTypeText.SOSType = 'VERID' and _SOSTypeText.Language = $session.system_language

Annotations (13)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Production Versions In Week Bucket view
VDM.viewType #CONSUMPTION view
UI.headerInfo.description.type #STANDARD view
UI.headerInfo.description.value Operationseqno view
UI.headerInfo.title.type #STANDARD view
UI.headerInfo.title.value OrderID view
UI.headerInfo.typeName Available Time Buckets view
UI.headerInfo.typeNamePlural Available Time Buckets view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
Search.searchable false view

Fields (45)

KeyFieldSource TableSource FieldDescription
KEY SimulationSessionID I_SchedProdnOperations SimulationSessionID
KEY OrderID I_SchedProdnOperations OrderID Order ID
KEY CapacityRequirementItem I_SchedProdnOperations CapacityRequirementItem
KEY OrderCategory I_SchedProdnOperations OrderCategory Order Category
KEY CapacityRqmtItemCapacity I_SchedProdnOperations CapacityRqmtItemCapacity
KEY CapacityRequirement I_SchedProdnOperations CapacityRequirement
KEY Product I_ProductionVersion Material Vehicle Model
KEY Plant I_ProductionVersion Plant Valuation Area
KEY ProductionVersion I_ProductionVersion ProductionVersion Version ID
KEY WorkCenter I_ProductionVersion ProductionLine Production Line
KEY CalendarWeek _calenderdate CalendarWeek Calendar Week
KEY CalendarYear
FirstDayOfWeekDate _calenderdate FirstDayOfWeekDate First day of week date
LastDayOfWeekDate
ProductionVersionText I_ProductionVersion ProductionVersionText Vertikalization Text
WorkCenterInternalID I_WorkCenter WorkCenterInternalID Work Center
WorkCenterDesc
Operation I_SchedProdnOperations Operation Transaction
OperationLatestStartDate I_SchedProdnOperations OperationLatestStartDate
OperationLatestEndDate I_SchedProdnOperations OperationLatestEndDate
OperationLatestStartTime I_SchedProdnOperations OperationLatestStartTime
OperationLatestEndTime I_SchedProdnOperations OperationLatestEndTime
LtstSchedldExecStrtDteTme I_SchedProdnOperations LtstSchedldExecStrtDteTme
LtstSchedldExecEndDteTme I_SchedProdnOperations LtstSchedldExecEndDteTme
SchedldOrdStartDteTme I_SchedProdnOperations SchedldOrdStartDteTme
SchedldOrdEndDteTme I_SchedProdnOperations SchedldOrdEndDteTme
RemainingCapReqExecutionDurn I_SchedProdnOperations RemainingCapReqExecutionDurn
OperationPlanningStatusCode I_SchedProdnOperations OperationPlanningStatusCode
OperationIsDispatched
RemainingCapacityDurn
ConsumedCapacityDurn
StatusCriticality
PlanningBucketStartDateTime
PlanningBucketEndDateTime
UnitOfMeasure _Uom UnitOfMeasure Unit Protected Qty
UnitOfMeasure_E _Uom UnitOfMeasure_E
OrderCategoryName _OrderCategory OrderCategoryName
BOOExplosionDate I_SchedProdnOperations BOOExplosionDate
BOMExplosionDate I_SchedProdnOperations BOMExplosionDate
PlndOrderPlannedStartDate I_SchedProdnOperations PlndOrderPlannedStartDate
PlndOrderPlannedEndDate I_SchedProdnOperations PlndOrderPlannedEndDate
OrderOperationEndDateTime
OrderOperationStartDateTime
RequirementDateTime
AddressTimeZoneendasPlantTimeZone

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 C_SchedProdnProdVersWeek.
-- 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.

CREATE VIEW C_SchedProdnProdVersWeek AS
SELECT
  _order.SimulationSessionID AS SimulationSessionID,
  _order.OrderID AS OrderID,
  _order.CapacityRequirementItem AS CapacityRequirementItem,
  _order.OrderCategory AS OrderCategory,
  _order.CapacityRqmtItemCapacity AS CapacityRqmtItemCapacity,
  _order.CapacityRequirement AS CapacityRequirement,
  _prodvers.Material AS Product,
  _prodvers.Plant AS Plant,
  _prodvers.ProductionVersion AS ProductionVersion,
  _prodvers.ProductionLine AS WorkCenter,
  _calenderdate.CalendarWeek AS CalendarWeek,
  cast(substring(_calenderdate.YearWeek,1,4)as abap.numc(4)) AS CalendarYear,
  _calenderdate.FirstDayOfWeekDate AS FirstDayOfWeekDate,
  dats_add_days( _calenderdate.FirstDayOfWeekDate,6,'FAIL') AS LastDayOfWeekDate,
  _prodvers.ProductionVersionText AS ProductionVersionText,
  _WorkCenter.WorkCenterInternalID AS WorkCenterInternalID,
  _WorkCenterText[1:Language=$session.system_language].WorkCenterText AS WorkCenterDesc,
  _order.Operation AS Operation,
  _order.OperationLatestStartDate AS OperationLatestStartDate,
  _order.OperationLatestEndDate AS OperationLatestEndDate,
  _order.OperationLatestStartTime AS OperationLatestStartTime,
  _order.OperationLatestEndTime AS OperationLatestEndTime,
  _order.LtstSchedldExecStrtDteTme AS LtstSchedldExecStrtDteTme,
  _order.LtstSchedldExecEndDteTme AS LtstSchedldExecEndDteTme,
  _order.SchedldOrdStartDteTme AS SchedldOrdStartDteTme,
  _order.SchedldOrdEndDteTme AS SchedldOrdEndDteTme,
  _order.RemainingCapReqExecutionDurn AS RemainingCapReqExecutionDurn,
  _order.OperationPlanningStatusCode AS OperationPlanningStatusCode,
  cast('' as flag preserving type ) AS OperationIsDispatched,
  fltp_to_dec(0.00 as pph_cfs_sch_remaining_cap) AS RemainingCapacityDurn,
  fltp_to_dec(0.00 as pph_cfs_sch_consumed_cap) AS ConsumedCapacityDurn,
  cast(0 as pph_cfs_sch_criticality_status) AS StatusCriticality,
  cast(0 as pph_cfs_sch_bucket_starttmstmp) AS PlanningBucketStartDateTime,
  cast(0 as pph_cfs_sch_bucket_end_tmstmp) AS PlanningBucketEndDateTime,
  _Uom.UnitOfMeasure AS UnitOfMeasure,
  _Uom.UnitOfMeasure_E AS UnitOfMeasure_E,
  _OrderCategory.OrderCategoryName AS OrderCategoryName,
  _order.BOOExplosionDate AS BOOExplosionDate,
  _order.BOMExplosionDate AS BOMExplosionDate,
  _order.PlndOrderPlannedStartDate AS PlndOrderPlannedStartDate,
  _order.PlndOrderPlannedEndDate AS PlndOrderPlannedEndDate,
  cast('000000000000000' as timestamp) AS OrderOperationEndDateTime,
  cast('000000000000000' as timestamp) AS OrderOperationStartDateTime,
  cast('000000000000000' as timestamp) AS RequirementDateTime,
  case when _WorkCenter._Plant._StandardOrganizationAddress.AddressTimeZone is null or _WorkCenter._Plant._StandardOrganizationAddress.AddressTimeZone is initial then abap_system_timezone($session.client, 'NULL') when _WorkCenter._Plant._StandardOrganizationAddress.AddressTimeZone is not null then _WorkCenter._Plant._StandardOrganizationAddress.AddressTimeZone end as PlantTimeZone AS AddressTimeZoneendasPlantTimeZone
FROM I_ProductionVersion AS _prodvers
INNER JOIN I_WorkCenter AS _WorkCenter ON /* join condition not captured in parsed metadata */
INNER JOIN I_Capacity AS _Capacity ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_SchedProdnOperations AS _order ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_UnitOfMeasure AS _Uom ON _Uom.UnitOfMeasure = 'H'  -- association [0..1]
LEFT OUTER JOIN I_CalendarDate AS _calenderdate ON _calenderdate.CalendarDate >= _prodvers.ValidityStartDate AND _calenderdate.CalendarDate <= _prodvers.ValidityEndDate AND _calenderdate.WeekDay = '7'  -- association [1..*]
LEFT OUTER JOIN C_SchedProdnOrderCategoryVH AS _OrderCategory ON OrderCategory = _OrderCategory.OrderCategory  -- association [0..1]
LEFT OUTER JOIN I_WorkCenterText AS _WorkCenterText ON WorkCenterInternalID = _WorkCenterText.WorkCenterInternalID  -- association [0..*]
LEFT OUTER JOIN I_SOSTypeText AS _SOSTypeText ON _SOSTypeText.SOSType = 'VERID' AND _SOSTypeText.Language = $session.system_language  -- association [1..1]
;