I_INHOUSEREPAIR

CDS View

In-House Service

I_INHOUSEREPAIR is a CDS View in S/4HANA. In-House Service. It contains 31 fields. 12 CDS views read from this table.

CDS Views using this table (12)

ViewTypeJoinVDMDescription
C_InhRepairProcFlowInformation view_entity from CONSUMPTION In-House Repair Attributes in Process Flow
ESH_N_INHOUSEREPAIR view from Anchor view -INHOUSEREPAIR
I_AllRepairObjectSituation view_entity inner COMPOSITE Anchor for Repair Object Situations
I_InHouseRepairSituation view_entity from COMPOSITE In-House Repair Situations
I_InHouseRepairTP view_entity from TRANSACTIONAL In-House Repair
I_InHouseRepairVH view_entity from COMPOSITE In-House Repair
I_InhRepairNote view_entity inner BASIC Notes for In-House Repair
I_RepairObjectSituation view_entity inner COMPOSITE Repair Object Situations
I_ReprObjCompltnNotPosblSitn view_entity inner COMPOSITE Repair Object Completion Situation
I_SrvcDocStatusChangeDocument view inner COMPOSITE Change Documents for Status
P_InhRepairNote view_entity inner TRANSACTIONAL Notes for In-House Repair
R_InhRepairFUPCustReturnTP view_entity from TRANSACTIONAL Follow-Up Returns Order for IHR - TP

Fields (31)

KeyField CDS FieldsUsed in Views
KEY CustMgmtObjectType CustMgmtObjectType 3
KEY InHouseRepair InHouseRepair 4
KEY InHouseRepairCharUUID ChangeDocObject 1
KEY InHouseRepairUUID InHouseRepairUUID 4
_CustMgmtObjectType _CustMgmtObjectType 1
_DistributionChannel _DistributionChannel 4
_Division _Division 4
_InhRepairType _InhRepairType 1
_RepairOrders _RepairOrders 1
_ResponsibleEmployee _ResponsibleEmployee 1
_SalesGroup _SalesGroup 4
_SalesGroupOrgUnit _SalesGroupOrgUnit 1
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2 1
_SalesOffice _SalesOffice 4
_SalesOfficeOrgUnit _SalesOfficeOrgUnit 1
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2 1
_SalesOrganization _SalesOrganization 4
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit 1
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2 1
CreatedByUser CreatedByUser 1
DistributionChannel DistributionChannel 6
Division Division 6
InhRepairType InhRepairType 3
PostingDate PostingDate 1
ResponsibleEmployee RespEmployeeBusinessPartnerId,ResponsibleEmployee 3
SalesGroup SalesGroup 6
SalesGroupOrgUnitID SalesGroupOrgUnitID 3
SalesOffice SalesOffice 6
SalesOfficeOrgUnitID SalesOfficeOrgUnitID 3
SalesOrganization SalesOrganization 6
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID 3
@EndUserText.label: 'In-House Service' //2602 CE Commented Repair

