@AbapCatalog.sqlViewName : 'PINSPOPAGGR4'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private:true
@VDM.viewType: #COMPOSITE
define view P_InspOperationAggregate4 as select from I_InspSubsetCharacteristic
inner join I_InspectionCharacteristic as InspChar
on InspChar.InspectionLot = I_InspSubsetCharacteristic.InspectionLot and
InspChar.InspPlanOperationInternalID = I_InspSubsetCharacteristic.InspPlanOperationInternalID and
InspChar.InspectionCharacteristic = I_InspSubsetCharacteristic.InspectionCharacteristic
{
key I_InspSubsetCharacteristic.InspectionLot,
key I_InspSubsetCharacteristic.InspPlanOperationInternalID,
sum(case
when I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = 'A' then 1
when I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = '+' then 999999 //to force int4-type
else 0 end ) as InspSubsetCharcAcceptedCount,
sum(case when I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = 'R' then 1
when I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = '+' then 999999 //to force int4-type
else 0 end ) as InspSubsetCharcRejectedCount,
sum(case
when (( I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult is null or
I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = ' ' or
I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = 'F' )
and (I_InspSubsetCharacteristic.InspectionCharacteristicStatus <> '4') ) then 1
when I_InspSubsetCharacteristic._InspSubsetResult.InspectionValuationResult = '+' then 999999 //to force int4-type
else 0 end ) as InspSubsetCharcOpenCount,
sum(case when ( (I_InspSubsetCharacteristic.InspectionCharacteristicStatus = '4') and
( I_InspSubsetCharacteristic._InspSubsetResult.InspectionSubsetInternalID is null ) )
then 1
else 0 end ) as NumberOfSkipInspSubsetCharcs
}
where not I_InspSubsetCharacteristic.InspectionSubsetInternalID = '000000'
group by I_InspSubsetCharacteristic.InspectionLot,
I_InspSubsetCharacteristic.InspPlanOperationInternalID
Depth:
1
2
3
4
5
All
Reload
P_InspOperationAggregate4 view