@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":""
}
}*/