@AbapCatalog.sqlViewName: 'CMFGORDDEF'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #CONSUMPTION
@ObjectModel: {
usageType: {
dataClass: #MIXED,
sizeCategory: #XL,
serviceQuality: #D },
representativeKey: 'DefectInternalID',
semanticKey: [ 'Defect', 'DefectCode', 'ManufacturingOrderOperation', 'OpActyNtwkElementExternalID'],
createEnabled: true,
updateEnabled: true,
deleteEnabled: true
}
@Metadata.allowExtensions: true
@UI.headerInfo: {
typeName: 'Defect',
typeNamePlural: 'Defects',
title: {value: 'Defect', label: 'Defect'},
description: {value: 'DefectText'}
}
@EndUserText.label: 'Defect and notification'
@AbapCatalog.preserveKey:true
@UI.presentationVariant: [{requestAtLeast: ['SitnNumberOfInstances', 'DefectText', 'DefectiveQuantity', 'SerialNumber', 'ChangedDateTime']}]
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
define view C_MfgOrderDefect
as select from I_MfgOrderDefectRecord as Defect
left outer to one join I_ShopFloorItem as ShopFloorItem on Defect.ShopFloorItem = ShopFloorItem.ShopFloorItem
left outer to one join I_ShopFloorItemStatus as ShopFloorStatus on ShopFloorStatus.ShopFloorItem = Defect.ShopFloorItem
and ShopFloorStatus.OpActyNtwkInstance = Defect.OpActyNtwkInstance
and ShopFloorStatus.OpActyNtwkElement = Defect.OpActyNtwkElement
association [0..1] to I_SitnInstceIndicator as _Sitn on _Sitn.SitnInstceAnchorObjectKey = $projection.Defect
and _Sitn.SitnDefAnchorObject = 'Defect'
association [1..1] to I_MfgOrderOperation as _MfgOrderOperation on _MfgOrderOperation.OrderInternalBillOfOperations = $projection.OrderInternalID
and _MfgOrderOperation.OrderIntBillOfOperationsItem = $projection.InspPlanOperationInternalID
association [1..1] to I_MfgOrderOperationBasic as _MfgOrderOperationBasic on _MfgOrderOperationBasic.OrderInternalBillOfOperations = $projection.OrderInternalID
and _MfgOrderOperationBasic.OrderIntBillOfOperationsItem = $projection.InspPlanOperationInternalID
association [1..1] to I_OperationActivityText as _OperationActivityText on $projection.ProductionOrderOperationActy = _OperationActivityText.OperationActivity
and $projection.ProductionOrderOpActyVers = _OperationActivityText.OperationActyVersionCounter
and _OperationActivityText.Language = $session.system_language
association [0..1] to I_DefectCodeText as _DefectCodeText on $projection.DefectCodeGroup = _DefectCodeText.DefectCodeGroup
and $projection.DefectCode = _DefectCodeText.DefectCode
and _DefectCodeText.Language = $session.system_language
association [0..*] to C_ReworkBOOVersionDefectCode as _ReworkBOOVersionDefectCode on $projection.DefectCodeGroup = _ReworkBOOVersionDefectCode.DefectCodeGroup
and $projection.DefectCode = _ReworkBOOVersionDefectCode.DefectCode
and ( --Non-serialized rework routings only if Defect is not bound to a serial number
(
(
$projection.SerialNumber = ''
or $projection.SerialNumber is null
)
and _ReworkBOOVersionDefectCode.OpActyConfIsSFIBased = ''
)
or( --Serialized rework routings only if Defect is bound to a serial number
$projection.SerialNumber > ''
and $projection.SerialNumber is not null
and _ReworkBOOVersionDefectCode.OpActyConfIsSFIBased = 'X'
)
)
association [0..1] to I_MaterialText as _MaterialText on $projection.Material = _MaterialText.Material
and _MaterialText.Language = $session.system_language
association [0..1] to I_MaterialText as _ProductText on $projection.ProducedMaterial = _ProductText.Material
and _ProductText.Language = $session.system_language
association [0..1] to I_MfgExecDocumentNote as _MfgExecDocumentNote on $projection.Notification <> $projection.Notification
{
@UI.hidden: true
key Defect.DefectInternalID,
@UI.lineItem.position: 30
key Defect.NotificationItem,
@ObjectModel.text.element: ['NotificationText']
@UI: {
textArrangement: #TEXT_LAST,
lineItem: [{position: 20}]
}
@Consumption.semanticObject:'QualityNotification'
Defect.Notification,
Defect.Defect,
@UI.hidden: true
ShopFloorItem.SerialNumber,
@ObjectModel.text.element: ['DefectCategoryText']
@UI: {
textArrangement: #TEXT_FIRST
}
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_MfgOrderDefectCategoryVH', element: 'DefectCategory'}}]
Defect.DefectCategory,
@UI.hidden: true
Defect._DefectCategory._Text[1: Language=$session.system_language].DefectCategoryText as DefectCategoryText,
Defect.NotificationType,
@UI.hidden: true
Defect.CreatedByUser,
@UI.hidden: true
Defect.CreationDate,
@UI.hidden: true
Defect.LastChangedByUser,
@UI.hidden: true
Defect.LastChangeDate,
@UI.hidden: true
Defect.DefectText,
@UI.hidden: true
Defect.DefectCodeCatalog,
@UI.hidden: true
Defect.DefectCodeGroup,
@ObjectModel.text.element: ['DefectCodeText']
@UI: {
textArrangement: #TEXT_FIRST,
lineItem: [{position: 40}, {position: 40, qualifier: 'OADETAILS'}]
}
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_MfgDefectCodeVH', element: 'DefectCode'},
additionalBinding: [{ localElement: 'DefectCodeGroup', element: 'DefectCodeGroup'}]}]
Defect.DefectCode,
@UI.hidden: true
@Semantics.text: true
_DefectCodeText.DefectCodeText,
@Semantics.quantity.unitOfMeasure: 'DefectiveQuantityUnit'
@EndUserText.label: 'Defective Quantity'
Defect.DefectiveQuantity,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProductUnitsOfMeasureVH', element: 'AlternativeUnit'},
additionalBinding: [{ localElement: 'Material', element: 'Product', usage: #FILTER}]}]
@Semantics.unitOfMeasure: true
Defect.DefectiveQuantityUnit,
@UI.hidden: true
Defect.DefectIsCreatedAutomatically,
@UI.hidden: true
Defect.ProductionOrderOperationActy,
@ObjectModel: {
readOnly: true
}
@ObjectModel.text.element: ['OperationActivityName']
Defect.OpActyNtwkElementExternalID,
@Semantics.text: true
@UI.hidden: true
_OperationActivityText.OperationActivityName,
@UI.hidden: true
@ObjectModel.readOnly: true
Defect.OpActyNtwkInstance,
@UI.hidden: true
@ObjectModel.readOnly: true
Defect.OpActyNtwkElement,
@ObjectModel.readOnly: true
@ObjectModel.text.element: ['MfgOrderOperationText']
cast(_MfgOrderOperationBasic.ManufacturingOrderOperation as vdm_vornr preserving type) as ManufacturingOrderOperation,
@UI.hidden: true
@ObjectModel.readOnly: true
_MfgOrderOperationBasic.MfgOrderOperationText,
@UI.hidden: true
Defect.ProductionOrderOpActyVers,
@UI.hidden: true
Defect.ProductionOrder,
@UI.hidden: true
Defect.OrderInternalID,
@UI.hidden: true
Defect.CreationTime,
@UI.hidden: true
Defect.LastChangeTime,
@UI.hidden: true
Defect.InspPlanOperationInternalID,
@UI.hidden: true
Defect.InspectionCharacteristic,
@UI.hidden: true
Defect.InspectionSubsetInternalID,
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_MfgOrderAssembledSerialVH', element: 'AssembledSerialNumber'}, label: 'Assembled',
additionalBinding: [{ localElement: 'Material', element: 'Material'},{ localElement: 'OpActyNtwkElement', element: 'OpActyNtwkElement', usage: #FILTER},
{ localElement: 'OpActyNtwkInstance', element: 'OpActyNtwkInstance', usage: #FILTER}, { localElement: 'Reservation', element: 'Reservation', usage: #FILTER },
{ localElement: 'ReservationItem', element: 'ReservationItem', usage: #FILTER}, { localElement: 'RecordType', element: 'RecordType', usage: #FILTER},
{ localElement: 'Plant', element: 'Plant', usage: #FILTER}, { localElement: 'ShopFloorItem', element: 'AssemblyShopFloorItem', usage: #FILTER},
{ localElement: 'BOMItemInstanceUUID', element: 'DgtlMockUpCharcsUUID', usage: #RESULT} , { localElement: 'Batch', element: 'Batch', usage: #RESULT},
{ localElement: 'ManufacturerSerialNumber', element: 'ManufacturerSerialNumber', usage: #RESULT}]} ,
{ entity: { name: 'I_AvailMaterialSerialNumberVH', element: 'SerialNumber'}, label: 'Available', qualifier: 'Secondary Value Help',
additionalBinding: [{ localElement: 'Material', element: 'Material'}]
}]
@EndUserText.label: 'Defective Serial Number'
Defect.DefectiveSingleUnit,
@ObjectModel.text.element: ['ProducedMaterialName']
@EndUserText.label: 'Produced Material'
Defect.ProducedMaterial,
@Semantics.text: true
@UI.hidden: true
_ProductText.MaterialName as ProducedMaterialName,
@EndUserText.label: 'Produced Serial Number'
Defect.ProducedSerialNumber,
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_MfgOrderAssembledBatchVH', element: 'Batch'}, label: 'Assembled',
additionalBinding: [{localElement: 'Material', element: 'Material'},
{localElement: 'OpActyNtwkElement', element: 'OpActyNtwkElement', usage: #FILTER},
{localElement: 'OpActyNtwkInstance', element: 'OpActyNtwkInstance', usage: #FILTER},
{localElement: 'Reservation', element: 'Reservation', usage: #FILTER},
{localElement: 'ReservationItem', element: 'ReservationItem', usage: #FILTER},
{localElement: 'RecordType', element: 'RecordType', usage: #FILTER},
{localElement: 'Plant', element: 'Plant', usage: #FILTER},
{localElement: 'ShopFloorItem', element: 'AssemblyShopFloorItem', usage: #FILTER},
{localElement: 'BatchBySupplier', element: 'BatchBySupplier', usage: #RESULT}]},
{ entity: { name: 'I_BatchVH', element: 'Batch'}, label: 'Available', qualifier: 'Secondary Value Help',
additionalBinding: [{localElement: 'Material', element: 'Material'},
{localElement: 'BatchBySupplier', element: 'BatchBySupplier', usage: #RESULT}]}]
Defect.Batch,
@UI.hidden: true
Defect.ShopFloorItem,
@UI.hidden: true
ShopFloorStatus.OperationActivitySFIGroup,
@UI.hidden: true
Defect.Equipment,
@UI.hidden: true
Defect.IsDeleted,
@ObjectModel.text.element: ['MaterialName']
@UI: {
textArrangement: #TEXT_FIRST
}
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_MfgOpActyComponentVH', element: 'Material'} ,label: 'Assigned Components',
additionalBinding: [{localElement: 'OpActyNtwkElement', element: 'OpActyNtwkElement', usage: #FILTER},
{localElement: 'OpActyNtwkInstance', element: 'OpActyNtwkInstance', usage: #FILTER},
{localElement: 'Reservation', element: 'Reservation', usage: #RESULT},
{localElement: 'ReservationItem', element: 'ReservationItem', usage: #RESULT},
{localElement: 'RecordType', element: 'RecordType', usage: #RESULT},
{localElement: 'SerialNumberIsRqdForAssembly', element: 'SerialNumberIsRqdForAssembly', usage: #RESULT},
{localElement: 'IsBatchManagementRequired', element: 'IsBatchManagementRequired', usage: #RESULT},
{localElement: 'ShopFloorItem', element: 'AssemblyShopFloorItem'},
{localElement: 'DefectiveQuantityUnit', element: 'EntryUnit', usage: #RESULT},
{localElement: 'Plant', element: 'Plant', usage: #RESULT},
{localElement: 'MatlCompInstceAssyIsRequired', element: 'MatlCompInstceAssyIsRequired', usage: #RESULT},
{localElement: 'CompIsAssignedToOpActy', element: 'CompIsAssignedToOpActy', usage: #RESULT},
{localElement: 'MfgRefStrucItmRefDsgntrName', element: 'MfgRefStrucItmRefDsgntrName', usage: #RESULT}]},
{ entity: { name: 'C_OpActyInstceReferenceCompVH', element: 'BillOfMaterialComponent'}, label: 'Reference Components', qualifier: 'Secondary Value Help',
additionalBinding: [{localElement: 'OpActyNtwkElement', element: 'OpActyNtwkElement', usage: #FILTER},
{localElement: 'OpActyNtwkInstance', element: 'OpActyNtwkInstance', usage: #FILTER},
{localElement: 'Reservation', element: 'Reservation', usage: #RESULT},
{localElement: 'ReservationItem', element: 'ReservationItem', usage: #RESULT},
{localElement: 'RecordType', element: 'RecordType', usage: #RESULT},
{localElement: 'SerialNumberIsRqdForAssembly', element: 'SerialNumberIsRqdForAssembly', usage: #RESULT},
{localElement: 'IsBatchManagementRequired', element: 'IsBatchManagementRequired', usage: #RESULT},
{localElement: 'MatlCompInstceAssyIsRequired', element: 'MatlCompInstceAssyIsRequired', usage: #RESULT},
{localElement: 'BillOfMaterialVersion', element: 'BillOfMaterialVersion', usage: #RESULT},
{localElement: 'BillOfMaterialCategory', element: 'BillOfMaterialCategory', usage: #RESULT},
{localElement: 'BillOfMaterial', element: 'BillOfMaterial', usage: #RESULT},
{localElement: 'BillOfMaterialVariant', element: 'BillOfMaterialVariant', usage: #RESULT},
{localElement: 'InheritedNodeNumberForBOMItem', element: 'InheritedNodeNumberForBOMItem', usage: #RESULT},
{localElement: 'CompIsAssignedToOpActy', element: 'CompIsAssignedToOpActy', usage: #RESULT},
{localElement: 'MfgRefStrucItmRefDsgntrName', element: 'MfgRefStrucItmRefDsgntrName', usage: #RESULT}]}]
@EndUserText.label: 'Component'
Defect.Material,
@Semantics.text: true
@UI.hidden: true
_MaterialText.MaterialName,
@UI.hidden: true
Defect.Plant,
@UI.hidden: true
Defect.InspectionLot,
@UI.hidden: true
Defect.ChangedDateTime,
@ObjectModel.text.element: 'DefectLifecycleStatusText'
@UI: {
textArrangement: #TEXT_ONLY
}
Defect.DefectLifecycleStatus,
@ObjectModel.text.element: 'NotifProcessingPhaseDesc'
@UI: {
textArrangement: #TEXT_ONLY
}
Defect.NotifProcessingPhase,
@UI.hidden: true
@ObjectModel.readOnly: true
Defect._DefectStatus._DefectStatusText[1: Language=$session.system_language].DefectLifecycleStatusText,
@UI.hidden: true
@ObjectModel.readOnly: true
Defect._NotifProcessingPhase._Text[1: Language=$session.system_language].NotifProcessingPhaseDesc,
@UI.hidden: true
@ObjectModel.readOnly: true
@Semantics.text: true
@EndUserText.label: 'Notification Text'
Defect.NotificationText,
@ObjectModel.readOnly: true
@ObjectModel.text.element: ['MfgDefectDecisionName']
@UI: {
textArrangement: #TEXT_ONLY,
lineItem: [{position: 50}]
}
@EndUserText.label: 'Decision'
Defect.MfgDefectDecision,
@UI.hidden: true
@ObjectModel.readOnly: true
@Semantics.text: true
Defect.MfgDefectDecisionName,
@ObjectModel.readOnly: true
@UI.hidden: true
_Sitn.SitnNumberOfInstances,
@UI.hidden: true
Defect.WorkCenterTypeCode,
@UI.hidden: true
Defect.WorkCenterInternalID as MainWorkCenterInternalID,
@UI.hidden: true
Defect.MainWorkCenter,
@UI.hidden: true
Defect.MainWorkCenterPlant,
@UI.hidden: true
Defect.BOMItemInstanceUUID,
@EndUserText.label: 'Reference Designator Value'
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_MPE_NONCF_COMP_SADL_EXIT'
cast('' as vmp_ref_des) as ReferenceDesignatorValue,
@ObjectModel.readOnly: true
Defect.BatchBySupplier,
@ObjectModel.readOnly: true
Defect.ManufacturerSerialNumber,
// @ObjectModel.readOnly: true
// Defect.MfgRefStrucItmRefDsgntrName,
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_MPE_NONCF_COMP_SADL_EXIT'
cast('' as mpe_mrs_designator_name) as MfgRefStrucItmRefDsgntrName,
@UI.hidden: true
_MfgExecDocumentNote.MfgExecutionDocumentNote,
@ObjectModel.readOnly: true
@UI.hidden: true
_MfgOrderOperationBasic.ManufacturingOrder,
@UI.hidden: true
@ObjectModel.readOnly: true
_MfgOrderOperationBasic._MfgOrder.ManufacturingOrderText,
/* For UI operations for additional binding*/
@UI.hidden: true
cast(' ' as qcode preserving type) as ManufacturingActionReasonCode,
@UI.hidden: true
cast('' as mpe_hold_object_type) as ProductionHoldObjectType,
@UI.hidden: true
cast('' as rsnum) as Reservation,
@UI.hidden: true
cast('' as rspos) as ReservationItem,
@UI.hidden: true
cast('' as rsart preserving type) as RecordType,
@UI.hidden: true
cast(' ' as werks_d preserving type) as OrderHeaderProductionPlant,
@UI.hidden: true
cast(' ' as stlty preserving type ) as BillOfMaterialCategory,
@UI.hidden: true
cast(' ' as abap.char(8)) as BillOfMaterial,
@UI.hidden: true
cast(' ' as stalt preserving type ) as BillOfMaterialVariant,
@UI.hidden: true
cast('00000000' as stvkn preserving type ) as InheritedNodeNumberForBOMItem,
@UI.hidden: true
cast(' 'as bom_version preserving type ) as BillOfMaterialVersion,
@UI.hidden: true
cast(' ' as mpe_rtg_assigned_to_oa preserving type) as CompIsAssignedToOpActy,
@UI.hidden: true
@ObjectModel.virtualElement: true
cast('' as objky) as LinkedSAPObjectKey,
// @ObjectModel.virtualElement: true*/
// cast('' as objky) as AttachmentObjKey,
/* Associations */
Defect._Notification,
Defect._DefectStatus,
Defect._InspectionLot,
Defect._CreatedByUserContactCard,
Defect._DefectCode,
Defect._DefectCodeCatalog,
Defect._DefectCodeGroup,
Defect._ProducedMaterial,
Defect._LastChangedByUserContactCard,
Defect._NotifProcessingPhase,
Defect._DefectCategory,
Defect._DefectDecisionVH,
_MfgOrderOperationBasic._MfgOrder,
Defect._OpActyNtwkInstance,
_DefectCodeText,
_MfgOrderOperation,
_OperationActivityText,
_MaterialText,
_ProductText,
_ReworkBOOVersionDefectCode
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEFECTCATEGORY",
"I_DEFECTCATEGORYTEXT",
"I_DEFECTCODETEXT",
"I_DEFECTSTATUS",
"I_DEFECTSTATUSTEXT",
"I_MATERIALTEXT",
"I_MFGEXECDOCUMENTNOTE",
"I_MFGORDER",
"I_MFGORDERDEFECTRECORD",
"I_MFGORDEROPERATIONBASIC",
"I_NOTIFPROCESSINGPHASE",
"I_NOTIFPROCESSINGPHASEDESC",
"I_OPERATIONACTIVITYTEXT",
"I_SHOPFLOORITEM",
"I_SHOPFLOORITEMSTATUS",
"I_SITNINSTCEINDICATOR"
],
"ASSOCIATED":
[
"C_REWORKBOOVERSIONDEFECTCODE",
"I_DEFECTCATEGORY",
"I_DEFECTCODETEXT",
"I_DEFECTSTATUS",
"I_INSPECTIONCATALOG",
"I_INSPECTIONCODE",
"I_INSPECTIONCODEGROUP",
"I_INSPECTIONLOT",
"I_MATERIALTEXT",
"I_MFGDEFECTDECISION",
"I_MFGEXECDOCUMENTNOTE",
"I_MFGORDER",
"I_MFGORDEROPERATION",
"I_MFGORDEROPERATIONBASIC",
"I_NOTIFICATION",
"I_NOTIFPROCESSINGPHASE",
"I_OPACTYNTWKINSTANCE",
"I_OPERATIONACTIVITYTEXT",
"I_PRODUCT",
"I_SITNINSTCEINDICATOR",
"I_USERCONTACTCARD"
],
"BASE":
[
"I_MFGORDERDEFECTRECORD",
"I_MFGORDEROPERATIONBASIC"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/