@AbapCatalog: { sqlViewName: 'CSAMPLEOP', compiler.compareFilter: true, preserveKey: true }
@ObjectModel.usageType: { serviceQuality: #C, sizeCategory: #M, dataClass: #MIXED }
@EndUserText.label: 'Material Sample'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: [ '_StatusObjectStatus' ]
@VDM.viewType: #CONSUMPTION
@Search.searchable: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #REQUIRED
@ObjectModel:{
compositionRoot: true,
semanticKey: ['MaterialSample'],
createEnabled: false,
updateEnabled: false,
deleteEnabled: false}
@UI.headerInfo:{
typeName: 'Sample' ,
typeNamePlural: 'Samples',
title: { type: #STANDARD, value: 'MaterialSample', label: 'Sample Number' },
description: { type: #STANDARD, value: 'MaterialSampleText', label: 'Description' }}
define view C_Materialsampleobjpage
as select from I_MaterialSample
association [0..*] to C_Materialsamplestatus as _StatusObjectStatus on $projection.ObjectInternalID = _StatusObjectStatus.StatusObject
association [0..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant
//Get 'Samples with same Sample-Drwaing
association [0..*] to C_MtrlSmplSameDrwbngOp as _MtrlSmplSameDrwbngOp on $projection.MaterialSampleDrawing = _MtrlSmplSameDrwbngOp.MaterialSampleDrawing
//Get 'Other Sample' data
association [0..*] to I_MaterialSample as _Samples on $projection.MaterialSampleDrawing = _Samples.MaterialSampleDrawing
association [0..1] to I_MaterialSampleDetails as _SampleDetails on $projection.MaterialSample = _SampleDetails.MaterialSample
association [0..*] to I_FunctionalLocationText as _FunctionalLocationText on $projection.MaterialSampleDrawingLocation = _FunctionalLocationText.FunctionalLocation
association [0..1] to I_MatlSmplContainerType as _MatlSmplContainerType on $projection.MatlSmplContainerType = _MatlSmplContainerType.MatlSmplContainerType
//Get 'Sample stored' and 'Sample exists'
association [0..1] to I_StatusObjectActiveStatus as _SampleStoredStatus on $projection.ObjectInternalID = _SampleStoredStatus.StatusObject
and _SampleStoredStatus.StatusCode = 'I0363'
association [0..1] to I_StatusObjectActiveStatus as _SampleExistStatus on $projection.ObjectInternalID = _SampleExistStatus.StatusObject
and _SampleExistStatus.StatusCode = 'I0362'
//Get Active statuses
association [0..1] to I_StsObjConcatActiveStsILL as _StsObjConcatActvStatus on _StsObjConcatActvStatus.StatusObject = $projection.ObjectInternalID
//Get 'Changed by' User name
association [0..1] to I_User as _UserChangedBy on _UserChangedBy.UserID = I_MaterialSample.MaterialSampleChangedBy
//Value help for Inspection Lot
association [0..1] to I_InspectionLotVH as _InspectionLotVH on $projection.InspectionLot = _InspectionLotVH.InspectionLot
{
@Search: {
defaultSearchElement: true,
ranking: #HIGH,
fuzzinessThreshold: 0.8
}
@UI.selectionField.position: 10
@UI.lineItem: {position:10, importance: #HIGH}
@UI.identification: [ { position: 10 } ]
@ObjectModel.text.element:[ 'MaterialSampleText' ]
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_MaterialSampleStdVH', element: 'MaterialSample' } }]
key MaterialSample,
@Consumption.semanticObject: 'Plant'
@UI: {
selectionField.position: 40,
lineItem: [{position:40, importance: #HIGH}],
fieldGroup: [ { qualifier: 'DataForStorage', position: 8 }]
}
@Consumption.valueHelpDefinition: [{ association: '_Plant' }]
Plant,
@UI.hidden: true
_Plant.PlantName,
ObjectInternalID,
@UI: {
selectionField.element: 'MaterialSampleCategory',
lineItem: {position:30, importance: #MEDIUM},
fieldGroup: [ { qualifier: 'HeaderIdentification', position: 10, groupLabel: 'Identification' } ]
}
@ObjectModel.text.element:[ 'MaterialSampleCategoryText' ]
@ObjectModel.foreignKey.association: '_MaterialSampleCategory'
MaterialSampleCategory,
/* Section 'SAMPLE DETAILS' */
@UI.fieldGroup: [ { qualifier: 'SampleDetails', position: 10, groupLabel:'{@i18n>@SampleDetails}' }]
@UI.hidden: true
//Sample Category text
_MaterialSampleCategory._Text[1:Language = $session.system_language].MaterialSampleCategoryText,
@ObjectModel.text.element: [ 'MatlSmplContainerTypeText' ]
@UI.fieldGroup: [ { qualifier: 'SampleDetails', position: 20 } ]
MatlSmplContainerType,
@Consumption.semanticObject: 'SampleDrawingProcedure'
@UI.fieldGroup: [ { qualifier: 'SampleDetails', position: 30 } ]
SmplDrawingProcedure,
@UI.fieldGroup: [ { qualifier: 'SampleDetailsAdditional', groupLabel: 'Additional Sample Details', position: 10 } ]
@UI.dataPoint:{ title: 'Sample Quantity' }
@Semantics.quantity.unitOfMeasure: 'MaterialSampleSizeUnit'
//Sample quantity ( Sample size + UOM)
I_MaterialSample.MaterialSampleSize,
@Semantics.unitOfMeasure: true
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_UnitOfMeasureStdVH', element: 'UnitOfMeasure' } }
]
cast( I_MaterialSample.MaterialSampleSizeUnit as vdm_qphysprme preserving type ) as MaterialSampleSizeUnit,
@UI.hidden: true
@UI.fieldGroup: [ { qualifier: 'SampleDetails', position: 30 } ]
I_MaterialSample._MatlSmplContainerType._MatlSmplContainerTypeText[1:Language = $session.system_language].MatlSmplContainerTypeText,
//Highest Partial Sample No. Valid for Instruction
@UI.fieldGroup: [ { qualifier: 'SampleDetailsAdditional', position: 20 } ]
SmplDrwgProcedPartialSampleTo,
@UI.selectionField.position: 20
@UI.selectionField.element: 'MaterialSampleTypeText'
@UI.lineItem: [{position:20, importance: #MEDIUM}]
@ObjectModel.text.element:[ 'MaterialSampleTypeText' ]
@ObjectModel.foreignKey.association: '_MaterialSampleType'
MaterialSampleType,
@UI.hidden: true
_MaterialSampleType._Text[1:Language = $session.system_language].MaterialSampleTypeText,
@UI.hidden: true
I_MaterialSample._Material._Text[1:Language = $session.system_language].MaterialName,
MaterialSampleText,
/* Section 'SAMPLE DRAWING' */
//--[ GENERATED:012:GlBfhyFV7kY4hXe}ZdCJcm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_MaterialStdVH',
element: 'Material' }
}]
// ]--GENERATED
@Consumption.semanticObject: 'Material'
@UI.lineItem:{position: 70, importance: #HIGH}
@UI.selectionField.element: 'Material'
@UI.identification: [ { position: 20 } ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOrigin', position: 20 }, { qualifier: 'HeaderIdentification', position: 20, groupLabel: 'Identification' } ]
@ObjectModel.text.element:[ 'MaterialName' ]
@ObjectModel.foreignKey.association: '_Material'
Material,
@UI.selectionField.element: 'MaterialSampleDrawing'
@UI.lineItem:{position: 40, importance: #MEDIUM}
MaterialSampleDrawing,
@Consumption: {
semanticObject: 'Batch',
valueHelpDefinition: [
{ entity: { name: 'I_BatchVH', element: 'Batch' },
additionalBinding: [{ element: 'Plant', localElement: 'Plant'}, { element: 'Material', localElement: 'Material' }]
}]
}
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOrigin', position: 10, groupLabel: '{@i18n>@SampleDrawingOrigin}'},
{qualifier: 'HeaderIdentification', position: 30, groupLabel: 'Identification'}]
@UI.lineItem:{position: 70, importance: #HIGH}
@UI.selectionField.element: 'Batch'
Batch,
@ObjectModel.text.element: [ 'FunctionalLocationName' ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOtherdata', position: 40 } ]
MaterialSampleDrawingLocation,
@UI.hidden: true
case _FunctionalLocationText[1:Language = $session.system_language].FunctionalLocationName
// Use description with flag 'is primary language' = true if there is no text in the current language
when '' then _FunctionalLocationText[1:IsPrimaryLanguage = 'X'].FunctionalLocationName
else _FunctionalLocationText[1:Language = $session.system_language].FunctionalLocationName
end as FunctionalLocationName,
@UI.identification: [ { position: 20 } ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOtherdata', position: 50 } ]
MatlSmplDrawingLocDescription,
MatlQualityAuthorizationGroup,
@Consumption.semanticObject: 'Supplier'
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_Supplier_VH',element: 'Supplier'} }
]
@ObjectModel.text.element: [ 'SupplierName' ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOtherdata', position: 20 } ]
@EndUserText.label: 'Supplier'
@EndUserText.quickInfo: 'Supplier'
_SampleDetails.Supplier,
@UI.hidden: true
_SampleDetails.SupplierName,
@Consumption.semanticObject: 'Supplier'
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_Supplier_VH',element: 'Supplier'} }
]
@ObjectModel.text.element: [ 'ManufacturerName' ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOtherdata', position: 10, groupLabel: '{@i18n>@SampleDrawingOtherData}'}]
_SampleDetails.Manufacturer,
@UI.hidden: true
_SampleDetails.ManufacturerName,
@Consumption.semanticObject: 'Customer'
@ObjectModel.text.element: [ 'CustomerName' ]
@UI.fieldGroup: [ { qualifier: 'SampleDrawingOtherdata', position: 30 } ]
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_Customer_VH',element: 'Customer'} }
]
_SampleDetails.Customer,
@UI.hidden: true
_SampleDetails.CustomerName,
@UI.identification: [ { position: 50 } ]
MaterialSampleResponsibleName,
@UI.identification: [ { position: 20 } ]
@Consumption.filter: { selectionType: #INTERVAL }
MaterialSampleDrawingOnDate,
/* Section 'INSPECTION LOT' */
@Consumption.semanticObject: 'InspectionLot'
@UI.identification: [ { position: 10 } ]
@UI.fieldGroup: [ { qualifier: 'CurrentInspectionLot', position: 10, groupLabel:'{@i18n>@CurrentInspectionLot}' } ]
@UI.selectionField.element: 'InspectionLot'
@UI.lineItem: [{position:50, importance: #HIGH}]
@ObjectModel.text.element:[ 'InspectionLotText' ]
@Consumption.valueHelpDefinition: [{ association: '_InspectionLotVH' }]
@EndUserText.label: 'Inspection Lot'
InspectionLot,
_InspectionLot,
@UI.hidden: true
I_MaterialSample._InspectionLot.InspectionLotText,
@UI.fieldGroup: [ { qualifier: 'CurrentInspectionLot', position: 20 } ]
I_MaterialSample._InspectionLot.InspectionLotContainer, //No. of lot containers
@UI.identification: [ { position: 30 } ]
@UI.fieldGroup: [ { qualifier: 'CurrentInspectionLot', position: 30 } ]
@Semantics.quantity.unitOfMeasure: 'InspectionLotQuantityUnit'
I_MaterialSample._InspectionLot.InspectionLotQuantity,
@Semantics.unitOfMeasure: true
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_UnitOfMeasureStdVH', element: 'UnitOfMeasure' } }
]
cast( I_MaterialSample._InspectionLot.InspectionLotQuantityUnit as vdm_insplotuom preserving type ) as InspectionLotQuantityUnit,
@UI.fieldGroup: [ { qualifier: 'CurrentInspectionLot', position: 50 } ]
@Semantics.quantity.unitOfMeasure: 'InspectionLotSampleUnit'
I_MaterialSample._InspectionLot.InspectionLotSampleQuantity,
@Semantics.unitOfMeasure: true
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_UnitOfMeasureStdVH', element: 'UnitOfMeasure' } }
]
cast( I_MaterialSample._InspectionLot.InspectionLotSampleUnit as vdm_insplotsampleuom preserving type ) as InspectionLotSampleUnit,
@UI.fieldGroup: [ { qualifier: 'CurrentInspectionLot', position: 60 }, { qualifier: 'SampleDetailsAdditional', position: 30 } ]
@Semantics.unitOfMeasure: true
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_UnitOfMeasureStdVH', element: 'UnitOfMeasure' } }
]
I_MaterialSample._InspectionLot.InspectionLotContainerUnit,
@UI.fieldGroup: [ { qualifier: 'InspectionSpecifications', position: 10, groupLabel:'{@i18n>@InspectionSpecifications}' } ]
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_BillOfOperationsGroup', element: 'BillOfOperationsGroup' } }
]
I_MaterialSample._InspectionLot.BillOfOperationsGroup, // Group
@UI.fieldGroup: [ { qualifier: 'InspectionSpecifications', position: 20 } ]
I_MaterialSample._InspectionLot.BillOfOperationsVariant, //Group Counter
// @UI.fieldGroup: [ { qualifier: 'InspectionSpecifications', position: 40 } ]
// // @UI.hidden: true
// I_MaterialSample._InspectionLot.SmplDrawingProcedure as InspLotSmplDrawingProcedure,
@UI.fieldGroup: [ { qualifier: 'InspectionSpecifications', position: 50 } ]
I_MaterialSample._InspectionLot.SmplDrwgProcedIsConfRequired,
@UI.fieldGroup: [ { qualifier: 'InspectionSpecifications', position: 60 } ]
I_MaterialSample._InspectionLot.InspLotHasMaterialSpec,
@UI.fieldGroup: [ { qualifier: 'UsageDecision', position: 30, groupLabel:'{@i18n>@UsageDecision}' } ]
I_MaterialSample._InspectionLot._InspLotUsageDecision.InspectionLotQualityScore,
@UI.fieldGroup: [ { qualifier: 'UsageDecision', position: 40 } ]
I_MaterialSample._InspectionLot._InspLotUsageDecision._UsageDecisionCode.UsageDecisionCodeText,
/* Section 'SAMPLE STORAGE' */
@Consumption.semanticObject: 'StorageLocation'
@ObjectModel.text.element: [ 'StorageLocationName' ]
@UI.fieldGroup: [ { qualifier: 'DataForStorage', position: 10, groupLabel:'{@i18n>@DataForStorage}' }]
I_MaterialSample.StorageLocation, //Storage location
@UI.hidden: true
I_MaterialSample._StorageLocation.StorageLocationName,
//--[ GENERATED:012:GlBfhyFV7kY4hXe}ZdCJcm
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_MatlSmplStorLocStdVH',
element: 'MaterialSampleStorageLocation' },
additionalBinding: [{ localElement: 'Plant',
element: 'MatlSamplePlant' }]
}]
// ]--GENERATED
@ObjectModel.text.element: [ 'MatlSampleStorageLocationText' ]
@UI.fieldGroup: [ { qualifier: 'DataForStorage', position: 20 }]
I_MaterialSample.MaterialSampleStorageLocation, //Sample Location
@UI.hidden: true
@UI.fieldGroup: [ { qualifier: 'DataForStorage', position: 20 }]
I_MaterialSample._MatlSampleStorageLocation._Text[1:Language = $session.system_language].MatlSampleStorageLocationText,
@UI.fieldGroup: [ { qualifier: 'DataForStorage', position: 30 }]
I_MaterialSample.MatlSmplStorageInformation,
@UI.fieldGroup: [ { qualifier: 'StoragePeriod', position: 10, groupLabel:'{@i18n>@StoragePeriod}' }]
@Consumption.filter: { selectionType: #INTERVAL }
I_MaterialSample.MatlSmplStorageEndDate,
@UI.fieldGroup: [ { qualifier: 'StoragePeriod', position: 20 }]
I_MaterialSample.MatlSmplStorageDuration,
@UI.fieldGroup: [ { qualifier: 'SampleStatus', position: 10, groupLabel:'{@i18n>@SampleStatus}' }]
@EndUserText.label: 'Sample Was Stored'
@EndUserText.quickInfo: 'Sample Was Stored'
case _SampleStoredStatus.StatusIsActive
when 'X' then 'X'
else ''
end as MaterialSampleIsStored,
@UI.fieldGroup: [ { qualifier: 'SampleStatus', position: 20 }]
@EndUserText.label: 'Sample Consumed/Destroyed'
@EndUserText.quickInfo: 'Sample Consumed/Destroyed'
case _SampleExistStatus.StatusIsActive
when 'X' then 'X'
else ''
end as MaterialSampleIsNotExisting,
/* Section 'ADMINISTRATION DATA' */
@ObjectModel.text.element: [ 'FullName' ]
@UI.fieldGroup: [ { qualifier: 'AdminDataCreated', position: 10, groupLabel:'{@i18n>@AdministrationData}' }]
_SampleDetails.CreatedByUser,
@UI.hidden: true
_SampleDetails.FullName,
//JSP commented out because UX improvements recommend to merge time and date fields
// @UI.fieldGroup: [ { qualifier: 'AdminDataCreated', position: 20 }]
// @Consumption.filter: { selectionType: #INTERVAL }
@UI.hidden: true
cast( _SampleDetails.CreationDate as vdm_qprs_anldt preserving type ) as CreationDate,
// @UI.fieldGroup: [ { qualifier: 'AdminDataCreated', position: 30 }]
@UI.hidden: true
cast( _SampleDetails.CreationTime as vdm_qprs_anlzt preserving type ) as CreationTime,
@ObjectModel.filter.transformedBy: 'ABAP_ZHT_TIMESTAMP_FLT_01'
@Consumption.filter: { selectionType: #INTERVAL }
@UI: { fieldGroup: [ { qualifier: 'AdminDataCreated', position: 20, label: 'Created On' }], lineItem.label: 'Created On' }
cast(dats_tims_to_tstmp(_SampleDetails.CreationDate, _SampleDetails.CreationTime,
abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as timestamp) as MaterialSampleCreationDateTime,
@ObjectModel.text.element: [ 'UserDescription' ]
@UI.fieldGroup: [ { qualifier: 'AdminDataChanged', position: 10, groupLabel:'{@i18n>@AdministrationData}' } ]
I_MaterialSample.MaterialSampleChangedBy,
@UI.hidden: true
_UserChangedBy.UserDescription,
//JSP commented out because UX improvements recommend to merge time and date fields
// @UI.fieldGroup: [ { qualifier: 'AdminDataChanged', position: 20 }]
// @Consumption.filter: { selectionType: #INTERVAL }
@UI.hidden: true
cast( I_MaterialSample.MaterialSampleChangedOn as vdm_qprs_aendt preserving type ) as MaterialSampleChangedOn,
//
// @UI.fieldGroup: [ { qualifier: 'AdminDataChanged', position: 30 }]
@UI.hidden: true
cast( I_MaterialSample.MaterialSampleChangeTime as vdm_qprs_aenzt preserving type ) as MaterialSampleChangeTime,
@ObjectModel.filter.transformedBy: 'ABAP_ZHT_TIMESTAMP_FLT_01'
@Consumption.filter: { selectionType: #INTERVAL }
@UI: { fieldGroup: [ { qualifier: 'AdminDataChanged', position: 20, label: 'Changed On' }], lineItem.label: 'Changed On' }
cast(dats_tims_to_tstmp(I_MaterialSample.MaterialSampleChangedOn,I_MaterialSample.MaterialSampleChangeTime,
abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as timestamp) as MaterialSampleChangeDateTime,
// Fields for authorization check
@Consumption.hidden: true
_MaterialSampleDrawing.IsBusinessPurposeCompleted,
/* Associations */
@Consumption.filter.hidden: true
_Samples,
@Consumption.filter.hidden: true
_MtrlSmplSameDrwbngOp,
@Consumption.filter.hidden: true
_StatusObjectStatus,
@Consumption.filter.hidden: true
_SampleDetails,
@Consumption.filter.hidden: true
_Plant,
@Consumption.filter.hidden: true
_MaterialSampleCategory,
@Consumption.filter.hidden: true
_MaterialSampleType,
_Material,
@Consumption.filter.hidden: true
_MatlQualityAuthGroup,
@Consumption.filter.hidden: true
_MaterialSampleSizeUnit,
@Consumption.filter.hidden: true
_InspectionLotVH,
@Consumption.filter.hidden: true
I_MaterialSample._StorageLocation as _StorageLocation,
@Consumption.filter.hidden: true
I_MaterialSample._MatlSampleStorageLocation as _MatlSampleStorageLocation,
@Consumption.filter.hidden: true
I_MaterialSample._MatlSampleStorageLocation._Plant as _MatlSampleStorageLocPlant,
@Consumption.hidden: true // Field necessary for consumption of association above
I_MaterialSample._MatlSampleStorageLocation.MatlSamplePlant,
@Consumption.filter.hidden: true
_SampleDrawingProcedure
}