R_InhRepairNoteTP

DDL: R_INHREPAIRNOTETP Type: view_entity TRANSACTIONAL

Notes for In-House Repair

R_InhRepairNoteTP is a Transactional CDS View that provides data about "Notes for In-House Repair" in SAP S/4HANA. It reads from 1 data source (P_InhRepairNote) and exposes 14 fields with key fields InHouseRepair, TextObjectType, Language. It has 4 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_InhRepairNote ihrnote from

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_InHouseRepair _InHouseRepair $projection.CustMgmtObjectType = _InHouseRepair.CustMgmtObjectType and $projection.InHouseRepair = _InHouseRepair.InHouseRepair
[0..1] I_TextObjectType _TextObjectType $projection.TextObjectType = _TextObjectType.TextObjectType and $projection.TextObjectCategory = _TextObjectType.TextObjectCategory
[0..1] I_TextObjectCategory _TextObjectCategory $projection.TextObjectCategory = _TextObjectCategory.TextObjectCategory
[0..1] I_Language _Language $projection.Language = _Language.Language

Annotations (8)

NameValueLevelField
EndUserText.label Notes for In-House Repair view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
VDM.viewType #TRANSACTIONAL view
AccessControl.authorizationCheck #MANDATORY view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (14)

KeyFieldSource TableSource FieldDescription
KEY InHouseRepair P_InhRepairNote InHouseRepair
KEY TextObjectType P_InhRepairNote TextObjectType
KEY Language P_InhRepairNote Language
InHouseRepairUUID P_InhRepairNote InHouseRepairUUID
TextObjectCategory P_InhRepairNote TextObjectCategory
CreatedByUser P_InhRepairNote CreatedByUser
CustMgmtObjectType P_InhRepairNote CustMgmtObjectType
LastChangeDateTime _InHouseRepair LastChangeDateTime
InhRepairNoteText _InoteTemp text
_TextObjectType _TextObjectType
_TextObjectCategory _TextObjectCategory
_Language _Language
_InHouseRepairTP _InHouseRepairTP
_InHouseRepair _InHouseRepair
@EndUserText.label: 'Notes for In-House Repair'
@VDM: {
  lifecycle.contract.type: #SAP_INTERNAL_API,
  viewType: #TRANSACTIONAL
}
@AccessControl: {
  authorizationCheck: #MANDATORY
}
@Metadata: {
  ignorePropagatedAnnotations: true
}
@ObjectModel: {
  usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}
}


define view entity R_InhRepairNoteTP
  as select from P_InhRepairNote  as ihrnote

  // We need an empty string field for the text. String fields cannot be created as "cast('' as systring)...".

  // Hence, we implement a dummy join that never returns a matching record but provides the string field (which then is null).

    left outer to one join crms4t_note_temp as _InoteTemp on _InoteTemp.id = ihrnote.InHouseRepair

  association        to parent I_InHouseRepairTP as _InHouseRepairTP    on  $projection.InHouseRepair = _InHouseRepairTP.InHouseRepair

  association [1..1] to I_InHouseRepair          as _InHouseRepair      on  $projection.CustMgmtObjectType = _InHouseRepair.CustMgmtObjectType
                                                                        and $projection.InHouseRepair      = _InHouseRepair.InHouseRepair

  association [0..1] to I_TextObjectType         as _TextObjectType     on  $projection.TextObjectType     = _TextObjectType.TextObjectType
                                                                        and $projection.TextObjectCategory = _TextObjectType.TextObjectCategory

  association [0..1] to I_TextObjectCategory     as _TextObjectCategory on  $projection.TextObjectCategory = _TextObjectCategory.TextObjectCategory

  association [0..1] to I_Language               as _Language           on  $projection.Language = _Language.Language
{
  key  ihrnote.InHouseRepair,

       @ObjectModel.foreignKey.association: '_TextobjectType'
  key  ihrnote.TextObjectType,

       @Semantics.language: true
       @ObjectModel.foreignKey.association: '_Language'
  key  ihrnote.Language,

       ihrnote.InHouseRepairUUID,

       @ObjectModel.foreignKey.association: '_TextObjectCategory'
       ihrnote.TextObjectCategory,

       @Semantics.user.createdBy: true
       ihrnote.CreatedByUser,

       // required for association to I_InhouseRepair. This is neccessary due to restrictions in projection view

       // when using custom query

       ihrnote.CustMgmtObjectType,
       
       // required for ETag

       _InHouseRepair.LastChangeDateTime,
      
       @Semantics.text:true
       _InoteTemp.text as InhRepairNoteText,

       _TextObjectType,
       _TextObjectCategory,
       _Language,

       _InHouseRepairTP,
       _InHouseRepair

}
where
  ihrnote.CustMgmtObjectType = 'BUS2000256'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_INHOUSEREPAIR",
"P_INHREPAIRNOTE",
"CRMS4T_NOTE_TEMP"
],
"ASSOCIATED":
[
"I_INHOUSEREPAIR",
"I_INHOUSEREPAIRTP",
"I_LANGUAGE",
"I_TEXTOBJECTCATEGORY",
"I_TEXTOBJECTTYPE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/