@AbapCatalog.sqlViewName: 'CMPEOAPLNDMATRET'
@AbapCatalog.compiler.compareFilter: true
@Metadata.allowExtensions: true
//@Search.searchable: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.privilegedAssociations: ['_OpActyCompInstceAssignment']
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #D, sizeCategory: #XL, dataClass: #MIXED}
@VDM.viewType: #CONSUMPTION
@UI.presentationVariant.sortOrder: {by: 'Material', direction: #ASC }
@EndUserText.label: 'Operation Activity Component'
@UI: {
headerInfo: {
typeNamePlural: 'Components to Disassemble'
},
presentationVariant.requestAtLeast: ['EffectivityParameterVariant','Assembly']
}
define view C_OperationActivityPlndMatlRet
as select from P_OperationActivityPlndMatlRet as OperationActivityPlndMatlRet
inner join I_OpActyInstceNtwkElmntBasic as OpActyInstceNtwkElmntBasic on OperationActivityPlndMatlRet.OpActyNtwkInstance = OpActyInstceNtwkElmntBasic.OpActyNtwkInstance
and OperationActivityPlndMatlRet.OpActyNtwkElement = OpActyInstceNtwkElmntBasic.OpActyNtwkElement
association [1..1] to I_OpActyNtwkInstance as _OpActyNtwkInstance on $projection.OpActyNtwkInstance = _OpActyNtwkInstance.OpActyNtwkInstance
association [1..1] to I_OperationActivityInstance as _OperationActivityInstance on $projection.OpActyNtwkInstance = _OperationActivityInstance.OpActyNtwkInstance
and $projection.OpActyNtwkElement = _OperationActivityInstance.OpActyNtwkElement
association [1..1] to I_Material as _Material on $projection.Material = _Material.Material
association [0..1] to I_ProductPlant as _ProductPlant on $projection.Material = _ProductPlant.Product
and $projection.ProductionPlant = _ProductPlant.Plant
association [1..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant
association [1..1] to I_Plant as _ProductionPlant on $projection.ProductionPlant = _ProductionPlant.Plant
association [0..1] to I_BillOfMaterialItemBasic as _BillOfMaterialItem on $projection.BillOfMaterialCategory = _BillOfMaterialItem.BillOfMaterialCategory
and $projection.BillOfMaterial = _BillOfMaterialItem.BillOfMaterial
and $projection.BOMItem = _BillOfMaterialItem.BillOfMaterialItemNodeNumber
and $projection.BOMItemInternalChangeCount = _BillOfMaterialItem.BOMItemInternalChangeCount
association [0..1] to I_ReservationDocumentHeader as _Reservation on $projection.Reservation = _Reservation.Reservation
association [0..*] to C_MfgOrderCompAssemblyAggrgn as _MfgOrderCompAssemblyAggrgn on $projection.Reservation = _MfgOrderCompAssemblyAggrgn.Reservation
and $projection.ReservationItem = _MfgOrderCompAssemblyAggrgn.ReservationItem
and $projection.RecordType = _MfgOrderCompAssemblyAggrgn.RecordType
and $projection.OpActyNtwkInstance = _MfgOrderCompAssemblyAggrgn.OpActyNtwkInstance
and $projection.OpActyNtwkElement = _MfgOrderCompAssemblyAggrgn.OpActyNtwkElement
and $projection.Material = _MfgOrderCompAssemblyAggrgn.Material
and _MfgOrderCompAssemblyAggrgn.AssemblyShopFloorItem = 0
association [0..*] to I_AssldReltdCompInstceSrlNmbr as _AssldReltdCompInstceSrlNmbr on $projection.Reservation = _AssldReltdCompInstceSrlNmbr.Reservation
and $projection.ReservationItem = _AssldReltdCompInstceSrlNmbr.ReservationItem
and $projection.RecordType = _AssldReltdCompInstceSrlNmbr.RecordType
and $projection.OpActyNtwkInstance = _AssldReltdCompInstceSrlNmbr.OpActyNtwkInstance
and $projection.OpActyNtwkElement = _AssldReltdCompInstceSrlNmbr.OpActyNtwkElement
and _AssldReltdCompInstceSrlNmbr.AssemblyShopFloorItem = 0
association [0..*] to I_AssldReltdSerialNumberBatch as _AssldReltdSerialNumberBatch on $projection.Reservation = _AssldReltdSerialNumberBatch.Reservation
and $projection.ReservationItem = _AssldReltdSerialNumberBatch.ReservationItem
and $projection.RecordType = _AssldReltdSerialNumberBatch.RecordType
and $projection.OpActyNtwkInstance = _AssldReltdSerialNumberBatch.OpActyNtwkInstance
and $projection.OpActyNtwkElement = _AssldReltdSerialNumberBatch.OpActyNtwkElement
and _AssldReltdSerialNumberBatch.AssemblyShopFloorItem = 0
association [0..*] to I_OpActyCompInstceAssignment as _OpActyCompInstceAssignment on $projection.Reservation = _OpActyCompInstceAssignment.Reservation
and $projection.ReservationItem = _OpActyCompInstceAssignment.ReservationItem
and $projection.RecordType = _OpActyCompInstceAssignment.RecordType
and $projection.OpActyNtwkInstance = _OpActyCompInstceAssignment.OpActyNtwkInstance
and $projection.OpActyNtwkElement = _OpActyCompInstceAssignment.OpActyNtwkElement
association [0..1] to I_MfgBOMItemWithPhantomHier as _MfgBOMItemWithPhantomHier on $projection.BillOfMaterialCategory = _MfgBOMItemWithPhantomHier.MfgBillOfMaterialCategory
and $projection.BillOfMaterialInternalID = _MfgBOMItemWithPhantomHier.MfgBillOfMaterial
and $projection.BillOfMaterialVariant = _MfgBOMItemWithPhantomHier.MfgBillOfMaterialVariant
and $projection.BillOfMaterialVersion = _MfgBOMItemWithPhantomHier.MfgBillOfMaterialVersion
and $projection.InheritedBOMItemNode = _MfgBOMItemWithPhantomHier.MfgBOMItmInhtdNodeNmbr
----Extension Association
association [0..1] to E_BillOfMaterialItemTP as _BillOfMaterialItemExtension on $projection.BillOfMaterialCategory = _BillOfMaterialItemExtension.BillOfMaterialCategory
and $projection.BillOfMaterial = _BillOfMaterialItemExtension.BillOfMaterial
and $projection.BOMItem = _BillOfMaterialItemExtension.BillOfMaterialItemNodeNumber
and $projection.BOMItemInternalChangeCount = _BillOfMaterialItemExtension.BOMItemInternalChangeCount
{
@ObjectModel.foreignKey.association: '_OpActyNtwkInstance'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_OpActyNtwkInstanceStdVH', element: 'OpActyNtwkInstance' } } ]
@UI.hidden: true
key OperationActivityPlndMatlRet.OpActyNtwkInstance, --OANInstanceID
@ObjectModel.foreignKey.association: '_OperationActivityInstance'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_OpActyInstceStdVH', element: 'OpActyNtwkElement' } } ]
@UI.hidden: true
key OperationActivityPlndMatlRet.OpActyNtwkElement, --OperationActivityElementNumber
@ObjectModel.foreignKey.association: '_Reservation'
@UI.hidden: true
key OperationActivityPlndMatlRet.Reservation, --ReservationNumber
@UI.hidden: true
key OperationActivityPlndMatlRet.ReservationItem, --ReservationItemNumber
@UI.hidden: true
key OperationActivityPlndMatlRet.RecordType, --ReservationRecordType
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
@ObjectModel: {
foreignKey.association: '_Material',
text.element: 'MaterialName'
}
@UI: {
dataPoint:{ title: 'Material'},
fieldGroup.position: 10,
identification.position: 10,
lineItem: [{position: 10}],
selectionField.position: 10,
statusInfo.position: 10
}
key OperationActivityPlndMatlRet.Material, --Material
@ObjectModel.foreignKey.association: '_Plant'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_PlantStdVH', element: 'Plant' } } ]
key OperationActivityPlndMatlRet.Plant,
@UI.hidden: true
OpActyInstceNtwkElmntBasic.ManufacturingOrder,
@ObjectModel.foreignKey.association: '_ProductionPlant'
@EndUserText.label: 'Production Plant'
OperationActivityPlndMatlRet.ProductionPlant,
@UI.hidden: true
@ObjectModel.foreignKey.association: '_StorageLocation'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_StorageLocation', element: 'StorageLocation' }, additionalBinding: [{localElement: 'Plant', element: 'Plant', usage: #FILTER }] } ]
OperationActivityPlndMatlRet.StorageLocation,
@UI.hidden: true
_Material._Text[1: Language=$session.system_language].MaterialName,
@UI.hidden: true
OperationActivityPlndMatlRet.AssemblySequenceNumber,
@UI.hidden: true
@Semantics.unitOfMeasure: true
OperationActivityPlndMatlRet.BaseUnit, --UnitOfMeasure
@UI.hidden: true
@Semantics.unitOfMeasure: true
cast(case OperationActivityPlndMatlRet.MaterialCompIsVariableSized
-- Variable-size item: Assembly typically has to be done in PC, but base unit e.g. is square meter
when 'X' then OperationActivityPlndMatlRet.VariableSizeItemUnit
else OperationActivityPlndMatlRet.BaseUnit
end as erfme preserving type) as EntryUnit,
@UI.identification.position: 20
@UI.statusInfo.position: 20
@UI.selectionField.position: 20
@UI.fieldGroup.position: 20
@Semantics.quantity.unitOfMeasure: 'EntryUnit'
@EndUserText: {
label: 'Total Quantity',
quickInfo: 'Total Quantity'
}
OperationActivityPlndMatlRet.MfgOrderComponentUsageQuantity,
@EndUserText.label: 'Planned Qty'
@Semantics.quantity.unitOfMeasure: 'EntryUnit'
@UI.lineItem: [{position: 40}]
OperationActivityPlndMatlRet.RequiredQuantity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
cast(case OperationActivityPlndMatlRet.MaterialCompIsVariableSized
when 'X' then OperationActivityPlndMatlRet.RequiredQuantity * OperationActivityPlndMatlRet.VariableSizeComponentQuantity
else OperationActivityPlndMatlRet.RequiredQuantity
end as mpe_planned_qty_in_base_unit) as RequiredQuantityInBaseUnit,
@UI.identification.position: 30
@UI.statusInfo.position: 30
@UI.selectionField.position: 30
@UI.fieldGroup.position: 30
@Semantics.quantity.unitOfMeasure: 'EntryUnit'
cast(case OperationActivityPlndMatlRet.MaterialCompIsVariableSized
-- Variable-size item: Assembly typically has to be done in PC, but base unit e.g. is square meter
when 'X' then OperationActivityPlndMatlRet.QuantityInEntryUnit
else OperationActivityPlndMatlRet.MaterialComponentQuantity
end as returned_quantity preserving type) as MaterialComponentQuantity, --Returned Quantity
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
OperationActivityPlndMatlRet.ResvnItmWithdrawnQtyInBaseUnit,
@UI.hidden: true
case when OperationActivityPlndMatlRet.MaterialComponentQuantity = 0 or OperationActivityPlndMatlRet.MaterialComponentQuantity is null then 0 --gray
when OperationActivityPlndMatlRet.MaterialComponentQuantity > OperationActivityPlndMatlRet.RequiredQuantity then 1 --red, because overfilled
when OperationActivityPlndMatlRet.MaterialComponentQuantity = OperationActivityPlndMatlRet.RequiredQuantity then 3 --green
else 2 --yellow, not filled completely
end as ComponentAssemblyCriticality,
@UI.hidden: true
OperationActivityPlndMatlRet.SerialNumberProfile, --MARC-SERNP
@UI.hidden: true
OperationActivityPlndMatlRet.SerialNumberIsRqdForAssembly,
@UI.hidden: true
OperationActivityPlndMatlRet.StockCheckMessageType,
@UI.hidden: true
OperationActivityPlndMatlRet.IsBatchManagementRequired, --MARC-XCHPF
@UI.hidden: true
cast( OperationActivityPlndMatlRet.MatlCompIsMarkedForBackflush as boolean preserving type ) as MatlCompIsMarkedForBackflush,
@UI.hidden: true
OperationActivityPlndMatlRet.EffectivityParameterVariant,
@UI.hidden: true
OperationActivityPlndMatlRet.Assembly,
@UI.hidden: true
OperationActivityPlndMatlRet.IsBulkMaterialComponent,
@UI.hidden: true
OperationActivityPlndMatlRet.GoodsMovementIsAllowed,
@UI.hidden: true
OperationActivityPlndMatlRet.MatlCompDiscontinuationType,
-- Variable-Size Item Fields
@UI.hidden: true
OperationActivityPlndMatlRet.MaterialCompIsVariableSized,
@UI.hidden: true
OperationActivityPlndMatlRet.FormulaKey,
@UI.hidden: true
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
OperationActivityPlndMatlRet.VariableSizeDimension1,
@UI.hidden: true
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
OperationActivityPlndMatlRet.VariableSizeDimension2,
@UI.hidden: true
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
OperationActivityPlndMatlRet.VariableSizeDimension3,
@UI.hidden: true
@Semantics.unitOfMeasure: true
OperationActivityPlndMatlRet.VariableSizeDimensionUnit,
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_MPE_VSI_FRMTD_FORMULA_VE'
}
cast('' as mpe_vsi_formatted_formula) as VarblSizeCompFrmtdFormulaVal,
@Semantics.quantity.unitOfMeasure: 'VariableSizeComponentUnit'
OperationActivityPlndMatlRet.VariableSizeComponentQuantity,
@UI.hidden: true
@Semantics.unitOfMeasure: true
OperationActivityPlndMatlRet.VariableSizeComponentUnit,
@ObjectModel.text.element: ['MatlCompAssembleControlName']
@UI: {
lineItem: [{position: 20}],
textArrangement: #TEXT_ONLY
}
OperationActivityPlndMatlRet.MatlCompAssembleControl,
@UI.hidden: true
OperationActivityPlndMatlRet._MatlCompAssembleControl._Text[1: Language=$session.system_language].MatlCompAssembleControlName,
@ObjectModel.text.element: ['CompDisassemblyPermanenceName']
@UI: {
lineItem: [{position: 30}],
textArrangement: #TEXT_ONLY
}
OperationActivityPlndMatlRet.CompDisassemblyPermanence,
@UI.hidden: true
OperationActivityPlndMatlRet._CompDisassemblyPermanence._Text[1: Language=$session.system_language].CompDisassemblyPermanenceName,
@ObjectModel.text.element: 'BillOfMaterialItemCategoryDesc'
OperationActivityPlndMatlRet.BOMItemCategory,
@UI.hidden: true
OperationActivityPlndMatlRet._BOMItemCategory._ItemCategoryT[1: Language=$session.system_language].BillOfMaterialItemCategoryDesc,
@ObjectModel.text.element: 'MfgRefStrucItmRefDsgntrDesc'
cast( case OperationActivityPlndMatlRet.MfgRefStrucItmDetIsContextual
when 'X' then OperationActivityPlndMatlRet._MfgRefHierItemWithDetails.MfgRefStrucItmRefDesignator
else OperationActivityPlndMatlRet._MfgRefStrucItemWithDetails.MfgRefStrucItmRefDesignator
end as mpe_mrs_designator preserving type ) as MfgRefStrucItmRefDesignator,
@UI.hidden: true
cast( case OperationActivityPlndMatlRet.MfgRefStrucItmDetIsContextual
when 'X' then OperationActivityPlndMatlRet._MfgRefHierItemWithDetails._MfgReferenceHierarchyItmTxt[1: Language=$session.system_language].HierMfgRefDesignatorDesc
else OperationActivityPlndMatlRet._MfgRefStrucItemWithDetails._MfgReferenceStructureItmTxt[1: Language=$session.system_language].MfgRefStrucItmRefDsgntrDesc
end as mpe_mrs_designator_description preserving type ) as MfgRefStrucItmRefDsgntrDesc,
cast( case OperationActivityPlndMatlRet.MfgRefStrucItmDetIsContextual
when 'X' then OperationActivityPlndMatlRet._MfgRefHierItemWithDetails.HierMfgReferenceDesignatorName
else OperationActivityPlndMatlRet._MfgRefStrucItemWithDetails.MfgRefStrucItmRefDsgntrName
end as mpe_mrs_designator_name preserving type ) as MfgRefStrucItmRefDsgntrName,
cast(coalesce(_MfgBOMItemWithPhantomHier.MfgBOMItemIsPhantomChild, '')
as mpe_bom_phantom_child preserving type) as MfgBOMItemIsPhantomChild,
-- Reference Information to other components
@UI.hidden: true
OperationActivityPlndMatlRet.RelatedReservation,
@UI.hidden: true
OperationActivityPlndMatlRet.RelatedReservationItem,
@UI.hidden: true
OperationActivityPlndMatlRet.RelatedRecordType,
@UI.hidden: true
OperationActivityPlndMatlRet.RelatedOpActyNtwkInstance,
@UI.hidden: true
OperationActivityPlndMatlRet.RelatedOpActyNtwkElement,
@UI.hidden: true
OperationActivityPlndMatlRet.LeadingReservation,
@UI.hidden: true
OperationActivityPlndMatlRet.LeadingReservationItem,
@UI.hidden: true
OperationActivityPlndMatlRet.LeadingReservationRecordType,
@UI.hidden: true
OperationActivityPlndMatlRet.LeadingOpActyNtwkInstance,
@UI.hidden: true
OperationActivityPlndMatlRet.LeadingOpActyNtwkElement,
-- Additional data needed for corresponding association
@UI.hidden: true
OperationActivityPlndMatlRet.BillOfMaterialCategory,
@UI.hidden: true
cast( OperationActivityPlndMatlRet.BillOfMaterial as mpe_exec_stnum preserving type ) as BillOfMaterial,
@UI.hidden: true
OperationActivityPlndMatlRet.BOMItem,
@UI.hidden: true
OperationActivityPlndMatlRet.InheritedBOMItemNode,
@UI.hidden: true
OperationActivityPlndMatlRet.BillOfMaterialVariant,
@UI.hidden: true
OperationActivityPlndMatlRet.BillOfMaterialInternalID,
@UI.hidden: true
OperationActivityPlndMatlRet.BillOfMaterialVersion,
@UI.hidden: true
OperationActivityPlndMatlRet.BOMItemInternalChangeCount,
@UI.hidden: true
OpActyInstceNtwkElmntBasic.BillOfOperationsType,
@UI.hidden: true
OpActyInstceNtwkElmntBasic.BillOfOperationsGroup,
@UI.hidden: true
OperationActivityPlndMatlRet.BOOOpBOMItemInternalID,
@UI.hidden: true
OperationActivityPlndMatlRet.LogicalComponent,
@UI.hidden: true
OperationActivityPlndMatlRet.MfgRefStrucBOMLeafAssgmtUUID,
@UI.hidden: true
OperationActivityPlndMatlRet.MfgRefStructureItemDetailUUID,
@UI.hidden: true
OperationActivityPlndMatlRet.MfgRefStrucItmDetIsContextual,
@UI.hidden: true
OperationActivityPlndMatlRet.MatlCompInstceAssyIsRequired,
@UI.hidden: true
OperationActivityPlndMatlRet.PlannedInventoryUsabilityCode,
@UI.hidden: true
OpActyInstceNtwkElmntBasic.OperationActivity,
@UI.hidden: true
OpActyInstceNtwkElmntBasic.OperationActyVersionCounter,
// mara.zeinr as ImageID, -- not needed
// *********** next fields cannot come in this view because there can be several assemblies per component **********
// asm.sfi_id as AssembledComponentSFIID, -- is empty in case the component has not been assembled yet
// asm.batch as AssembledComponentBatch,
// sfi.sfi_id as ComponentSFIID,
// sfi.sfi_number as ComponentSFINumber
_MfgOrderCompAssemblyAggrgn,
_AssldReltdCompInstceSrlNmbr,
_AssldReltdSerialNumberBatch,
_OpActyNtwkInstance,
_OperationActivityInstance,
_Material,
_Reservation,
_ProductPlant,
OpActyInstceNtwkElmntBasic._MfgOrder,
_ProductionPlant,
_Plant,
OperationActivityPlndMatlRet._StorageLocation,
_BillOfMaterialItem,
//_DigitalMockUp,
//_DigitalMockUpCharcs,
_OpActyCompInstceAssignment
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLOFMATERIALITEMCATEGORY",
"I_BOMITEMCATEGORYTEXT",
"I_COMPDISASSEMBLYPERMANENCE",
"I_COMPDISASSEMBLYPERMANENCETXT",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_MATLCOMPASSEMBLECONTROL",
"I_MATLCOMPASSEMBLECONTROLTEXT",
"I_MFGBOMITEMWITHPHANTOMHIER",
"I_MFGREFERENCEHIERARCHYITMTXT",
"I_MFGREFERENCESTRUCTUREITMTXT",
"I_MFGREFHIERITEMWITHDETAILS",
"I_MFGREFSTRUCITEMWITHDETAILS",
"I_OPACTYINSTCENTWKELMNTBASIC",
"P_OPERATIONACTIVITYPLNDMATLRET"
],
"ASSOCIATED":
[
"C_MFGORDERCOMPASSEMBLYAGGRGN",
"E_BILLOFMATERIALITEMTP",
"I_ASSLDRELTDCOMPINSTCESRLNMBR",
"I_ASSLDRELTDSERIALNUMBERBATCH",
"I_BILLOFMATERIALITEMBASIC",
"I_MATERIAL",
"I_MFGBOMITEMWITHPHANTOMHIER",
"I_MFGORDER",
"I_OPACTYCOMPINSTCEASSIGNMENT",
"I_OPACTYNTWKINSTANCE",
"I_OPERATIONACTIVITYINSTANCE",
"I_PLANT",
"I_PRODUCTPLANT",
"I_RESERVATIONDOCUMENTHEADER",
"I_STORAGELOCATION"
],
"BASE":
[
"I_OPACTYINSTCENTWKELMNTBASIC",
"P_OPERATIONACTIVITYPLNDMATLRET"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/