I_InspectionCode

DDL: I_INSPECTIONCODE SQL: IINSPCODE Type: view BASIC

Inspection Code

I_InspectionCode is a Basic CDS View that provides data about "Inspection Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 6 fields with key fields InspectionCatalog, InspectionCodeGroup, InspectionCode. It has 3 associations to related views.

Data Sources (1)

SourceAliasJoin Type
qpcd qpcd from

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_Inspectioncatalog _InspectionCatalog $projection.InspectionCatalog = _InspectionCatalog.InspectionCatalog
[1..1] I_InspectionCodeGroup _InspectionCodeGroup $projection.InspectionCatalog = _InspectionCodeGroup.InspectionCatalog and $projection.InspectionCodeGroup = _InspectionCodeGroup.InspectionCodeGroup
[1..*] I_InspectionCodeText _Text $projection.InspectionCatalog = _Text.InspectionCatalog and $projection.InspectionCodeGroup = _Text.InspectionCodeGroup and $projection.InspectionCode = _Text.InspectionCode

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName IINSPCODE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Inspection Code view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
ObjectModel.representativeKey InspectionCode view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #CUSTOMIZING view
Metadata.ignorePropagatedAnnotations true view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY InspectionCatalog qpcd katalogart
KEY InspectionCodeGroup codegruppe
KEY InspectionCode code
_InspectionCatalog _InspectionCatalog
_InspectionCodeGroup _InspectionCodeGroup
_Text _Text
@AbapCatalog.sqlViewName: 'IINSPCODE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Inspection Code'
@VDM: {
    viewType:#BASIC,
    lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@ObjectModel.supportedCapabilities: 
    [ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET ]
@ObjectModel.representativeKey: 'InspectionCode'
@ObjectModel.usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }
@Metadata.ignorePropagatedAnnotations: true
define view I_InspectionCode as select from qpcd 
  association [1..1] to I_Inspectioncatalog as _InspectionCatalog
    on $projection.InspectionCatalog = _InspectionCatalog.InspectionCatalog

  association [1..1] to I_InspectionCodeGroup as _InspectionCodeGroup
    on $projection.InspectionCatalog = _InspectionCodeGroup.InspectionCatalog
   and $projection.InspectionCodeGroup = _InspectionCodeGroup.InspectionCodeGroup
  association [1..*] to I_InspectionCodeText as _Text
    on $projection.InspectionCatalog = _Text.InspectionCatalog
   and $projection.InspectionCodeGroup = _Text.InspectionCodeGroup
   and $projection.InspectionCode      = _Text.InspectionCode  
{
    @ObjectModel.foreignKey.association: '_InspectionCatalog'
    key qpcd.katalogart as InspectionCatalog,
    @Consumption.valueHelpDefinition: [ 
      { entity:  { name:    'I_InspectionCodeGroupStdVH',
                   element: 'InspectionCodeGroup' },
        additionalBinding: [{ localElement: 'InspectionCatalog',
                              element: 'InspectionCatalog' }]
      }]
    @ObjectModel.foreignKey.association: '_InspectionCodeGroup'
    key codegruppe as InspectionCodeGroup,
//  key qpcd.version --> is always 1 so we could leave out

    @ObjectModel.text.association: '_Text'
    key code as  InspectionCode,
    
    // DB field has three values, but field shall be indicator

//    @Semantics.booleanIndicator: true  // It is boolean, but we cannot tag it, due to static code check

     case qpcd.inaktiv
       when ' ' then cast( ' ' as vdm_qm_codeisinactive preserving type )
       else cast( 'X' as vdm_qm_codeisinactive preserving type )
     end                                                       as CodeIsInactive,    
    
    //Associations

    _InspectionCatalog,
    _InspectionCodeGroup,
    _Text
    
} where qpcd.version = '000001'