I_InHouseRepairTP

DDL: I_INHOUSEREPAIRTP Type: view_entity TRANSACTIONAL

In-House Repair

I_InHouseRepairTP is a Transactional CDS View that provides data about "In-House Repair" in SAP S/4HANA. It reads from 1 data source (I_InHouseRepair) and exposes 57 fields with key field InHouseRepair. It has 6 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_InHouseRepair ihr from

Associations (6)

CardinalityTargetAliasCondition
[0..1] I_SitnInstceIndicator _SitnInstceIndicator _SitnInstceIndicator.SitnInstceAnchorObjectKey = $projection.InHouseRepair and _SitnInstceIndicator.SitnDefAnchorObject = 'InHouseRepair'
[0..1] I_CustMgmtExtRefID _InhRepairExtReference _InhRepairExtReference.CustMgmtObjectType = 'BUS2000256' and $projection.InHouseRepair = _InhRepairExtReference.CustMgmtDocument and _InhRepairExtReference.CustMgmtExtRefIDType = '0016'
[1..1] E_InHouseRepair _Extension _Extension.CustMgmtObjectType = 'BUS2000256' and $projection.InHouseRepair = _Extension.InHouseRepair
[0..*] I_InHouseRepairItemTP _InHouseRepairItemTP
[0..*] R_InhRepairNoteTP _InhRepairNoteTP
[0..*] R_InhRepairFUPCustReturnTP _InhRepairFUPCustReturnTP

Annotations (10)

NameValueLevelField
EndUserText.label In-House Repair view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.authorizationCheck #CHECK view
ObjectModel.representativeKey InHouseRepair view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.sapObjectNodeType.name InHouseRepair view
Metadata.ignorePropagatedAnnotations true view

Fields (57)

KeyFieldSource TableSource FieldDescription
KEY InHouseRepair InHouseRepair
InHouseRepairUUID InHouseRepairUUID
InhRepairType InhRepairType
PostingDate PostingDate
CreationDateTime CreationDateTime
CreatedByUser CreatedByUser
LastChangeDateTime LastChangeDateTime
LastChangedByUser LastChangedByUser
InhRepairStatus InhRepairStatus
InhRepairHasError InhRepairHasError
InhRepairIsOpen InhRepairIsOpen
SoldToParty SoldToParty
ContactPerson ContactPerson
ShipToParty ShipToParty
ResponsibleEmployee ResponsibleEmployee
SalesOrganization SalesOrganization
SalesOffice SalesOffice
SalesGroup SalesGroup
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID SalesOfficeOrgUnitID
SalesGroupOrgUnitID SalesGroupOrgUnitID
ResponsibleSalesOrganization ResponsibleSalesOrganization
DistributionChannel DistributionChannel
Division Division
InhRepairExtReference
ReferenceCustomerReturn ReferenceCustomerReturn
RefRetsMgmtProcess RefRetsMgmtProcess
_InHouseRepairItemTP _InHouseRepairItemTP
_InhRepairNoteTP _InhRepairNoteTP
_InhRepairType _InhRepairType
_InhRepairStatus _InhRepairStatus
_InhRepairHasError _InhRepairHasError
_InhRepairIsOpen _InhRepairIsOpen
_SrvcMgmtObjectStatus _SrvcMgmtObjectStatus
_SoldToParty _SoldToParty
_ContactPerson _ContactPerson
_ShipToParty _ShipToParty
_ResponsibleEmployee _ResponsibleEmployee
_SalesOrganization _SalesOrganization
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit _SalesOfficeOrgUnit
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit _SalesGroupOrgUnit
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2
_ResponsibleSalesOrg _ResponsibleSalesOrg
_ResponsibleSalesOrg_2 _ResponsibleSalesOrg_2
_DistributionChannel _DistributionChannel
_Division _Division
_RepairOrders _RepairOrders
_RepairQuotation _RepairQuotation
_SitnInstceIndicator _SitnInstceIndicator
_InhRepairStatusText _InhRepairStatusText
_PredecessorCustomerReturn _PredecessorCustomerReturn
_InhRepairFUPCustReturnTP _InhRepairFUPCustReturnTP
@EndUserText.label: 'In-House Repair'
@VDM: {
  viewType: #TRANSACTIONAL,
  lifecycle.contract.type: #SAP_INTERNAL_API
}
@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #('TRANSACTIONAL_DATA'),
  privilegedAssociations: ['_RepairOrders', '_RepairQuotation']
}
@ObjectModel: {
  // this will make the title column bold in smart templates

  // and description and ID are displayed in two lines when using annotation @ObjectModel.text.element

  semanticKey: ['InHouseRepair'],
  representativeKey: 'InHouseRepair',
  usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL},
  sapObjectNodeType.name: 'InHouseRepair'
}
@Metadata: {
  ignorePropagatedAnnotations: true
}


