C_CacheMRPMfgOrder

DDL: C_CACHEMRPMFGORDER SQL: CCACHEMRPMFGORD Type: view CONSUMPTION Package: ODATA_PP_MRP

MRP Manufacturing Orders

C_CacheMRPMfgOrder is a Consumption CDS View that provides data about "MRP Manufacturing Orders" in SAP S/4HANA. It reads from 2 data sources (I_CacheMRPMfgOrder, I_SDMAreaOfResponsibility) and exposes 99 fields with key fields MRPPlant, MRPPlanningSegmentType, MRPPlanningSegment, MaterialShortageProfile, MaterialShortageProfileCount. It has 18 associations to related views. Part of development package ODATA_PP_MRP.

Data Sources (2)

SourceAliasJoin Type
I_CacheMRPMfgOrder I_CacheMRPMfgOrder from
I_SDMAreaOfResponsibility SDMAreaOfResponsibility inner

Associations (18)

CardinalityTargetAliasCondition
[0..1] I_MaterialShortageDefinition _MaterialShortageDef $projection.MaterialShortageProfile = _MaterialShortageDef.MaterialShortageProfile and $projection.MaterialShortageProfileCount = _MaterialShortageDef.MaterialShortageProfileCount
[0..*] I_MaterialText _MaterialText $projection.Material = _MaterialText.Material
[0..1] I_MfgOrderTypeText _MfgOrderTypeText $projection.ManufacturingOrderType = _MfgOrderTypeText.ManufacturingOrderType and _MfgOrderTypeText.Language = $session.system_language
[0..1] I_ProductionSupervisor _ProductionSupervisor $projection.ProductionPlant = _ProductionSupervisor.Plant and $projection.ProductionSupervisor = _ProductionSupervisor.ProductionSupervisor
[0..1] I_MfgOrderCategoryText _MfgOrderCategoryText $projection.MRPElementCategory = _MfgOrderCategoryText.ManufacturingOrderCategory and _MfgOrderCategoryText.Language = $session.system_language
[0..1] I_MRPElementCategoryText _MRPElementCategoryText $projection.MRPElementCategory = _MRPElementCategoryText.MRPElementCategory and _MRPElementCategoryText.Language = $session.system_language
[0..1] I_MfgOrdProgressStatusText _ProgressStatusText $projection.MfgOrderProgressStatus = _ProgressStatusText.MfgOrderProgressStatus and _ProgressStatusText.Language = $session.system_language
[0..1] I_MfgOrdProgressNextStatusText _NextStatusText $projection.MfgOrderProgressNextStatus = _NextStatusText.MfgOrderProgressNextStatus and _NextStatusText.Language = $session.system_language
[0..1] I_MRPController _MRPController $projection.MRPPlant = _MRPController.Plant and $projection.MRPController = _MRPController.MRPController
[0..1] C_ComponentCoverageVH _ComponentCoverage _ComponentCoverage.CompCvrgInWrkDaysSelection = $projection.CompCvrgInWrkDaysSelection
[0..1] C_MaterialDelayVH _MaterialDelay _MaterialDelay.MaterialDlyInWorkDaysSelection = $projection.MaterialDlyInWorkDaysSelection
[0..1] C_MfgOrderProgressStatusVH _MfgOrderProgressStatus _MfgOrderProgressStatus.MfgOrdProgressStatusSelection = $projection.MfgOrdProgressStatusSelection
[0..1] I_MfgOrderMRPControllerVH _MRPControllerVH $projection.MRPPlant = _MRPControllerVH.Plant and $projection.MRPController = _MRPControllerVH.MRPController
[1..1] C_PlantVH _PlantVH $projection.MRPPlant = _PlantVH.Plant
[0..1] I_ProductionLineStdVH _ProductionLineVH $projection.ProductionPlant = _ProductionLineVH.Plant and $projection.ProductionLine = _ProductionLineVH.ProductionLine
[0..1] I_ProductionVersionStdVH _ProductionVersionVH $projection.ProductionPlant = _ProductionVersionVH.Plant and $projection.ProductionVersion = _ProductionVersionVH.ProductionVersion and $projection.Material = _ProductionVersionVH.Material
[0..1] C_MRPAreaValHelp _MRPAreaVH $projection.MRPArea = _MRPAreaVH.MRPArea and $projection.MRPPlant = _MRPAreaVH.Plant
[0..1] I_MfgOrderProdnSupervisorVH _ProductionSupervisorVH $projection.ProductionPlant = _ProductionSupervisorVH.Plant and $projection.ProductionSupervisor = _ProductionSupervisorVH.ProductionSupervisor

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName CCACHEMRPMFGORD view
AbapCatalog.compiler.compareFilter true view
EndUserText.label MRP Manufacturing Orders view
ClientHandling.algorithm #SESSION_VARIABLE view
Search.searchable true view
Metadata.allowExtensions true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #CONSUMPTION view
UI.headerInfo.typeName Monitor Production Orders view
UI.headerInfo.typeNamePlural Materials view

