P_MfgDefectHistory

DDL: P_MFGDEFECTHISTORY SQL: PMFGDEFECTHIST Type: view COMPOSITE

P_MfgDefectHistory is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_NotificationItem) and exposes 27 fields with key fields Notification, NotificationItem.

Data Sources (1)

SourceAliasJoin Type
I_NotificationItem NotificationItem from

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PMFGDEFECTHIST view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY Notification I_NotificationItem Notification
KEY NotificationItem I_NotificationItem NotificationItem
NotificationFieldLengthValue
DefectCategory I_NotificationItem DefectCategory
CreatedByUser I_NotificationItem CreatedByUser
CreationDate I_NotificationItem CreationDate
LastChangedByUser I_NotificationItem LastChangedByUser
LastChangeDate I_NotificationItem LastChangeDate
OrderInternalIDendasOrderInternalID
CreationTime
LastChangeTime
InspectionSubsetInternalID I_NotificationItem InspectionSubsetInternalID
EquipmentendasEquipment
IsDeleted
ProducedMaterialendasMaterial
PlantendasPlant
InspectionLotendasInspectionLot
ChangedDateTime I_NotificationItem ChangedDateTime
DefectInternalID I_NotificationItem Notification
NotificationItemText I_NotificationItem NotificationItemText
MainWorkCenter I_NotificationItem MainWorkCenter
MainWorkCenterPlant I_NotificationItem MainWorkCenterPlant
ProducedSerialNumberendasSerialNumber
InspectionCharacteristic I_NotificationItem InspectionCharacteristic
_CreatedByUserContactCard I_NotificationItem _CreatedByUserContactCard
_LastChangedByUserContactCard I_NotificationItem _LastChangedByUserContactCard
_DefectCategory I_NotificationItem _DefectCategory
@AbapCatalog.sqlViewName: 'PMFGDEFECTHIST'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #M
@ObjectModel.usageType.dataClass: #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_MfgDefectHistory
  as select from           I_NotificationItem as NotificationItem
    left outer to one join I_Notification     as Notification        on NotificationItem.Notification = Notification.Notification

    left outer to one join I_NotificationItem as NotificationItemRef on NotificationItemRef.Notification = NotificationItem.ReferencedDefect
{
  key   NotificationItem.Notification,
  key   NotificationItem.NotificationItem,
  key   case
            when NotificationItem.ReferencedDefect is not initial
                then cast( substring(NotificationItem.ReferencedDefect,2,11) as qdefectid preserving type )
            when NotificationItem.DefectCategory is not initial
                then cast( substring(NotificationItem.Notification,2,11) as qdefectid preserving type )
            else ''
        end                                                                            as Defect,
        length(NotificationItem.Notification)                                          as NotificationFieldLengthValue,
        NotificationItem.DefectCategory,
        @ObjectModel: { foreignKey.association: '_CreatedByUserContactCard' }
        NotificationItem.CreatedByUser,
        NotificationItem.CreationDate,
        @ObjectModel: { foreignKey.association: '_LastChangedByUserContactCard' }
        NotificationItem.LastChangedByUser,
        NotificationItem.LastChangeDate,
        case
        when NotificationItem.ReferencedDefect is not initial
            then NotificationItemRef.ProductionOrderOperationActy
        else
             NotificationItem.ProductionOrderOperationActy
        end                                                                            as ProductionOrderOperationActy,
        case
        when NotificationItem.ReferencedDefect is not initial
            then NotificationItemRef.ProductionOrderOpActyVers
        else
            NotificationItem.ProductionOrderOpActyVers
        end                                                                            as ProductionOrderOpActyVers,
        case
        when NotificationItem.ReferencedDefect is not initial
             then NotificationItemRef.ProductionOrder
        when NotificationItem.InspectionCharacteristic is not initial
             then cast( Notification.ProductionOrder     as vdm_qm_fertaufnr preserving type )
        else
             cast( NotificationItem.ProductionOrder     as vdm_qm_fertaufnr preserving type )
        end                                                                            as ProductionOrder,
        case
        when NotificationItem.ReferencedDefect is not initial
            then NotificationItemRef.OrderInternalID
        when NotificationItem.InspectionCharacteristic is not initial
            then Notification.MfgOrderInternalID
        else
             NotificationItem.OrderInternalID
        end                                                                            as OrderInternalID,
        @Semantics.time: true
        cast( NotificationItem.CreationTime        as vdm_qerstezeit preserving type ) as CreationTime,
        @Semantics.time: true
        cast( NotificationItem.LastChangeTime      as vdm_qaendezeit preserving type ) as LastChangeTime,

        case
        when NotificationItem.ReferencedDefect is not initial
            then NotificationItemRef.InspPlanOperationInternalID
        else
             NotificationItem.InspPlanOperationInternalID
        end                                                                            as InspPlanOperationInternalID,
        NotificationItem.InspectionSubsetInternalID,
        case
        when NotificationItem.ReferencedDefect is not initial
            then NotificationItemRef.Equipment
        else
             NotificationItem.Equipment
        end                                                                            as Equipment,
        @Semantics.booleanIndicator: true
        cast( NotificationItem.IsDeleted     as vdm_qdefisdeleted preserving type )    as IsDeleted,

        case
            when NotificationItem.ReferencedDefect is not initial
                then  NotificationItemRef.ProducedMaterial
            when NotificationItem.InspectionCharacteristic is not initial
                then cast( Notification.Material as vdm_defective_material preserving type )
            else
                NotificationItem.ProducedMaterial
        end                                                                            as Material,

        case
        when NotificationItem.Plant is initial
            then Notification.Plant
        else
             NotificationItem.Plant
        end                                                                            as Plant,

        case
        when NotificationItem.ReferencedDefect is not initial
             then NotificationItemRef.InspectionLot
        when NotificationItem.InspectionCharacteristic is not initial
            then Notification.InspectionLot
        else
             NotificationItem.InspectionLot
        end                                                                            as InspectionLot,

        NotificationItem.ChangedDateTime,
        NotificationItem.Notification                                                  as DefectInternalID,
        NotificationItem.NotificationItemText,
        NotificationItem.MainWorkCenter,
        NotificationItem.MainWorkCenterPlant,
        case
            when NotificationItem.ReferencedDefect is not initial
                then NotificationItemRef.ProducedSerialNumber
            when NotificationItem.DefectCategory is not initial
                then NotificationItem.ProducedSerialNumber
        end                                                                            as SerialNumber,

        NotificationItem.InspectionCharacteristic,
        /* Associations */
        NotificationItem._CreatedByUserContactCard,
        NotificationItem._LastChangedByUserContactCard,
        NotificationItem._DefectCategory
}