R_MaintJobWorkItemComponentTP is a Composite CDS View that provides data about "Maintenance Job Work Item Component TP" in SAP S/4HANA. It reads from 1 data source (I_MaintenanceOrderComponent_2) and exposes 25 fields with key fields MaintenanceOrder, MaintenanceOrderOperation, MaintenanceOrderSubOperation, MaintOrderComponentInternalID. It has 4 associations to related views.
@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Maintenance Job Work Item Component TP'
@VDM.viewType: #COMPOSITE@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]@VDM.lifecycle.contract.type: #SAP_INTERNAL_API@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}@AccessControl.personalData.blocking:#NOT_REQUIREDdefineviewentity R_MaintJobWorkItemComponentTP
asselectfrom I_MaintenanceOrderComponent_2
association to parent R_MaintenanceJobWorkItemTP as _MaintenanceJobWorkItem on (
$projection.MaintenanceOrderOperation = _MaintenanceJobWorkItem.MaintenanceOrderOperation
and $projection.MaintenanceOrder = _MaintenanceJobWorkItem.MaintenanceOrder
and $projection.MaintenanceOrderSubOperation = _MaintenanceJobWorkItem.MaintenanceOrderSubOperation
)
association [0..1] to I_ProductPlant as _ProductPlant on _ProductPlant.Product = $projection.Material
and _ProductPlant.Plant = $projection.Plant
association [0..1] to P_MaterialValuationCategory as _MaterialValuationCategory on _MaterialValuationCategory.Product = $projection.Material
and _MaterialValuationCategory.Plant = $projection.Plant
association [0..1] to P_SerialNumberProfileProcedure as _SerialNumberProfileProcedure on _SerialNumberProfileProcedure.Product = $projection.Material
and _SerialNumberProfileProcedure.Plant = $projection.Plant
and _SerialNumberProfileProcedure.SerialNumberProcedure = 'MMSL'
association [1..1] to R_MaintenanceJobTP as _MaintenanceJob on _MaintenanceJob.MaintenanceOrder = $projection.MaintenanceOrder
{
key MaintenanceOrder,
keycast(MaintenanceOrderOperation as pph_vornr preserving type) as MaintenanceOrderOperation,
keycast(MaintenanceOrderSubOperation as pph_vornr preserving type) as MaintenanceOrderSubOperation,
key MaintOrderComponentInternalID,
cast(MaintenanceOrderComponent as pph_vornr preserving type) as MaintenanceOrderComponent,
@ObjectModel.text.element: [ 'MaterialName' ]
Material,
@Semantics.text: truecasewhen Material =''
then ComponentDescription
else _MaterialText[1:Language=$session.system_language].MaterialName
endas MaterialName,
ComponentDescription,
RequirementQuantityInBaseUnit,
@Consumption.valueHelpDefinition: [
{ entity : { name: 'I_UnitOfMeasure',
element: 'UnitOfMeasure' }
}]
BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
//Casting into 2 columns based on movement type to differentate items for Issue and Return
// H = 261 (credit) , S = 262 (debit)
cast(casewhen MaintOrderCompDebitCreditCode = 'H'
then RequirementQuantityInBaseUnit
endas bdmng preserving type ) as PlannedQuantity, //Planned Quantity
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
cast(casewhen MaintOrderCompDebitCreditCode = 'S'
then RequirementQuantityInBaseUnit
endas bdmng preserving type ) as ReturnableQuantity, //Planned Return
Plant,
StorageLocation,
//Casting into 2 columns based on movement type to differentiate posting of issued and return items
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
cast(casewhen MaintOrderCompDebitCreditCode = 'H'
then QuantityWithdrawnInBaseUnit
endas enmng preserving type ) as IssuedQuantity, //QuantityIssued
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
cast(casewhen MaintOrderCompDebitCreditCode = 'S'
then QuantityWithdrawnInBaseUnit
endas enmng preserving type ) as ReturnedQuantity, //Actual Return
QuantityWithdrawnInBaseUnit,
GoodsMovementType,
//For Color Visualization of returned items
cast(case MaintOrderCompDebitCreditCode
// when '261' then 0 //Issue - Black Color
when 'S' then//Return - Orange Color
cast(casewhen QuantityWithdrawnInBaseUnit = RequirementQuantityInBaseUnit then 3
else 2 endas mpe_criticality_type preserving type )
else 0
endas mpe_criticality_type preserving type ) as SASStatusCriticality,
cast (MaintenanceOrderComponentBatch as valuationtype) as ValuationType,
// Used for Serial Number Validations:- SerialNumberProfile, SerialNumberProcedure, SerialNumberUsageInAssignment
_ProductPlant.SerialNumberProfile,
_SerialNumberProfileProcedure.SerialNumberProcedure,
_SerialNumberProfileProcedure.SerialNumberUsageInAssignment,
// Used in Batch Value Help Validation
_MaterialValuationCategory.InventoryValuationCategory,
// Needed to Identify Stock and Non Stock Items
cast(MaintComponentItemCategory as postp preserving type ) as MaintOrdOpCompItemCategory,
// To identify backflush enabled components
MatlCompIsMarkedForBackflush,
/* Associations */
_MaintenanceJobWorkItem, // Make association public
_MaintenanceJob,
// Inherited association that needs to be exposed
_MaintenanceOrder,
_UnitOfMeasure
}
where
IsDeleted <> 'X' // filter out the deleted items from iw32 component list
and ProductTypeCode <> '2'