Fields (99)

KeyFieldSource TableSource FieldDescription
KEY MRPPlant I_CacheMRPMfgOrder MRPPlant
KEY MRPPlanningSegmentType
KEY MRPPlanningSegment I_CacheMRPMfgOrder MRPPlanningSegment
KEY MaterialShortageProfile I_CacheMRPMfgOrder MaterialShortageProfile
KEY MaterialShortageProfileCount I_CacheMRPMfgOrder MaterialShortageProfileCount
KEY MRPElementCategory I_CacheMRPMfgOrder MRPElementCategory
KEY MRPElement
KEY Material I_CacheMRPMfgOrder Material
MRPArea I_CacheMRPMfgOrder MRPArea
FactoryCalendar I_CacheMRPMfgOrder FactoryCalendar
PlantName _PlantVH PlantName
MaterialendasMaterialName
MRPAreaText _MRPAreaVH MRPAreaText
ProductionPlant I_CacheMRPMfgOrder ProductionPlant
MRPController I_CacheMRPMfgOrder MRPController
MRPControllerName _MRPController MRPControllerName
ManufacturingOrderType I_CacheMRPMfgOrder ManufacturingOrderType
ManufacturingOrderTypeName _MfgOrderTypeText ManufacturingOrderTypeName
MRPElementCategoryName _MRPElementCategoryText MRPElementCategoryName
MRPElementCategoryShortName _MRPElementCategoryText MRPElementCategoryShortName
MfgOrderProgressStatus I_CacheMRPMfgOrder MfgOrderProgressStatus
MfgOrderProgressStatusName
MfgOrderProgressNextStatus I_CacheMRPMfgOrder MfgOrderProgressNextStatus
MfgOrderProgressNextStatusName
MfgOrderPlannedStartDate I_CacheMRPMfgOrder MfgOrderPlannedStartDate
MfgOrderPlannedEndDate I_CacheMRPMfgOrder MfgOrderPlannedEndDate
MfgOrderPlannedTotalQty I_CacheMRPMfgOrder MfgOrderPlannedTotalQty
MRPElementAvailyOrRqmtDate I_CacheMRPMfgOrder MRPElementAvailyOrRqmtDate
MRPElementOpenQuantity I_CacheMRPMfgOrder MRPElementOpenQuantity
ProductionLine I_CacheMRPMfgOrder ProductionLine
ProductionLineText
ProductionSupervisor I_CacheMRPMfgOrder ProductionSupervisor
ProductionSupervisorName _ProductionSupervisor ProductionSupervisorName
ProductionVersion I_CacheMRPMfgOrder ProductionVersion
ProductionVersionText I_CacheMRPMfgOrder ProductionVersionText
StorageLocation I_CacheMRPMfgOrder StorageLocation
ComponentShortageDefinition I_CacheMRPMfgOrder ComponentShortageDefinition
MaterialBaseUnit I_CacheMRPMfgOrder MaterialBaseUnit
ProductionUnit I_CacheMRPMfgOrder ProductionUnit
UnitOfMeasureNumberOfDecimals I_CacheMRPMfgOrder UnitOfMeasureNumberOfDecimals
UnitOfMeasureDspNmbrOfDcmls I_CacheMRPMfgOrder UnitOfMeasureDspNmbrOfDcmls
NumberOfComponentsWithProblems
MaximumDelayInDays I_CacheMRPMfgOrder MaximumDelayInDays
MaximumDelayInWorkdays I_CacheMRPMfgOrder MaximumDelayInWorkdays
CompCvrgInWrkDaysSelection
MaterialDlyInWorkDaysSelection
MfgOrdProgressStatusSelection
DelayInProcessSelection
LateSupplyLatenessWorkdays I_CacheMRPMfgOrder LateSupplyLatenessWorkdays
LateSupplyQuantity
LateSupplyEarliestDemandDate
ManufacturingOrderIsLate I_CacheMRPMfgOrder ManufacturingOrderIsLate
MfgOrderStatusActualDate I_CacheMRPMfgOrder MfgOrderStatusActualDate
MfgOrderNextStatusPlannedDate I_CacheMRPMfgOrder MfgOrderNextStatusPlannedDate
MfgOrderPlannedReleaseDate I_CacheMRPMfgOrder MfgOrderPlannedReleaseDate
MfgOrderNextStatusDate
DurnPlndStatusToTodayInDays
DurnPlndStatusToTodayInWrkdays I_CacheMRPMfgOrder DurnPlndStatusToTodayInWrkdays
DurationToNextStatusInDays
DurnToNextStsInDaysCritlty
DurationToNextStatusInWorkdays
DurnToNextStsInWorkdaysCritlty
DurationUntilReleaseInWorkdays
DurnUntilRelInWorkdaysCritlty
DurationUntilStartInWorkdays
DurnTilStartInWorkdaysCritlty
DurationUntilEndInWorkdays
DurnTilEndInWorkdaysCritlty
DurationUntilGRInWorkdays
DurnUntilGRInWorkdaysCritlty
MaterialGoodsReceiptDuration I_CacheMRPMfgOrder MaterialGoodsReceiptDuration
MaterialCompIsProcuredDirectly I_CacheMRPMfgOrder MaterialCompIsProcuredDirectly
MatlPlngProjectNetwork
WBSElementInternalID I_CacheMRPMfgOrder WBSElementInternalID
WBSElement I_CacheMRPMfgOrder WBSElement
PlanningSegmentDocument I_CacheMRPMfgOrder PlanningSegmentDocument
PlanningSegmentDocumentItem I_CacheMRPMfgOrder PlanningSegmentDocumentItem
char6asMRPPlanningSegmentTypeDesc
MRPPlanningSegmentExternalCode
MaterialShortageDefinitionName _MaterialShortageDef MaterialShortageDefinitionName
Associations_PlantVH
_MaterialText _MaterialText
_MfgOrderTypeText _MfgOrderTypeText
_MfgOrderCategoryText _MfgOrderCategoryText
_ProductionLineVH _ProductionLineVH
_ProductionSupervisor _ProductionSupervisor
_ProductionVersionVH _ProductionVersionVH
_StorageLocation I_CacheMRPMfgOrder _StorageLocation
_ProgressStatusText _ProgressStatusText
_ComponentCoverage _ComponentCoverage
_MaterialDelay _MaterialDelay
_MfgOrderProgressStatus _MfgOrderProgressStatus
_MRPPlant _MRPPlant
_Material I_CacheMRPMfgOrder _Material
_MRPController _MRPController
_MRPControllerVH _MRPControllerVH
_ProductionPlant _ProductionPlant
_MRPAreaVH _MRPAreaVH
_ProductionSupervisorVH _ProductionSupervisorVH
@AbapCatalog.sqlViewName: 'CCACHEMRPMFGORD'
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'MRP Manufacturing Orders'
@ClientHandling.algorithm: #SESSION_VARIABLE
@Search.searchable: true
@Metadata.allowExtensions: true
@AccessControl.privilegedAssociations: ['_ProductionSupervisor', '_MRPController']
@AccessControl: {authorizationCheck: #MANDATORY,
                personalData.blocking: #REQUIRED
}

