C_DefectCalc

DDL: C_DEFECTCALC SQL: CDEFECTCALC Type: view CONSUMPTION Package: ODATA_QM_DEFECT

Manage Defects Calculation Fields

C_DefectCalc is a Consumption CDS View that provides data about "Manage Defects Calculation Fields" in SAP S/4HANA. It reads from 1 data source (I_DefectUnion) and exposes 5 fields with key field DefectInternalID. It has 1 association to related views. Part of development package ODATA_QM_DEFECT.

Data Sources (1)

SourceAliasJoin Type
I_DefectUnion I_DefectUnion from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_MfgOrderVH _MfgOrderVH $projection.ManufacturingOrder = _MfgOrderVH.ManufacturingOrder

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName CDEFECTCALC view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Manage Defects Calculation Fields view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY DefectInternalID DefectInternalID
NumberOfDefects NumberOfDefects
CreationDateTime
LastChangeDateTime
ManufacturingOrder ProductionOrder
@AbapCatalog.sqlViewName: 'CDEFECTCALC'
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Manage Defects Calculation Fields'
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality:  #D
@ObjectModel.usageType.sizeCategory: #XL
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]

define view C_DefectCalc as select from I_DefectUnion

// Manufacturing Order

     association [0..1] to I_MfgOrderVH              as _MfgOrderVH                                   on  $projection.ManufacturingOrder = _MfgOrderVH.ManufacturingOrder

 {
    key DefectInternalID,
    
    NumberOfDefects,
    
    //@ObjectModel.readOnly: true

    @ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
    case
        when NumberOfDefects > 0 then  1
        else 3
    end as   NumberOfDefectsCriticality,
    
    @ObjectModel.readOnly: true
    @Consumption: {  filter:{ selectionType: #INTERVAL, multipleSelections: false} }
    @EndUserText: { label: 'Created On', quickInfo: 'Record Created On' }
    cast(dats_tims_to_tstmp(CreationDate, CreationTime, abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as timestamp ) as CreationDateTime,
       
    @ObjectModel.readOnly: true
    @Consumption: {  filter:{ selectionType: #INTERVAL, multipleSelections: false} }
    @EndUserText: { label: 'Changed On', quickInfo: 'Record Last Changed On' }
    cast(dats_tims_to_tstmp(LastChangeDate, LastChangeTime, abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as timestamp ) as LastChangeDateTime,
    
    @ObjectModel.readOnly: true
    ProductionOrder as ManufacturingOrder,
    
    // Technical field

    @ObjectModel: {
      readOnly: true,
      sort.enabled: false,
      filter.enabled: false
    }
    case _MfgOrderVH.ManufacturingOrderCategory
      when '10' then cast('ProductionOrder               ' as /ui2/semantic_object preserving type )
      when '40' then cast('ProcessOrder                  ' as /ui2/semantic_object preserving type )
      // Without order use the formerly configured static value

      else cast('ProductionOrder               ' as /ui2/semantic_object preserving type )
    end as DefectOrderSemanticObject,
    
    // Technical field

    @ObjectModel: {
      readOnly: true,
      sort.enabled: false,
      filter.enabled: false
    }
    case _MfgOrderVH.ManufacturingOrderCategory
      when '10' then cast('ProductionOrder                         ' as /iwfnd/med_mdl_property_name preserving type )
      when '40' then cast('ProcessOrder                            ' as /iwfnd/med_mdl_property_name preserving type )
      // Without order use the formerly configured static value

      else cast('ProductionOrder                         ' as /iwfnd/med_mdl_property_name preserving type )
    end as DefectOrderSemObjKeyProperty
    
}