@VDM: {
  viewType: #BASIC,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@AccessControl: {
  authorizationCheck: #MANDATORY,
  personalData.blocking: #('TRANSACTIONAL_DATA'),
  privilegedAssociations: ['_RepairOrders', '_RepairQuotation', '_PredecessorCustomerReturn']
}
@ObjectModel: {
  representativeKey: 'InHouseRepair',
  usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL},       // sizeCategory: #L - expected number of rows is < 10.000.000

  supportedCapabilities: [#SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET] //Added 2602CE

}
@Analytics.technicalName: 'IINHOUSEREPAIR'
@Metadata: {
  ignorePropagatedAnnotations: true
}
/*+[hideWarning] { "IDS" : ["CALCULATED_FIELD_CHECK" ] }*/
define view entity I_InHouseRepair
  as select from crms4d_repa_h

  //association [0..1] to I_BusinessObjType              as _CustMgmtObjectType         on  $projection.CustMgmtObjectType = _CustMgmtObjectType.BusinessObjectType

  association [0..1] to I_CustMgmtBusObjType           as _CustMgmtObjectType         on  $projection.CustMgmtObjectType = _CustMgmtObjectType.BusinessObjectType
  
  association [0..1] to I_ServiceDocumentType          as _InhRepairType              on  $projection.InhRepairType = _InhRepairType.ServiceDocumentType

  association [0..1] to I_InhRepairStatus              as _InhRepairStatus            on  $projection.InhRepairStatus = _InhRepairStatus.InhRepairStatus
  association [0..1] to I_ServiceDocErrorStatus        as _InhRepairHasError          on  $projection.InhRepairHasError = _InhRepairHasError.ServiceDocumentHasError
  association [0..1] to I_ServiceDocOpenStatus         as _InhRepairIsOpen            on  $projection.InhRepairIsOpen = _InhRepairIsOpen.ServiceDocumentIsOpen

  association [0..1] to I_BusinessPartner              as _SoldToParty                on  $projection.SoldToParty = _SoldToParty.BusinessPartner
  association [0..1] to I_BusinessPartner              as _ContactPerson              on  $projection.ContactPerson = _ContactPerson.BusinessPartner
  association [0..1] to I_BusinessPartner              as _ShipToParty                on  $projection.ShipToParty = _ShipToParty.BusinessPartner
  association [0..1] to I_BusinessPartner              as _ResponsibleEmployee        on  $projection.ResponsibleEmployee = _ResponsibleEmployee.BusinessPartner

  //SD Sales Org. Unit

  association [0..1] to I_SalesOrganization            as _SalesOrganization          on  $projection.SalesOrganization = _SalesOrganization.SalesOrganization
  //CRM Sales Org. Unit

  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_SalesOrganizationUnit        as _SalesOrganizationOrgUnit   on  $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit.OrgUnitTypeIDConcatenated
                                                                                      and _SalesOrganizationOrgUnit.StartDate    <= $session.system_date
                                                                                      and _SalesOrganizationOrgUnit.EndDate      >= $session.system_date

  //SD Sales Office

  association [0..1] to I_SalesOffice                  as _SalesOffice                on  $projection.SalesOffice = _SalesOffice.SalesOffice
  //CRM Sales Office

  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_SalesOrganizationUnit        as _SalesOfficeOrgUnit         on  $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit.OrgUnitTypeIDConcatenated
                                                                                      and _SalesOfficeOrgUnit.StartDate    <= $session.system_date
                                                                                      and _SalesOfficeOrgUnit.EndDate      >= $session.system_date

  //SD Sales Group

  association [0..1] to I_SalesGroup                   as _SalesGroup                 on  $projection.SalesGroup = _SalesGroup.SalesGroup
  //CRM Sales Group

  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_SalesOrganizationUnit        as _SalesGroupOrgUnit          on  $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit.OrgUnitTypeIDConcatenated
                                                                                      and _SalesGroupOrgUnit.StartDate    <= $session.system_date
                                                                                      and _SalesGroupOrgUnit.EndDate      >= $session.system_date

  //CRM Responsible Sales Org.

  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_SalesOrganizationUnit        as _ResponsibleSalesOrg        on  $projection.ResponsibleSalesOrganization = _ResponsibleSalesOrg.OrgUnitTypeIDConcatenated
                                                                                      and _ResponsibleSalesOrg.StartDate           <= $session.system_date
                                                                                      and _ResponsibleSalesOrg.EndDate             >= $session.system_date
  //Added to correct the CRM Organizational Unit

  association [0..1] to I_SrvcMgmtOrganizationUnit     as _SalesOrganizationOrgUnit_2 on  $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit     as _SalesOfficeOrgUnit_2       on  $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit     as _SalesGroupOrgUnit_2        on  $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit     as _ResponsibleSalesOrg_2      on  $projection.ResponsibleSalesOrganization = _ResponsibleSalesOrg_2.OrgUnitTypeIDConcatenated
  //


  //CRM + SD Distribution Channel and Division

  association [0..1] to I_DistributionChannel          as _DistributionChannel        on  $projection.DistributionChannel = _DistributionChannel.DistributionChannel
  association [0..1] to I_Division                     as _Division                   on  $projection.Division = _Division.Division


  association [0..*] to I_InHouseRepairItem            as _InHouseRepairItem          on  $projection.CustMgmtObjectType = _InHouseRepairItem.CustMgmtObjectType
                                                                                      and $projection.InHouseRepair      = _InHouseRepairItem.InHouseRepair

  association [0..*] to I_InhRepairTransactionRelation as _RepairOrders               on  $projection.InHouseRepairUUID               = _RepairOrders.CustMgmtPrdcssrTransactionUUID
                                                                                      and _RepairOrders.CustMgmtTransacRelationType   = 'IHR1'
                                                                                      and _RepairOrders.CustMgmtPrdcssrTransacObjType = 'BUS2000256' //In-House Repair


  association [0..*] to I_InhRepairTransactionRelation as _RepairQuotation            on  $projection.InHouseRepairUUID                  = _RepairQuotation.CustMgmtPrdcssrTransactionUUID
                                                                                      and _RepairQuotation.CustMgmtTransacRelationType   = 'IHR2'
                                                                                      and _RepairQuotation.CustMgmtPrdcssrTransacObjType = 'BUS2000256' //In-House Repair


  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_SrvcMgmtObjectStatus         as _SrvcMgmtObjectStatus       on  $projection.InHouseRepairUUID                        = _SrvcMgmtObjectStatus.SrvcMgmtObjectUUID

                                                                                      and _SrvcMgmtObjectStatus.SrvcMgmtObjectStatusIsInactive = ''
                                                                                      and (
                                                                                         _SrvcMgmtObjectStatus.SrvcMgmtObjectStatus            = 'I1002'
                                                                                         or _SrvcMgmtObjectStatus.SrvcMgmtObjectStatus         = 'I1003'
                                                                                         or _SrvcMgmtObjectStatus.SrvcMgmtObjectStatus         = 'I1005'
                                                                                       )

  //text associations are no longer used in our projection views. therefore, we want to remove them.

  //but this association is still used in C1 released view ESH_N_INHOUSEREPAIR for our enterprise search modell

  //therefore, removal is not possible

  association [0..*] to I_InhRepairStatusText          as _InhRepairStatusText        on  $projection.InhRepairStatus = _InhRepairStatusText.InhRepairStatus

  //Return Order Changes

  association [0..1] to I_InhRepairTransactionRelation as _PredecessorCustomerReturn  on  $projection.InHouseRepairUUID                            = _PredecessorCustomerReturn.CustMgmtSuccssrTransactionUUID
                                                                                      and _PredecessorCustomerReturn.CustMgmtTransacRelationType   = 'VONA'
                                                                                      and _PredecessorCustomerReturn.CustMgmtPrdcssrTransacObjType = 'BUS2102'
{
      @ObjectModel.foreignKey.association: '_CustMgmtObjectType'
  key objtype_h                                                                as CustMgmtObjectType,
  key cast(object_id as crms4_repa_inhouse_repair_lbl preserving type )        as InHouseRepair,
      header_guid                                                              as InHouseRepairUUID,

      cast(header_guid_char as crms4_repa_object_guid32 preserving type)       as InHouseRepairCharUUID, //TODO: NOTES - Remove


      @ObjectModel.foreignKey.association: '_InhRepairType'
      process_type                                                             as InhRepairType,

      cast(posting_date as crms4_repa_created_on_lbl preserving type )         as PostingDate,

      created_at_h                                                             as CreationDateTime,
      created_by_h                                                             as CreatedByUser,
      changed_at_h                                                             as LastChangeDateTime,
      changed_by_h                                                             as LastChangedByUser,

      @ObjectModel.foreignKey.association: '_InhRepairStatus'
      cast(stat_lifecycle as crms4_repa_status_lbl preserving type )           as InhRepairStatus,

      @Semantics.booleanIndicator: true
      @ObjectModel.foreignKey.association: '_InhRepairHasError'
      stat_error                                                               as InhRepairHasError,
      @Semantics.booleanIndicator: true
      @ObjectModel.foreignKey.association: '_InhRepairIsOpen'
      stat_open                                                                as InhRepairIsOpen,

      @ObjectModel.foreignKey.association: '_SoldToParty'
      sold_to_party                                                            as SoldToParty,
      @ObjectModel.foreignKey.association: '_ContactPerson'
      cast(contact_person as crms4_repa_contact_lbl preserving type )          as ContactPerson,
      @ObjectModel.foreignKey.association: '_ShipToParty'
      ship_to_party                                                            as ShipToParty,
      @ObjectModel.foreignKey.association: '_ResponsibleEmployee'
      cast( person_resp as crms4_repa_resp_employee_lbl preserving type )      as ResponsibleEmployee,

      //SD Sales Org. fields

      @ObjectModel.foreignKey.association: '_SalesOrganization'
      sales_org_sd                                                             as SalesOrganization,
      @ObjectModel.foreignKey.association: '_SalesOffice'
      sales_office_sd                                                          as SalesOffice,
      @ObjectModel.foreignKey.association: '_SalesGroup'
      sales_group_sd                                                           as SalesGroup,

      //CRM Sales Org. fields

      //foreignKey definition not possible because primary key OrganizationalUnit of target view is not defined in association >> ATC error

      //@ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit'

      cast( sales_org as crms4_repa_sales_org_naid_lbl2 preserving type )      as SalesOrganizationOrgUnitID,
      //foreignKey definition not possible because primary key OrganizationalUnit of target view is not defined in association >> ATC error

      //@ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit'

      sales_office                                                             as SalesOfficeOrgUnitID,
      //foreignKey definition not possible because primary key OrganizationalUnit of target view is not defined in association >> ATC error

      //@ObjectModel.foreignKey.association: '_SalesGroupOrgUnit'

      sales_group                                                              as SalesGroupOrgUnitID,
      //foreignKey definition not possible because primary key OrganizationalUnit of target view is not defined in association >> ATC error

      //@ObjectModel.foreignKey.association: '_ResponsibleSalesOrg'

      cast( sales_org_resp as crms4_repa_sales_org_un_id_lbl preserving type ) as ResponsibleSalesOrganization,

      //Distr. Channel and Division are same for CRM + SD Org.

      @ObjectModel.foreignKey.association: '_DistributionChannel'
      dis_channel                                                              as DistributionChannel,
      @ObjectModel.foreignKey.association: '_Division'
      division                                                                 as Division,
      ref_return_order                                                         as ReferenceCustomerReturn,
      ref_msr_id                                                               as RefRetsMgmtProcess,

      /* Associations */
      _CustMgmtObjectType,
      _InhRepairType,
      _InhRepairStatus,
      _InhRepairHasError,
      _InhRepairIsOpen,
      _SrvcMgmtObjectStatus,
      _SoldToParty,
      _ContactPerson,
      _ShipToParty,
      _ResponsibleEmployee,

      _SalesOrganization, //SD Sales Org.

      _SalesOffice, //SD Sales Office

      _SalesGroup, //SD Sales Group


      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesOrganizationOrgUnit_2'
      _SalesOrganizationOrgUnit, //CRM Sales Org.

      _SalesOrganizationOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesOfficeOrgUnit_2'
      _SalesOfficeOrgUnit, //CRM Sales Office

      _SalesOfficeOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesGroupOrgUnit_2'
      _SalesGroupOrgUnit, //CRM Sales Group

      _SalesGroupOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ResponsibleSalesOrg_2'
      _ResponsibleSalesOrg, //CRM Responsible Sales Org.

      _ResponsibleSalesOrg_2,

      _DistributionChannel,
      _Division,

      _InHouseRepairItem,
      _RepairOrders,
      _RepairQuotation,

      //text associations are no longer used in our projection views. therefore, we want to remove them.

      //but this association is still used in C1 released view ESH_N_INHOUSEREPAIR for our enterprise search modell

      //therefore, removal is not possible

      _InhRepairStatusText,

      //Return Order Changes

      _PredecessorCustomerReturn
}