C_DefectCalcFld

DDL: C_DEFECTCALCFLD SQL: CDEFECTCF Type: view CONSUMPTION

Defects Calculation Fields View

C_DefectCalcFld is a Consumption CDS View that provides data about "Defects Calculation Fields View" in SAP S/4HANA. It reads from 1 data source (I_DefectUnion) and exposes 35 fields with key field Defect. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_DefectUnion _Defect_TP from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_Material _Material $projection.Material = _Material.Material
[1..1] I_DefectCode _DefectCode $projection.DefectCode = _DefectCode.DefectCode and $projection.DefectCodeGroup = _DefectCode.DefectCodeGroup

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName CDEFECTCF view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Defects Calculation Fields View view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (35)

KeyFieldSource TableSource FieldDescription
KEY Defect Defect
CalculationDate
CreationDate CreationDate
InspectionLot InspectionLot
DefectCode DefectCode
DefectCodeGroup DefectCodeGroup
Material Material
DefectCodeText
MaterialName
NumberOfDefects
Plant Plant
DefectCategory DefectCategory
Customer
InspectionLotOrigin _InspectionLot InspectionLotOrigin
InspectionLotType _InspectionLot InspectionLotType
InspectionLotHasQuantity _InspectionLot InspectionLotHasQuantity
BatchStorageLocation _InspectionLot BatchStorageLocation
Manufacturer _InspectionLot Manufacturer
ManufacturerPartNmbr _InspectionLot ManufacturerPartNmbr
MatlQualityAuthorizationGroup _InspectionLot MatlQualityAuthorizationGroup
PurchasingOrganization _InspectionLot PurchasingOrganization
SalesOrganization _InspectionLot SalesOrganization
SoldToParty _InspectionLot SoldToParty
Supplier _InspectionLot Supplier
IsBusinessPurposeCompleted _InspectionLot IsBusinessPurposeCompleted
WorkCenterTypeCode WorkCenterTypeCode
MainWorkCenterInternalID MainWorkCenterInternalID
MainWorkCenter MainWorkCenter
MainWorkCenterPlant MainWorkCenterPlant
Notification Notification
_DefectCode _DefectCode
_Material _Material
_DefectCodeGroup _DefectCodeGroup
_InspectionLot _InspectionLot
_Notification _Notification
@AbapCatalog.sqlViewName: 'CDEFECTCF'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Defects Calculation Fields View'
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality:  #C
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE

define view C_DefectCalcFld

 // with parameters

//    P_CurrentDate : dats

  //as select from I_Defect_TP as _Defect_TP

  as select from I_DefectUnion as _Defect_TP
  association [1..1] to I_Material   as _Material   on  $projection.Material = _Material.Material
  association [1..1] to I_DefectCode as _DefectCode on  $projection.DefectCode      = _DefectCode.DefectCode
                                                    and $projection.DefectCodeGroup = _DefectCode.DefectCodeGroup
{

  key Defect,
    
      //Days calculation

      dats_days_between(cast(left(cast(CreationDate as abap.char(23)), 8) as abap.dats), cast(left( cast(tstmp_current_utctimestamp() as abap.char(23)), 8 ) as abap.dats)) as CalculationDate,
      
      CreationDate,
      InspectionLot,
      DefectCode,
      DefectCodeGroup,
      Material,
      _DefectCode._Text[1:Language=$session.system_language].DefectCodeText                                                                                                                                                                                                                                                                                                                                              as               DefectCodeText,
      _Material._Text[1:Language=$session.system_language].MaterialName                                                                                                                                                                                                                                                                                                                                                  as               MaterialName,
      cast( 1 as vdm_numberofdefects )                                                                                                                                                                                                                                                                                                                                                                                   as               NumberOfDefects,
//      NumberOfDefects,

      Plant,
      DefectCategory,
      //_Defect_TP._InspectionLot.Customer,

      _Defect_TP._InspectionLot.Customer,
      _InspectionLot.InspectionLotOrigin,
      _InspectionLot.InspectionLotType,
      _InspectionLot.InspectionLotHasQuantity,
      _InspectionLot.BatchStorageLocation,
      _InspectionLot.Manufacturer,
      _InspectionLot.ManufacturerPartNmbr,
      _InspectionLot.MatlQualityAuthorizationGroup,
      _InspectionLot.PurchasingOrganization,
      _InspectionLot.SalesOrganization,
      _InspectionLot.SoldToParty,
      _InspectionLot.Supplier,
      @Consumption.hidden: true
      _InspectionLot.IsBusinessPurposeCompleted,
    
      // Fields for authorization check

      @Consumption.hidden: true
      WorkCenterTypeCode,
      @Consumption.hidden: true
      MainWorkCenterInternalID,
      @Consumption.hidden: true
      MainWorkCenter,
      @Consumption.hidden: true
      MainWorkCenterPlant,
      @Consumption.hidden: true
      Notification,

      /* Associations */
      _DefectCode,
      _Material,
      _DefectCodeGroup,
      _InspectionLot,
      @Consumption.hidden: true
      _Notification
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEFECTCODE",
"I_DEFECTCODETEXT",
"I_DEFECTUNION",
"I_INSPECTIONLOT",
"I_MATERIAL",
"I_MATERIALTEXT"
],
"ASSOCIATED":
[
"I_DEFECTCODE",
"I_DEFECTCODEGROUP",
"I_INSPECTIONLOT",
"I_MATERIAL",
"I_NOTIFICATION"
],
"BASE":
[
"I_DEFECTUNION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/