R_MaintJobWorkItemUnplndCompTP

DDL: R_MAINTJOBWORKITEMUNPLNDCOMPTP Type: view_entity TRANSACTIONAL Package: VDM_EAM_MAINTJOB_MNG_CMP_UNPLN

Maintenance Work Item Unplanned Comp TP

R_MaintJobWorkItemUnplndCompTP is a Transactional CDS View that provides data about "Maintenance Work Item Unplanned Comp TP" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentItem_2) and exposes 28 fields with key fields MaintenanceOrder, MaterialDocument, MaterialDocumentItem, MaterialDocumentYear. It has 4 associations to related views. Part of development package VDM_EAM_MAINTJOB_MNG_CMP_UNPLN.

Data Sources (1)

SourceAliasJoin Type
I_MaterialDocumentItem_2 I_MaterialDocumentItem_2 from

Associations (4)

CardinalityTargetAliasCondition
[0..*] I_MaintenanceOrderOperation _MaintenanceOrderOperation $projection.MaintOrderRoutingNumber = _MaintenanceOrderOperation.MaintOrderRoutingNumber and $projection.MaintOrderOperationCounter = _MaintenanceOrderOperation.MaintOrderOperationCounter
[0..1] I_MaintenanceOrder _MaintenanceOrder $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder
[0..1] I_Product _Product $projection.Material = _Product.Product
[0..*] I_MaterialText _MaterialText $projection.Material = _MaterialText.Material

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Maintenance Work Item Unplanned Comp TP view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceOrder I_MaterialDocumentItem_2 OrderID
KEY MaterialDocument I_MaterialDocumentItem_2 MaterialDocument
KEY MaterialDocumentItem I_MaterialDocumentItem_2 MaterialDocumentItem
KEY MaterialDocumentYear I_MaterialDocumentItem_2 MaterialDocumentYear
MaintenanceOrderOperation
Material I_MaterialDocumentItem_2 Material
MaterialName
Product
MaintenancePlanningPlant _MaintenanceOrder MaintenancePlanningPlant
Plant _MaintenanceOrder MaintenancePlant
StorageLocation I_MaterialDocumentItem_2 StorageLocation
QuantityInBaseUnit I_MaterialDocumentItem_2 QuantityInBaseUnit
MaterialBaseUnit I_MaterialDocumentItem_2 MaterialBaseUnit
MaintOrderRoutingNumber I_MaterialDocumentItem_2 MaintOrderRoutingNumber
MaintOrderOperationCounter I_MaterialDocumentItem_2 MaintOrderOperationCounter
ValuationType
SerialNumber
Reservation I_MaterialDocumentItem_2 Reservation
SerialNumberProfile
SerialNumberProcedure
SerialNumberUsageInAssignment
InventoryValuationCategory
IsMarkedForDeletion
MaintenanceOrderType
MaterialDocumentItemText I_MaterialDocumentItem_2 MaterialDocumentItemText
GoodsMovementType I_MaterialDocumentItem_2 GoodsMovementType
GoodsMovementTypeName
ProductType _Product ProductType
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Maintenance Work Item Unplanned Comp TP'
@VDM.viewType: #TRANSACTIONAL
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@AccessControl.personalData.blocking:#NOT_REQUIRED
define view entity R_MaintJobWorkItemUnplndCompTP
  as select from I_MaterialDocumentItem_2
  association [0..*] to I_MaintenanceOrderOperation as _MaintenanceOrderOperation on  $projection.MaintOrderRoutingNumber    = _MaintenanceOrderOperation.MaintOrderRoutingNumber
                                                                                  and $projection.MaintOrderOperationCounter = _MaintenanceOrderOperation.MaintOrderOperationCounter
  association [0..1] to I_MaintenanceOrder          as _MaintenanceOrder          on  $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder
  association [0..1] to I_Product                   as _Product                   on  $projection.Material = _Product.Product
  association [0..*] to I_MaterialText              as _MaterialText              on  $projection.Material = _MaterialText.Material
{
  key I_MaterialDocumentItem_2.OrderID                                                        as MaintenanceOrder,
  key I_MaterialDocumentItem_2.MaterialDocument,
  key I_MaterialDocumentItem_2.MaterialDocumentItem,
  key I_MaterialDocumentItem_2.MaterialDocumentYear,
      cast(_MaintenanceOrderOperation.MaintenanceOrderOperation as pph_vornr preserving type) as MaintenanceOrderOperation,
      I_MaterialDocumentItem_2.Material,
      _MaterialText[1:Language=$session.system_language].MaterialName,
      cast(I_MaterialDocumentItem_2.Material as matnr preserving type )                       as Product,
      //I_MaterialDocumentItem_2.Plant,

      _MaintenanceOrder.MaintenancePlanningPlant,
      _MaintenanceOrder.MaintenancePlant                                                      as Plant,
      I_MaterialDocumentItem_2.StorageLocation,
      I_MaterialDocumentItem_2.QuantityInBaseUnit,
      I_MaterialDocumentItem_2.MaterialBaseUnit,
      I_MaterialDocumentItem_2.MaintOrderRoutingNumber,
      I_MaterialDocumentItem_2.MaintOrderOperationCounter,
      cast (I_MaterialDocumentItem_2.Batch as valuationtype)                                  as ValuationType,
      cast (' ' as abap.char( 18 ))                                                           as SerialNumber,
      I_MaterialDocumentItem_2.Reservation,
      //    Below listed 6 fields are to control serial number popup and batch f4 in UI.

      // Data is filled by the UI hence casted to empty values in CDS

      cast ('' as serail)                                                                     as SerialNumberProfile,
      cast('' as beleg)                                                                       as SerialNumberProcedure,
      cast('' as serpflicht)                                                                  as SerialNumberUsageInAssignment,
      cast('' as bwtty_d)                                                                     as InventoryValuationCategory,
      cast('' as lkenz)                                                                       as IsMarkedForDeletion,
      cast('' as auart)                                                                       as MaintenanceOrderType,
      cast
       ( case when _MaintenanceOrderOperation.Equipment != '' then
                    _MaintenanceOrderOperation.Equipment
               when _MaintenanceOrderOperation.Equipment = '' and
                    _MaintenanceOrderOperation.FunctionalLocation != '' then
                    _MaintenanceOrderOperation.FunctionalLocation
               else ''
      end as eams_tec_obj )                                                                   as TechnicalObject,

      cast(case when _MaintenanceOrderOperation.Equipment != '' then
                           'EAMS_EQUI'
           when _MaintenanceOrderOperation.Equipment = '' and
                          _MaintenanceOrderOperation.FunctionalLocation != '' then
                           'EAMS_FL'
           else ''
      end as eams_tec_obj_type_value )                                                        as TechObjIsEquipOrFuncnlLoc,
      I_MaterialDocumentItem_2.MaterialDocumentItemText                                       as MaterialDocumentItemText,
      I_MaterialDocumentItem_2.GoodsMovementType,
      I_MaterialDocumentItem_2._GoodsMovementType._Text[1:Language=$session.system_language].GoodsMovementTypeName,
      _Product.ProductType

}
where
      I_MaterialDocumentItem_2.Reservation       =  '0000000000' //indicates unplanned components that dont have reservation numbers against them

  and _Product._ProductType.ProductTypeCode      <> '2' // To filter out Service Materials

  and I_MaterialDocumentItem_2.PurchaseOrder     =  '' // To eliminate the components of Goods Reciptes for Purchase Order (MI)

  and I_MaterialDocumentItem_2.OrderID           <> ''
  and _MaintenanceOrder.MaintenanceOrderCategory =  '30'