R_ProductionVersionTP

DDL: R_PRODUCTIONVERSIONTP Type: view_entity TRANSACTIONAL

Production Version Header

R_ProductionVersionTP is a Transactional CDS View that provides data about "Production Version Header" in SAP S/4HANA. It reads from 1 data source (I_ProductionVersion) and exposes 85 fields with key fields Material, Plant, ProductionVersion. It has 8 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_ProductionVersion I_ProductionVersion from

Associations (8)

CardinalityTargetAliasCondition
[0..1] I_ProdnVersLock _ProdnVersLockVH $projection.ProductionVersionLock = _ProdnVersLockVH.ProductionVersionIsLocked
[0..1] I_ProdnVersLockText _ProdnVersLockText $projection.ProductionVersionLock = _ProdnVersLockText.ProductionVersionIsLocked and _ProdnVersLockText.Language = $session.system_language
[1..1] I_MaterialText _MaterialText $projection.Material = _MaterialText.Material and _MaterialText.Language = $session.system_language
[0..1] I_ProdnVersChkStsTxt _RoutingStatusText $projection.ProductionVersionStatus = _RoutingStatusText.ProductionVersionStatus and _RoutingStatusText.Language = $session.system_language
[0..1] I_BillOfOperationsTypeText _BillOfOperationsTypeText $projection.BillOfOperationsType = _BillOfOperationsTypeText.BillOfOperationsType and _BillOfOperationsTypeText.Language = $session.system_language
[0..1] I_RecmddProdnVersMatlBOM _MaterialBOM $projection.Material = _MaterialBOM.Material and $projection.Plant = _MaterialBOM.Plant and $projection.BillOfMaterialVariant = _MaterialBOM.BillOfMaterialVariant and $projection.BillOfMaterialVariantUsage = _MaterialBOM.BillOfMaterialVariantUsage and $projection.ValidityStartDate >= _MaterialBOM.HeaderValidityStartDate and $projection.ValidityStartDate <= _MaterialBOM.HeaderValidityEndDate
[0..*] I_ProdnVersConstcyLogCount _ConstcyLogCount $projection.Material = _ConstcyLogCount.Material and $projection.Plant = _ConstcyLogCount.Plant and $projection.ProductionVersion = _ConstcyLogCount.ProductionVersion -- to Consistency Log
[0..*] R_ProdnVersConstcyLogTP _ConstcyLog

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label Production Version Header view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #MASTER view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.sapObjectNodeType.name ProductionVersion view

Fields (85)

