P_InspOperationAggregate4

DDL: P_INSPOPERATIONAGGREGATE4 Type: view_entity COMPOSITE Package: VDM_QM_INSPECTION

Aggregation on Inspection Operation

P_InspOperationAggregate4 is a Composite CDS View that provides data about "Aggregation on Inspection Operation" in SAP S/4HANA. It reads from 2 data sources (I_InspSubsetCharacteristic, I_InspectionCharacteristic) and exposes 2 fields with key fields InspectionLot, InspPlanOperationInternalID. Part of development package VDM_QM_INSPECTION.

Data Sources (2)

SourceAliasJoin Type
I_InspSubsetCharacteristic I_InspSubsetCharacteristic from
I_InspectionCharacteristic InspChar inner

Annotations (3)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY InspectionLot I_InspSubsetCharacteristic InspectionLot
KEY InspPlanOperationInternalID I_InspSubsetCharacteristic InspPlanOperationInternalID
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private:true
@VDM.viewType: #COMPOSITE
define view entity 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