@ObjectModel: {
    usageType : { serviceQuality: #D, sizeCategory: #XL, dataClass: #MIXED }
}

@VDM.viewType: #CONSUMPTION
@UI.headerInfo.typeName: 'Monitor Production Orders'
@UI.headerInfo.typeNamePlural: 'Materials'

define view C_CacheMRPMfgOrder
  as select from I_CacheMRPMfgOrder

    inner join   I_SDMAreaOfResponsibility as SDMAreaOfResponsibility on  I_CacheMRPMfgOrder.MRPController = SDMAreaOfResponsibility.MRPController
                                                                      and I_CacheMRPMfgOrder.MRPPlant      = SDMAreaOfResponsibility.Plant
                                                                      and SDMAreaOfResponsibility.UserID   = $session.user


  association [0..1] to I_MaterialShortageDefinition   as _MaterialShortageDef    on  $projection.MaterialShortageProfile      = _MaterialShortageDef.MaterialShortageProfile
                                                                                  and $projection.MaterialShortageProfileCount = _MaterialShortageDef.MaterialShortageProfileCount

  association [0..*] to I_MaterialText                 as _MaterialText           on  $projection.Material = _MaterialText.Material

  association [0..1] to I_MfgOrderTypeText             as _MfgOrderTypeText       on  $projection.ManufacturingOrderType = _MfgOrderTypeText.ManufacturingOrderType
                                                                                  and _MfgOrderTypeText.Language         = $session.system_language

  association [0..1] to I_ProductionSupervisor         as _ProductionSupervisor   on  $projection.ProductionPlant      = _ProductionSupervisor.Plant
                                                                                  and $projection.ProductionSupervisor = _ProductionSupervisor.ProductionSupervisor

  association [0..1] to I_MfgOrderCategoryText         as _MfgOrderCategoryText   on  $projection.MRPElementCategory = _MfgOrderCategoryText.ManufacturingOrderCategory
                                                                                  and _MfgOrderCategoryText.Language = $session.system_language

  association [0..1] to I_MRPElementCategoryText       as _MRPElementCategoryText on  $projection.MRPElementCategory   = _MRPElementCategoryText.MRPElementCategory
                                                                                  and _MRPElementCategoryText.Language = $session.system_language

  association [0..1] to I_MfgOrdProgressStatusText     as _ProgressStatusText     on  $projection.MfgOrderProgressStatus = _ProgressStatusText.MfgOrderProgressStatus
                                                                                  and _ProgressStatusText.Language       = $session.system_language

  association [0..1] to I_MfgOrdProgressNextStatusText as _NextStatusText         on  $projection.MfgOrderProgressNextStatus = _NextStatusText.MfgOrderProgressNextStatus
                                                                                  and _NextStatusText.Language               = $session.system_language

  association [0..1] to I_MRPController                as _MRPController          on  $projection.MRPPlant      = _MRPController.Plant
                                                                                  and $projection.MRPController = _MRPController.MRPController

  //Value Helps for Custom Filters

  association [0..1] to C_ComponentCoverageVH          as _ComponentCoverage      on  _ComponentCoverage.CompCvrgInWrkDaysSelection = $projection.CompCvrgInWrkDaysSelection

  association [0..1] to C_MaterialDelayVH              as _MaterialDelay          on  _MaterialDelay.MaterialDlyInWorkDaysSelection = $projection.MaterialDlyInWorkDaysSelection

  association [0..1] to C_MfgOrderProgressStatusVH     as _MfgOrderProgressStatus on  _MfgOrderProgressStatus.MfgOrdProgressStatusSelection = $projection.MfgOrdProgressStatusSelection


  association [0..1] to I_MfgOrderMRPControllerVH      as _MRPControllerVH        on  $projection.MRPPlant      = _MRPControllerVH.Plant
                                                                                  and $projection.MRPController = _MRPControllerVH.MRPController


  association [1..1] to C_PlantVH                      as _PlantVH                on  $projection.MRPPlant = _PlantVH.Plant

  association [0..1] to I_ProductionLineStdVH          as _ProductionLineVH       on  $projection.ProductionPlant = _ProductionLineVH.Plant
                                                                                  and $projection.ProductionLine  = _ProductionLineVH.ProductionLine

  association [0..1] to I_ProductionVersionStdVH       as _ProductionVersionVH    on  $projection.ProductionPlant   = _ProductionVersionVH.Plant
                                                                                  and $projection.ProductionVersion = _ProductionVersionVH.ProductionVersion
                                                                                  and $projection.Material          = _ProductionVersionVH.Material

  association [0..1] to C_MRPAreaValHelp               as _MRPAreaVH              on  $projection.MRPArea  = _MRPAreaVH.MRPArea
                                                                                  and $projection.MRPPlant = _MRPAreaVH.Plant

  association [0..1] to I_MfgOrderProdnSupervisorVH    as _ProductionSupervisorVH on  $projection.ProductionPlant      = _ProductionSupervisorVH.Plant
                                                                                  and $projection.ProductionSupervisor = _ProductionSupervisorVH.ProductionSupervisor


{

       @Search: {defaultSearchElement: true,  ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key  I_CacheMRPMfgOrder.MRPPlant,
  key  cast( I_CacheMRPMfgOrder.MRPPlanningSegmentType as plaab)                                                                                           as MRPPlanningSegmentType,
  key  I_CacheMRPMfgOrder.MRPPlanningSegment,
  key  I_CacheMRPMfgOrder.MaterialShortageProfile,
  key  I_CacheMRPMfgOrder.MaterialShortageProfileCount,
  key  I_CacheMRPMfgOrder.MRPElementCategory,
  key  concat(ltrim( I_CacheMRPMfgOrder.MRPElement, '0' ), concat('-', ltrim( I_CacheMRPMfgOrder.MRPElementItem, '0')) )                                   as MRPElement,
       @Search: {defaultSearchElement: true,  ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key  I_CacheMRPMfgOrder.Material,
       I_CacheMRPMfgOrder.MRPArea,

       I_CacheMRPMfgOrder.FactoryCalendar,
       _PlantVH.PlantName,

       case
        when _MaterialText[ 1: Language = $session.system_language ].MaterialName is not null
        and  _MaterialText[ 1: Language = $session.system_language ].MaterialName != ''
            then _MaterialText[ 1: Language = $session.system_language ].MaterialName

        when _MaterialText[ 1: Language = 'E' ].MaterialName  is not null
        and  _MaterialText[ 1: Language = 'E' ].MaterialName  != ''
            then _MaterialText[ 1: Language = $session.system_language ].MaterialName

        else I_CacheMRPMfgOrder.Material
       end                                                                                                                                                 as MaterialName,

       _MRPAreaVH.MRPAreaText,
       I_CacheMRPMfgOrder.ProductionPlant,
       I_CacheMRPMfgOrder.MRPController,
       _MRPController.MRPControllerName,
       I_CacheMRPMfgOrder.ManufacturingOrderType,
       _MfgOrderTypeText.ManufacturingOrderTypeName,
       _MRPElementCategoryText.MRPElementCategoryName,
       _MRPElementCategoryText.MRPElementCategoryShortName,
       I_CacheMRPMfgOrder.MfgOrderProgressStatus,
       cast(_ProgressStatusText.MfgOrderProgressStatusName as mfgorderprogressstatustext )                                                                 as MfgOrderProgressStatusName,
       I_CacheMRPMfgOrder.MfgOrderProgressNextStatus,
       cast(_NextStatusText.MfgOrderProgressNextStatusName as nextmilestone)                                                                               as MfgOrderProgressNextStatusName,
       I_CacheMRPMfgOrder.MfgOrderPlannedStartDate,
       I_CacheMRPMfgOrder.MfgOrderPlannedEndDate,
       I_CacheMRPMfgOrder.MfgOrderPlannedTotalQty,
       I_CacheMRPMfgOrder.MRPElementAvailyOrRqmtDate,
       I_CacheMRPMfgOrder.MRPElementOpenQuantity,
       I_CacheMRPMfgOrder.ProductionLine,
       cast(_ProductionLineVH._WorkCenterTextBySemanticKey[ 1: Language = $session.system_language ].WorkCenterText as productionlinetext preserving type) as ProductionLineText,
       I_CacheMRPMfgOrder.ProductionSupervisor,
       _ProductionSupervisor.ProductionSupervisorName,
       I_CacheMRPMfgOrder.ProductionVersion,
       I_CacheMRPMfgOrder.ProductionVersionText,
       I_CacheMRPMfgOrder.StorageLocation,
       I_CacheMRPMfgOrder.ComponentShortageDefinition,

       I_CacheMRPMfgOrder.MaterialBaseUnit,
       I_CacheMRPMfgOrder.ProductionUnit,
       I_CacheMRPMfgOrder.UnitOfMeasureNumberOfDecimals, //TargetQuantityUnitDcmls, for rounding

       I_CacheMRPMfgOrder.UnitOfMeasureDspNmbrOfDcmls, //TargetQuantityUnitDisplayDcmls

       cast( I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems as missingcomponents preserving type)                                                         as NumberOfComponentsWithProblems,

       I_CacheMRPMfgOrder.MaximumDelayInDays,
       I_CacheMRPMfgOrder.MaximumDelayInWorkdays, //initial filter -999999 = ComponentCoverage


       @ObjectModel.readOnly: true
       @ObjectModel.filter.transformedBy: 'ABAP:CL_MRP_CDS_COMP_FILTER_EXIT'
       @ObjectModel.foreignKey.association: '_ComponentCoverage'
       cast( '' as mrp_ui_comp_coverage )                                                                                                                  as CompCvrgInWrkDaysSelection,

       @ObjectModel.readOnly: true
       @ObjectModel.filter.transformedBy: 'ABAP:CL_MRP_CDS_COMP_FILTER_EXIT'
       @ObjectModel.foreignKey.association: '_MaterialDelay'
       cast( '' as mrp_ui_material_delay )                                                                                                                 as MaterialDlyInWorkDaysSelection,
       @ObjectModel.readOnly: true
       @ObjectModel.foreignKey.association: '_MfgOrderProgressStatus'
       @ObjectModel.filter.transformedBy: 'ABAP:CL_MRP_CDS_COMP_FILTER_EXIT'
       cast( '' as mfgorderprogressstatustext )                                                                                                            as MfgOrdProgressStatusSelection,

       @ObjectModel: {
       filter.transformedBy: 'ABAP:CL_MRP_CDS_COMP_FILTER_EXIT'
       }
       cast( '' as mrp_ui_delay_in_process)                                                                                                                as DelayInProcessSelection,

       //initial filter -999999

       I_CacheMRPMfgOrder.LateSupplyLatenessWorkdays, //=LatenessDurationInWorkDay=MaterialDelay

       @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
       cast(I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity as latesupplyquantity)                                                           as LateSupplyQuantity,
       cast(I_CacheMRPMfgOrder._CacheSupDemItem.MaximumDelayDate as requirementdate preserving type)                                                       as LateSupplyEarliestDemandDate,
       I_CacheMRPMfgOrder.ManufacturingOrderIsLate,

       case
         when I_CacheMRPMfgOrder.MfgOrderStatusPlannedDate = '00000000' or
              I_CacheMRPMfgOrder.MfgOrderStatusPlannedDate = '00010101'
              then I_CacheMRPMfgOrder.MfgOrderStatusActualDate
         else I_CacheMRPMfgOrder.MfgOrderStatusPlannedDate
       end                                                                                                                                                 as MfgOrderStatusPlannedDate,
       I_CacheMRPMfgOrder.MfgOrderStatusActualDate,
       I_CacheMRPMfgOrder.MfgOrderNextStatusPlannedDate,
       I_CacheMRPMfgOrder.MfgOrderPlannedReleaseDate,

       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as mfgordernextstatusdate )                                                                                                                as MfgOrderNextStatusDate,

       //initial filter -999999

       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as durnplndstatustotodayindays)                                                                                                             as DurnPlndStatusToTodayInDays, //=Delay in Process


       I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays,

       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as durationuntilnextstatusindays)                                                                                                          as DurationToNextStatusInDays, //Milestone(CD)


       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnToNextStsInDaysCritlty, //criticallity for DurationToNextStatusInDays


       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as durationtonextstatusinworkdays)                                                                                                         as DurationToNextStatusInWorkdays, //Milestone(WD)


       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnToNextStsInWorkdaysCritlty, //criticallity for DurationToNextStatusInWorkdays


       //if released milestone has been already passed, then duration is 999999

       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as durationtoreleaseinworkdays)                                                                                                            as DurationUntilReleaseInWorkdays,

       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnUntilRelInWorkdaysCritlty, //criticallity for DurationUntilReleaseInWorkdays


       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as durationuntilstartinworkdays)                                                                                                           as DurationUntilStartInWorkdays,

       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnTilStartInWorkdaysCritlty, //criticallity for DurationUntilStartInWorkdays


       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( '' as durationuntilendinworkdays)                                                                                                             as DurationUntilEndInWorkdays,
       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnTilEndInWorkdaysCritlty, //criticallity for DurationUntilEndInWorkdays


       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as durationuntilgrinworkdays)                                                                                                               as DurationUntilGRInWorkdays,

       @UI.hidden: true
       @ObjectModel: {
       virtualElement: true,
       readOnly: true,
       virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MFG_ORDER_EXIT'
       }
       cast( 0 as abap.int1)                                                                                                                               as DurnUntilGRInWorkdaysCritlty, //criticallity for DurationUntilGRInWorkdays


       I_CacheMRPMfgOrder.MaterialGoodsReceiptDuration,

       case
         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity > 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems > 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays > 0
              then '111'
       //mfgorderproblemcategoryname TEXT: Everything Delayed

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity > 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems > 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays <= 0
              then '110'
       //TEXT: Material and Component Delay

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity > 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems <= 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays > 0
              then '101'
       //TEXT: Material and Process Delay

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity > 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems <= 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays <= 0
              then '100'
       //TEXT:Material Delay

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity <= 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems > 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays > 0
              then '011'
       //mfgorderproblemcategoryname TEXT: Component and Process Delay

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity <= 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems > 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays <= 0
              then  '010'
       //TEXT: Component Delay

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity <= 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems <= 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays > 0
              then '001'
       //TEXT: Delay in Process

         when I_CacheMRPMfgOrder._CacheSupDemItem.MRPElementDelayedQuantity <= 0 and
              I_CacheMRPMfgOrder.NumberOfUncoveredDemandItems <= 0 and I_CacheMRPMfgOrder.DurnPlndStatusToTodayInWrkdays <= 0
              then '000'
       //TEXT: No Delay.

         else ''
       end                                                                                                                                                 as MfgOrderProblemCategory,


       I_CacheMRPMfgOrder.MaterialCompIsProcuredDirectly,
       cast(I_CacheMRPMfgOrder.ProjectNetwork as ps_pspid_edit)                                                                                            as MatlPlngProjectNetwork,
       I_CacheMRPMfgOrder.WBSElementInternalID,
       I_CacheMRPMfgOrder.WBSElement,
       I_CacheMRPMfgOrder.PlanningSegmentDocument,
       I_CacheMRPMfgOrder.PlanningSegmentDocumentItem,
       ---------------------------------------------------------------------------------------------------------
       -- Individual Segment                                                                             --
       ---------------------------------------------------------------------------------------------------------
       @ObjectModel: {
        virtualElement,
        readOnly: true,
        virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MAT_COV_PLN_SEG_EXIT'
       }
       cast( '' as abap.char( 6 ) )                                                                                                                        as MRPPlanningSegmentTypeDesc,
       @ObjectModel: {
        virtualElement: true,
        readOnly: true,
        virtualElementCalculatedBy: 'ABAP:CL_PP_MRP_MAT_COV_PLN_SEG_EXIT'
       }
       cast( '' as mrpindividualsegment)                                                                                                                   as MRPPlanningSegmentExternalCode,

       _MaterialShortageDef.MaterialShortageDefinitionName,


       -- Associations
       _PlantVH,
       _MaterialText,
       _MfgOrderTypeText,
       _MfgOrderCategoryText,
       _ProductionLineVH,
       _ProductionSupervisor,
       _ProductionVersionVH,
       I_CacheMRPMfgOrder._StorageLocation,
       _ProgressStatusText,
       _ComponentCoverage,
       _MaterialDelay,
       _MfgOrderProgressStatus,
       _MRPPlant,
       I_CacheMRPMfgOrder._Material,
       _MRPController,
       _MRPControllerVH,
       _ProductionPlant,
       _MRPAreaVH,
       _ProductionSupervisorVH
       //       _MfgOrderTypeVH

       //       _MaterialVH




}
//where

//      MaterialShortageProfile      = 'SAP000000001'

//  and MaterialShortageProfileCount = '001'