KeyFieldSource TableSource FieldDescription
KEY Material I_ProductionVersion Material
KEY Plant I_ProductionVersion Plant
KEY ProductionVersion I_ProductionVersion ProductionVersion
ProductionVersionText I_ProductionVersion ProductionVersionText
ChangeHistoryCount I_ProductionVersion ChangeHistoryCount
ChangeNumber I_ProductionVersion ChangeNumber
CreationDate I_ProductionVersion CreationDate
CreatedByUser I_ProductionVersion CreatedByUser
LastChangeDate I_ProductionVersion LastChangeDate
LastChangedByUser I_ProductionVersion LastChangedByUser
BillOfOperationsType I_ProductionVersion BillOfOperationsType
BillOfOperationsGroup I_ProductionVersion BillOfOperationsGroup
BillOfOperationsVariant I_ProductionVersion BillOfOperationsVariant
BillOfMaterialVariantUsage I_ProductionVersion BillOfMaterialVariantUsage
BillOfMaterialVariant I_ProductionVersion BillOfMaterialVariant
ProductionLine I_ProductionVersion ProductionLine
ProductionSupplyArea I_ProductionVersion ProductionSupplyArea
ProductionVersionGroup I_ProductionVersion ProductionVersionGroup
MainProduct I_ProductionVersion MainProduct
MaterialCostApportionmentStruc I_ProductionVersion MaterialCostApportionmentStruc
IssuingStorageLocation I_ProductionVersion IssuingStorageLocation
ReceivingStorageLocation I_ProductionVersion ReceivingStorageLocation
OriginalBatchReferenceMaterial I_ProductionVersion OriginalBatchReferenceMaterial
QuantityDistributionKey I_ProductionVersion QuantityDistributionKey
ProductionVersionStatus
ProductionVersionLastCheckDate I_ProductionVersion ProductionVersionLastCheckDate
RateBasedPlanningStatus I_ProductionVersion RateBasedPlanningStatus
PreliminaryPlanningStatus I_ProductionVersion PreliminaryPlanningStatus
BOMCheckStatus I_ProductionVersion BOMCheckStatus
ValidityStartDate I_ProductionVersion ValidityStartDate
ValidityEndDate I_ProductionVersion ValidityEndDate
ProductionVersionLock
ProdnVersIsAllowedForRptvMfg I_ProductionVersion ProdnVersIsAllowedForRptvMfg
HasVersionCtrldBOMAndRouting I_ProductionVersion HasVersionCtrldBOMAndRouting
PlanningAndExecutionBOMIsDiff I_ProductionVersion PlanningAndExecutionBOMIsDiff
ExecBillOfMaterialVariantUsage I_ProductionVersion ExecBillOfMaterialVariantUsage
ExecBillOfMaterialVariant I_ProductionVersion ExecBillOfMaterialVariant
ExecBillOfOperationsType I_ProductionVersion ExecBillOfOperationsType
ExecBillOfOperationsGroup I_ProductionVersion ExecBillOfOperationsGroup
ExecBillOfOperationsVariant I_ProductionVersion ExecBillOfOperationsVariant
EWMWarehouse I_ProductionVersion Warehouse
DestinationStorageBin I_ProductionVersion DestinationStorageBin
ProcurementType I_ProductionVersion ProcurementType
MaterialProcurementProfile I_ProductionVersion MaterialProcurementProfile
UsgeProbltyWthVersCtrlInPct I_ProductionVersion UsgeProbltyWthVersCtrlInPct
MaterialBaseUnit I_ProductionVersion MaterialBaseUnit
MaterialMinLotSizeQuantity I_ProductionVersion MaterialMinLotSizeQuantity
MaterialMaxLotSizeQuantity I_ProductionVersion MaterialMaxLotSizeQuantity
CostingLotSize I_ProductionVersion CostingLotSize
TargetProductionSupplyArea I_ProductionVersion TargetProductionSupplyArea
MRPController _MatlPlnt MRPController
MaterialName _MaterialText MaterialName
PlantName
MRPResponsible
RoutingCheckStatusText _RoutingStatusText ProductionVersionStatusText
ProductionVersionLockText _ProdnVersLockText ProductionVersionLockText
BillOfOperationsTypeName _BillOfOperationsTypeText BillOfOperationsTypeName
_ProdnVersLockVH _ProdnVersLockVH
_BillOfOperations I_ProductionVersion _BillOfOperations
_BillOfOperationsGroup I_ProductionVersion _BillOfOperationsGroup
_BillOfOperationsType I_ProductionVersion _BillOfOperationsType
_ChangeMaster I_ProductionVersion _ChangeMaster
_IssuingStorageLocation I_ProductionVersion _IssuingStorageLocation
_MainProduct I_ProductionVersion _MainProduct
_Material I_ProductionVersion _Material
_MaterialBaseUnit I_ProductionVersion _MaterialBaseUnit
_MatlCostApportionmentStruc I_ProductionVersion _MatlCostApportionmentStruc
_MatlProcurementProfile I_ProductionVersion _MatlProcurementProfile
_OriglBatchReferenceMaterial I_ProductionVersion _OriglBatchReferenceMaterial
_Plant I_ProductionVersion _Plant
_Product I_ProductionVersion _Product
_ProductionLine I_ProductionVersion _ProductionLine
_ProductionSupplyArea I_ProductionVersion _ProductionSupplyArea
_ProductionVersionGroup I_ProductionVersion _ProductionVersionGroup
_ProductPlant I_ProductionVersion _ProductPlant
_QuantityDistributionKey I_ProductionVersion _QuantityDistributionKey
_ReceivingStorageLocation I_ProductionVersion _ReceivingStorageLocation
_TargetProductionSupplyArea I_ProductionVersion _TargetProductionSupplyArea
_RoutingStatusText _RoutingStatusText
_MaterialText _MaterialText
_BillOfOperationsTypeText _BillOfOperationsTypeText
_ProdnVersLockText _ProdnVersLockText
_MaterialBOM _MaterialBOM
_ConstcyLog _ConstcyLog
_ConstcyLogCount _ConstcyLogCount
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Production Version Header'
@ObjectModel.usageType: { serviceQuality: #C, sizeCategory: #M, dataClass: #MASTER }
@VDM: { viewType: #TRANSACTIONAL, lifecycle.contract.type: #SAP_INTERNAL_API }
@ObjectModel.sapObjectNodeType.name: 'ProductionVersion'
define root view entity R_ProductionVersionTP
  as select from           I_ProductionVersion

    left outer to one join I_MaterialPlant as _MatlPlnt on  I_ProductionVersion.Material = _MatlPlnt.Material
                                                        and I_ProductionVersion.Plant    = _MatlPlnt.Plant

  association [0..1] to I_ProdnVersLock            as _ProdnVersLockVH          on  $projection.ProductionVersionLock = _ProdnVersLockVH.ProductionVersionIsLocked

  association [0..1] to I_ProdnVersLockText        as _ProdnVersLockText        on  $projection.ProductionVersionLock = _ProdnVersLockText.ProductionVersionIsLocked
                                                                                and _ProdnVersLockText.Language       = $session.system_language

  association [1..1] to I_MaterialText             as _MaterialText             on  $projection.Material   = _MaterialText.Material
                                                                                and _MaterialText.Language = $session.system_language

  association [0..1] to I_ProdnVersChkStsTxt       as _RoutingStatusText        on  $projection.ProductionVersionStatus = _RoutingStatusText.ProductionVersionStatus
                                                                                and _RoutingStatusText.Language         = $session.system_language

  association [0..1] to I_BillOfOperationsTypeText as _BillOfOperationsTypeText on  $projection.BillOfOperationsType   = _BillOfOperationsTypeText.BillOfOperationsType
                                                                                and _BillOfOperationsTypeText.Language = $session.system_language

  //  association [0..1] to I_MaterialBOM              as _MaterialBOM              on  $projection.Material              = _MaterialBOM.Material

  association [0..1] to I_RecmddProdnVersMatlBOM   as _MaterialBOM              on  $projection.Material                   =  _MaterialBOM.Material
                                                                                and $projection.Plant                      =  _MaterialBOM.Plant
                                                                                and $projection.BillOfMaterialVariant      =  _MaterialBOM.BillOfMaterialVariant
                                                                                and $projection.BillOfMaterialVariantUsage =  _MaterialBOM.BillOfMaterialVariantUsage
                                                                                and $projection.ValidityStartDate          >= _MaterialBOM.HeaderValidityStartDate
                                                                                and $projection.ValidityStartDate          <= _MaterialBOM.HeaderValidityEndDate

  association [0..*] to I_ProdnVersConstcyLogCount as _ConstcyLogCount          on  $projection.Material          = _ConstcyLogCount.Material
                                                                                and $projection.Plant             = _ConstcyLogCount.Plant
                                                                                and $projection.ProductionVersion = _ConstcyLogCount.ProductionVersion

  -- to Consistency Log
  composition [0..*] of R_ProdnVersConstcyLogTP    as _ConstcyLog
{

  key I_ProductionVersion.Material                                                               as Material,
  key I_ProductionVersion.Plant                                                                  as Plant,
  key I_ProductionVersion.ProductionVersion                                                      as ProductionVersion,
      I_ProductionVersion.ProductionVersionText                                                  as ProductionVersionText,
      I_ProductionVersion.ChangeHistoryCount                                                     as ChangeHistoryCount,
      I_ProductionVersion.ChangeNumber                                                           as ChangeNumber,
      I_ProductionVersion.CreationDate                                                           as CreationDate,
      I_ProductionVersion.CreatedByUser                                                          as CreatedByUser,
      I_ProductionVersion.LastChangeDate                                                         as LastChangeDate,
      I_ProductionVersion.LastChangedByUser                                                      as LastChangedByUser,
      @ObjectModel:{text.element:  [ 'BillOfOperationsTypeName' ]  }
      I_ProductionVersion.BillOfOperationsType                                                   as BillOfOperationsType,
      I_ProductionVersion.BillOfOperationsGroup                                                  as BillOfOperationsGroup,
      I_ProductionVersion.BillOfOperationsVariant                                                as BillOfOperationsVariant,
      I_ProductionVersion.BillOfMaterialVariantUsage                                             as BillOfMaterialVariantUsage,
      I_ProductionVersion.BillOfMaterialVariant                                                  as BillOfMaterialVariant,
      I_ProductionVersion.ProductionLine                                                         as ProductionLine,
      I_ProductionVersion.ProductionSupplyArea                                                   as ProductionSupplyArea,
      I_ProductionVersion.ProductionVersionGroup                                                 as ProductionVersionGroup,
      I_ProductionVersion.MainProduct                                                            as MainProduct,
      I_ProductionVersion.MaterialCostApportionmentStruc                                         as MaterialCostApportionmentStruc,
      I_ProductionVersion.IssuingStorageLocation                                                 as IssuingStorageLocation,
      I_ProductionVersion.ReceivingStorageLocation                                               as ReceivingStorageLocation,
      I_ProductionVersion.OriginalBatchReferenceMaterial                                         as OriginalBatchReferenceMaterial,
      I_ProductionVersion.QuantityDistributionKey                                                as QuantityDistributionKey,
      @ObjectModel:{text.element:  [ 'RoutingCheckStatusText' ]  }
      cast(I_ProductionVersion.ProductionVersionStatus as mpe_pv_rtg_chksts preserving type )    as ProductionVersionStatus,
      I_ProductionVersion.ProductionVersionLastCheckDate                                         as ProductionVersionLastCheckDate,
      I_ProductionVersion.RateBasedPlanningStatus                                                as RateBasedPlanningStatus,
      I_ProductionVersion.PreliminaryPlanningStatus                                              as PreliminaryPlanningStatus,
      I_ProductionVersion.BOMCheckStatus                                                         as BOMCheckStatus,
      I_ProductionVersion.ValidityStartDate                                                      as ValidityStartDate,
      I_ProductionVersion.ValidityEndDate                                                        as ValidityEndDate,

      @ObjectModel:{text.element:  [ 'ProductionVersionLockText' ]  }
      @ObjectModel.foreignKey.association: '_ProdnVersLockVH'
      cast(I_ProductionVersion.ProductionVersionIsLocked as mpe_pv_lock_status preserving type ) as ProductionVersionLock,

      I_ProductionVersion.ProdnVersIsAllowedForRptvMfg                                           as ProdnVersIsAllowedForRptvMfg,
      I_ProductionVersion.HasVersionCtrldBOMAndRouting                                           as HasVersionCtrldBOMAndRouting,
      I_ProductionVersion.PlanningAndExecutionBOMIsDiff                                          as PlanningAndExecutionBOMIsDiff,
      I_ProductionVersion.ExecBillOfMaterialVariantUsage                                         as ExecBillOfMaterialVariantUsage,
      I_ProductionVersion.ExecBillOfMaterialVariant                                              as ExecBillOfMaterialVariant,
      I_ProductionVersion.ExecBillOfOperationsType                                               as ExecBillOfOperationsType,
      I_ProductionVersion.ExecBillOfOperationsGroup                                              as ExecBillOfOperationsGroup,
      I_ProductionVersion.ExecBillOfOperationsVariant                                            as ExecBillOfOperationsVariant,
      I_ProductionVersion.Warehouse                                                              as EWMWarehouse,
      I_ProductionVersion.DestinationStorageBin                                                  as DestinationStorageBin,
      I_ProductionVersion.ProcurementType                                                        as ProcurementType,
      I_ProductionVersion.MaterialProcurementProfile                                             as MaterialProcurementProfile,
      I_ProductionVersion.UsgeProbltyWthVersCtrlInPct                                            as UsgeProbltyWthVersCtrlInPct,
      I_ProductionVersion.MaterialBaseUnit                                                       as MaterialBaseUnit,
      I_ProductionVersion.MaterialMinLotSizeQuantity                                             as MaterialMinLotSizeQuantity,
      I_ProductionVersion.MaterialMaxLotSizeQuantity                                             as MaterialMaxLotSizeQuantity,
      I_ProductionVersion.CostingLotSize                                                         as CostingLotSize,
      I_ProductionVersion.TargetProductionSupplyArea                                             as TargetProductionSupplyArea,
      _MatlPlnt.MRPController                                                                    as MRPController,
      _MaterialText.MaterialName                                                                 as MaterialName,
      I_ProductionVersion._Plant.PlantName                                                       as PlantName,
      I_ProductionVersion._ProductPlant.MRPResponsible                                           as MRPResponsible,

      @UI.hidden: true
      _RoutingStatusText.ProductionVersionStatusText                                             as RoutingCheckStatusText,

      @UI.hidden: true
      _ProdnVersLockText.ProductionVersionLockText,

      @UI.hidden: true
      _BillOfOperationsTypeText.BillOfOperationsTypeName,

      //      @Consumption.filter.hidden: true

      @UI.hidden: true
      _ProdnVersLockVH,

      case
      when _ConstcyLogCount[1:ProdnVersConstcyIssSvrtyLvl = 'E'].NumberOfProdnVersConstcyIssue > 0
      then '3'
      when _ConstcyLogCount[1:ProdnVersConstcyIssSvrtyLvl = 'W'].NumberOfProdnVersConstcyIssue > 0
      then '2'
      when _ConstcyLogCount[1:ProdnVersConstcyIssSvrtyLvl = 'S'].NumberOfProdnVersConstcyIssue > 0
      then '1'
      else
            case
            when ( I_ProductionVersion.ProductionVersionLastCheckDate != '00000000' )
            and  ( I_ProductionVersion.ProductionVersionStatus = '3' or I_ProductionVersion.BOMCheckStatus = '3'  )
            then '3'
            when ( I_ProductionVersion.ProductionVersionLastCheckDate != '00000000' )
            and  ( ( I_ProductionVersion.ProductionVersionStatus = '2'  or I_ProductionVersion.BOMCheckStatus = '2'  )
            and    ( I_ProductionVersion.ProductionVersionStatus != '3' or I_ProductionVersion.BOMCheckStatus != '3'  ) )
            then '2'
            when ( I_ProductionVersion.ProductionVersionLastCheckDate != '00000000' )
            and  ( ( I_ProductionVersion.ProductionVersionStatus = '1'  or I_ProductionVersion.BOMCheckStatus = '1'  )
            and    ( I_ProductionVersion.ProductionVersionStatus != '3' or I_ProductionVersion.BOMCheckStatus != '3'
            or       I_ProductionVersion.ProductionVersionStatus != '2' or I_ProductionVersion.BOMCheckStatus != '2' ) )
            then '1'
            when ( I_ProductionVersion.ProductionVersionLastCheckDate != '00000000' )
            and  ( I_ProductionVersion.ProductionVersionStatus = ''  and I_ProductionVersion.BOMCheckStatus = ''  )
            then ''
            else ''
            end
       end                                                                                       as OvrlProdnVersChkSts,
      //using cast to delink the Conversion Routine "NUMCV" on BillOfMaterial

      //      cast ( _MaterialBOM.BillOfMaterial as abap.char(8) )                                       as BillOfMaterial,

      //      _MaterialBOM.BillOfMaterialCategory                                                        as BillOfMaterialCategory,

      //      _BillOfMaterial.BOMHeaderText,



      /* Associations */
      I_ProductionVersion._BillOfOperations,
      I_ProductionVersion._BillOfOperationsGroup,
      I_ProductionVersion._BillOfOperationsType,
      I_ProductionVersion._ChangeMaster,
      I_ProductionVersion._IssuingStorageLocation,
      I_ProductionVersion._MainProduct,
      I_ProductionVersion._Material,
      I_ProductionVersion._MaterialBaseUnit,
      I_ProductionVersion._MatlCostApportionmentStruc,
      I_ProductionVersion._MatlProcurementProfile,
      I_ProductionVersion._OriglBatchReferenceMaterial,
      I_ProductionVersion._Plant,
      I_ProductionVersion._Product,
      I_ProductionVersion._ProductionLine,
      I_ProductionVersion._ProductionSupplyArea,
      I_ProductionVersion._ProductionVersionGroup,
      I_ProductionVersion._ProductPlant,
      I_ProductionVersion._QuantityDistributionKey,
      I_ProductionVersion._ReceivingStorageLocation,
      I_ProductionVersion._TargetProductionSupplyArea,
      _RoutingStatusText,
      _MaterialText,
      _BillOfOperationsTypeText,
      _ProdnVersLockText,
      _MaterialBOM,
      _ConstcyLog,
      _ConstcyLogCount
}