/*+[hideWarning] { "IDS" : [ "CALCULATED_FIELD_CHECK" ] }*/
define root view entity I_InHouseRepairTP
  as select from I_InHouseRepair as ihr
  composition [0..*] of I_InHouseRepairItemTP as _InHouseRepairItemTP
  composition [0..*] of R_InhRepairNoteTP     as _InhRepairNoteTP
  composition [0..*] of R_InhRepairFUPCustReturnTP as _InhRepairFUPCustReturnTP

  association [0..1] to I_SitnInstceIndicator as _SitnInstceIndicator   on  _SitnInstceIndicator.SitnInstceAnchorObjectKey = $projection.InHouseRepair
                                                                        and _SitnInstceIndicator.SitnDefAnchorObject       = 'InHouseRepair'

  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
  association [0..1] to I_CustMgmtExtRefID    as _InhRepairExtReference on  _InhRepairExtReference.CustMgmtObjectType   = 'BUS2000256'
                                                                        and $projection.InHouseRepair                   = _InhRepairExtReference.CustMgmtDocument
                                                                        and _InhRepairExtReference.CustMgmtExtRefIDType = '0016'

  association [1..1] to E_InHouseRepair       as _Extension             on  _Extension.CustMgmtObjectType = 'BUS2000256'
                                                                        and $projection.InHouseRepair     = _Extension.InHouseRepair

{
  key InHouseRepair,
      InHouseRepairUUID,
      @ObjectModel.foreignKey.association:'_InhRepairType'
      InhRepairType, //Transaction Type (Header), e.g. REP1

      PostingDate,
      CreationDateTime,
      CreatedByUser,
      LastChangeDateTime,
      LastChangedByUser,

      @ObjectModel.foreignKey.association: '_InhRepairStatus'
      InhRepairStatus,

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

      @ObjectModel.foreignKey.association: '_SoldToParty'
      SoldToParty,
      @ObjectModel.foreignKey.association: '_ContactPerson'
      ContactPerson,

      @ObjectModel.foreignKey.association: '_ShipToParty'
      ShipToParty,
      @ObjectModel.foreignKey.association: '_ResponsibleEmployee'
      ResponsibleEmployee,

      // SD Sales Org. fields

      @ObjectModel.foreignKey.association: '_SalesOrganization'
      SalesOrganization,
      @ObjectModel.foreignKey.association: '_SalesOffice'
      SalesOffice,
      @ObjectModel.foreignKey.association: '_SalesGroup'
      SalesGroup,

      //CRM Sales Org. fields

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

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

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

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

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

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

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

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

      ResponsibleSalesOrganization,

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

      @ObjectModel.foreignKey.association: '_DistributionChannel'
      DistributionChannel,
      @ObjectModel.foreignKey.association: '_Division'
      Division,

      cast (_InhRepairExtReference.CustMgmtExtRefID as crms4_repa_ext_trans_num_lbl preserving type) as InhRepairExtReference,

      //Status used for front end level 0 changes based on system status

      //We deliberatley have no else clause, because of better performance. This leads to a null value which is published as false by odata.

      @Semantics.booleanIndicator: true
      case _SrvcMgmtObjectStatus.SrvcMgmtObjectStatus
        when 'I1002'  then cast( 'X' as crms4_repa_stat_new preserving type ) end                    as InhRepairIsNew,

      //Status used for front end level 0 changes based on system status

      //We deliberatley have no else clause, because of better performance. This leads to a null value which is published as false by odata.

      @Semantics.booleanIndicator: true
      case _SrvcMgmtObjectStatus.SrvcMgmtObjectStatus
        when 'I1003' then cast( 'X' as crms4_repa_stat_inprocess preserving type ) end               as InhRepairIsInProcess,

      //Status used for front end level 0 changes based on system status

      //There are two options of calculating the completed status:

      //1.  You join with the status table and check for status “I1005”

      //2.  You negate the status “Is Open”, because this is the exact opposite of completed

      //We decided for the second approach because it does not need a join and therefore has better performance.


      //We deliberatley have no else clause, because of better performance. This leads to a null value which is published as false by odata.

      @Semantics.booleanIndicator: true
      case ihr.InhRepairIsOpen
       when '' then cast( 'X'  as crms4_repa_stat_completed preserving type ) end                    as InhRepairIsCompleted,
       ReferenceCustomerReturn,
       RefRetsMgmtProcess,

      /* Associations */
      _InHouseRepairItemTP,
      _InhRepairNoteTP,
      _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,
      _RepairOrders,
      _RepairQuotation,
      _SitnInstceIndicator,      
      
      //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,
      
      _InhRepairFUPCustReturnTP
}
where
  ihr.CustMgmtObjectType = 'BUS2000256'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTMGMTEXTREFID",
"I_INHOUSEREPAIR",
"I_SRVCMGMTOBJECTSTATUS"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_INHOUSEREPAIRITEMTP",
"I_INHREPAIRSTATUS",
"I_INHREPAIRSTATUSTEXT",
"I_INHREPAIRTRANSACTIONRELATION",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONUNIT",
"I_SERVICEDOCERRORSTATUS",
"I_SERVICEDOCOPENSTATUS",
"I_SERVICEDOCUMENTTYPE",
"I_SITNINSTCEINDICATOR",
"I_SRVCMGMTOBJECTSTATUS",
"I_SRVCMGMTORGANIZATIONUNIT",
"R_INHREPAIRFUPCUSTRETURNTP",
"R_INHREPAIRNOTETP"
],
"BASE":
[
"I_INHOUSEREPAIR"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/