P_InhRepairNote

DDL: P_INHREPAIRNOTE Type: view_entity TRANSACTIONAL

P_InhRepairNote is a Transactional CDS View in SAP S/4HANA. It reads from 3 data sources (I_InhRepairNote, I_InHouseRepair, I_ServiceDocumentLongText) and exposes 13 fields with key fields CustMgmtObjectType, InHouseRepair, TextObjectType, Language, InHouseRepair.

Data Sources (3)

SourceAliasJoin Type
I_InhRepairNote I_InhRepairNote from
I_InHouseRepair InHouseRepair inner
I_ServiceDocumentLongText new union

Annotations (8)

NameValueLevelField
VDM.private true view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #NONE view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.ignorePropagatedAnnotations true view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY CustMgmtObjectType CustMgmtObjectType
KEY InHouseRepair InHouseRepair
KEY TextObjectType TextObjectType
KEY Language Language
InHouseRepairUUID InHouseRepairUUID
TextObjectCategory TextObjectCategory
ServiceObjectTypeasCustMgmtObjectType
KEY InHouseRepair I_ServiceDocumentLongText ServiceDocument
KEY TextObjectType I_ServiceDocumentLongText TextObjectType
KEY Language I_ServiceDocumentLongText Language
InHouseRepairUUID I_InHouseRepair InHouseRepairUUID
TextObjectCategory I_ServiceDocumentLongText TextObjectCategory
CreatedByUser
@VDM: {
  private: true,
  viewType: #TRANSACTIONAL,
  lifecycle.contract.type: #NONE
}
@AccessControl: {
  authorizationCheck: #PRIVILEGED_ONLY
}
@ObjectModel: {
  usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
}
@Metadata: {
  ignorePropagatedAnnotations: true
}

// this view selects header data from old persistence (STXH) and new (CRMD_S4TEXT) so that SADL Exit later on

// can be called in both cases.

// It must be assured that only one entry is selected since both persistencies can be filled for one object.

// Therefore, fields like CreatedTime, CreateDate, ChangedTime, ChangedDate and ChangedUser must be omitted.

// UNION cannot handle LOB fields; therefore, a string field must added later on again.

define view entity P_InhRepairNote as select from I_InhRepairNote
{
    key CustMgmtObjectType,
    key InHouseRepair,
    key TextObjectType,
    key Language,
    InHouseRepairUUID,
    TextObjectCategory,
    CreatedByUser
    // string fields must be omitted

//    InhRepairNoteText

    
} where TextObjectCategory = 'CRM_ORDERH' 

union select from I_ServiceDocumentLongText as new
  // make sure only IHR-relevant texts are read

  inner join             I_InHouseRepair  as InHouseRepair on InHouseRepair.InHouseRepair = new.ServiceDocument
{
  key new.ServiceObjectType as CustMgmtObjectType,
  key new.ServiceDocument as InHouseRepair, 
  key new.TextObjectType,
  key new.Language,
  InHouseRepair.InHouseRepairUUID as InHouseRepairUUID,
  new.TextObjectCategory,
  cast( new.SrvcDocLongTextCreatedByUser as tdfuser ) as CreatedByUser
  // string field must be omitted

  //ServiceDocumentLongText

} where new.TextObjectCategory = 'CRM_ORDERH'