I_DefectCode
Defect Code
I_DefectCode is a Basic CDS View (Dimension) that provides data about "Defect Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 7 fields with key fields DefectCodeGroup, DefectCode. It has 3 associations to related views. Part of development package VDM_QM_NOTIFICATION.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| qpcd | qpcd | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_DefectCodeGroup | _DefectCodeGroup | $projection.DefectCodeGroup = _DefectCodeGroup.DefectCodeGroup |
| [0..*] | I_DefectCodeText | _Text | $projection.DefectCodeGroup = _Text.DefectCodeGroup and $projection.DefectCode = _Text.DefectCode |
| [0..1] | I_DefectClass | _DefectClass | $projection.DefectClass = _DefectClass.DefectClass |
Annotations (13)
| Name | Value | Level | Field |
|---|---|---|---|
| EndUserText.label | Defect Code | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #BASIC | view | |
| VDM.lifecycle.contract.type | #PUBLIC_LOCAL_API | view | |
| Analytics.dataCategory | #DIMENSION | view | |
| Analytics.technicalName | IDEFECTCODE | view | |
| ObjectModel.modelingPattern | #NONE | view | |
| ObjectModel.representativeKey | DefectCode | view | |
| ObjectModel.usageType.serviceQuality | #A | view | |
| ObjectModel.usageType.sizeCategory | #M | view | |
| ObjectModel.usageType.dataClass | #CUSTOMIZING | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| Metadata.allowExtensions | true | view |
Fields (7)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | DefectCodeGroup | |||
| KEY | DefectCode | |||
| DefectClass | qpcd | fehlklasse | ||
| CodeGroupStatus | _DefectCodeGroup | CodeGroupStatus | ||
| _DefectCodeGroup | _DefectCodeGroup | |||
| _Text | _Text | |||
| _DefectClass | _DefectClass |
@EndUserText.label: 'Defect Code'
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.privilegedAssociations: [ '_Text', '_DefectCodeGroup' ]
@VDM: {
viewType:#BASIC,
lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@Analytics.dataCategory: #DIMENSION
@Analytics.technicalName: 'IDEFECTCODE'
@ObjectModel.supportedCapabilities:
[ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET, #ANALYTICAL_DIMENSION ]
@ObjectModel.modelingPattern: #NONE
@ObjectModel: {
representativeKey: 'DefectCode',
usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }
}
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions:true
define view entity I_DefectCode as select from qpcd
association [1..1] to I_DefectCodeGroup as _DefectCodeGroup on $projection.DefectCodeGroup = _DefectCodeGroup.DefectCodeGroup
association [0..*] to I_DefectCodeText as _Text on $projection.DefectCodeGroup = _Text.DefectCodeGroup
and $projection.DefectCode = _Text.DefectCode
association [0..1] to I_DefectClass as _DefectClass on $projection.DefectClass = _DefectClass.DefectClass
{
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_DefectCodeGroupStdVH',
element: 'DefectCodeGroup' }
}]
@ObjectModel.foreignKey.association: '_DefectCodeGroup'
key cast( qpcd.codegruppe as vdm_qfegrp preserving type ) as DefectCodeGroup,
@ObjectModel.text.association: '_Text'
key cast( qpcd.code as vdm_qfecod preserving type ) as DefectCode,
// key qpcd.version --> is always 1 so we could leave out
// DB field has three values, but field shall be indicator
@Semantics.booleanIndicator: true
case qpcd.inaktiv
when ' ' then cast( ' ' as vdm_qm_codeisinactive preserving type )
else cast( 'X' as vdm_qm_codeisinactive preserving type )
end as CodeIsInactive,
@ObjectModel.foreignKey.association: '_DefectClass'
qpcd.fehlklasse as DefectClass,
// For authority check
_DefectCodeGroup.CodeGroupStatus,
// Associations
_DefectCodeGroup,
_Text,
_DefectClass
} where qpcd.katalogart = '9' // Defects
and qpcd.version = '000001'
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA