@AbapCatalog.sqlViewName: 'IREINTOBJCCOASS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
//@ObjectModel.representativeKey: 'InternalRealEstateNumber'
@ObjectModel.semanticKey: ['InternalRealEstateNumber']
@VDM.viewType: #COMPOSITE
@ObjectModel.supportedCapabilities: [ #CDS_MODELING_ASSOCIATION_TARGET,
#SQL_DATA_SOURCE,
#CDS_MODELING_DATA_SOURCE]
@Metadata.ignorePropagatedAnnotations: true
@Analytics:{
dataExtraction: {
enabled: true
}
}
//@Search.searchable: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey:true
@EndUserText.label: 'Real Estate IO Controlling Object Assgmt'
define view I_REIntegObjectCtrlgObjAssgmt
as select from I_REObjectAssgmt as _REObjectAssignment
// association [0..*] to I_REObjectAssgmt as _REObjectAssignment on $projection.REStatusObject = _REObjectAssignment.REStatusObjectSource
association [1..1] to I_REIntegrationObjectBasicData as _REIntegrationObject on _REObjectAssignment.REStatusObjectSource = _REIntegrationObject.REStatusObject
association [1..1] to I_REIntegrationObjectBasicData as _REParentIntegrationObject on $projection.reparentintegobjectexternalid = _REParentIntegrationObject.RealEstateExternalID
// association [1..1] to I_CompanyCode as _CompanyCode on _REIntegrationObject.CompanyCode = _CompanyCode.CompanyCode
// association [1..1] to I_REIntegrationObjectBasicData as _REParentIntegrationObject on _REObjectAssignment._REIntegrationObject._REParentIntegrationObject.InternalRealEstateNumber = _REParentIntegrationObject.InternalRealEstateNumber
association [0..1] to I_CostCenter as _CostCenter on $projection.REAccountingObject = _CostCenter.ObjectInternalID
// and $projection.REObjectTypeTarget = 'KS'
and(
$projection.ValidityStartDate <= _CostCenter.ValidityEndDate
or $projection.ValidityEndDate >= _CostCenter.ValidityStartDate
)
association [0..1] to I_WBSElementBasicData as _WBSElement on $projection.REAccountingObject = _WBSElement.WBSElementObject
// and $projection.REObjectTypeTarget = 'PR'
association [0..1] to I_InternalOrder as _InternalOrder on $projection.REAccountingObject = _InternalOrder.ControllingObject
// and $projection.REObjectTypeTarget = 'OR'
{
// key _REIntegrationObject.InternalRealEstateNumber,
key _REIntegrationObject._REParentIntegrationObject.InternalRealEstateNumber,
key _REObjectAssignment.REStatusObjectTarget as REAccountingObject,
key _REObjectAssignment.ValidityStartDate as ValidityStartDate,
_REObjectAssignment.ValidityEndDate as ValidityEndDate,
//Source = Usage Enablement Group
// _REObjectAssignment.REStatusObjectSource,
// @ObjectModel.foreignKey.association: '_CompanyCode'
_REIntegrationObject.CompanyCode,
_REObjectAssignment.REOnlyInfoAssgmt,
_REObjectAssignment.REIsLeadingObject,
// _REIntegrationObject.REIntegrationObjectNumber,
// _REIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber as REIntegrationObjectNumberLvl2,
// _REIntegrationObject._REParentIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber as REIntegrationObjectNumberLvl1,
// _REIntegrationObject.REIntegrationObjectNumber as REUseEnableObjectNumber,
// _REIntegrationObject.REIntegObjSpaceGroupType as REIntegObjSpaceGroupType,
// _REIntegrationObject.REIntegrationObjectName as REIntegObjectForUseEnableName,
_REIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber as REIntegrationObjectNumberBldng,
_REIntegrationObject._REParentIntegrationObject.REIntegrationObjectName as REIntegObjectBuildingName,
_REIntegrationObject._REParentIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber as REIntegrationObjectNumberSite,
_REIntegrationObject._REParentIntegrationObject._REParentIntegrationObject.REIntegrationObjectName as REIntegObjectSiteName,
//Do not delete
_REIntegrationObject.REParentIntegObjectExternalID,
_CostCenter.ControllingArea,
_CostCenter.CostCenter,
_WBSElement.WBSElementExternalID,
_InternalOrder.InternalOrder,
// _REIntegrationObject._REParentIntegrationObject as _REParentIntegrationObject,
_REParentIntegrationObject,
_REObjectTypeDetails,
_CostCenter,
_WBSElement,
_InternalOrder
}
where
REObjectAssignmentType = 'IO'
and REStatusObjectSource like 'J5%'
and(
_REIntegrationObject.REIntegObjSpaceGroupType = 'EE01' //External Usage Enablement Group
or _REIntegrationObject.REIntegObjSpaceGroupType = 'IC01' //Intercompany Group
)
group by
_REIntegrationObject._REParentIntegrationObject.InternalRealEstateNumber,
_REObjectAssignment.REStatusObjectTarget,
_REObjectAssignment.ValidityStartDate,
_REObjectAssignment.ValidityEndDate,
_REIntegrationObject.CompanyCode,
_REObjectAssignment.REOnlyInfoAssgmt,
_REObjectAssignment.REIsLeadingObject,
_REIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber,
_REIntegrationObject._REParentIntegrationObject.REIntegrationObjectName,
_REIntegrationObject._REParentIntegrationObject._REParentIntegrationObject.REIntegrationObjectNumber,
_REIntegrationObject._REParentIntegrationObject._REParentIntegrationObject.REIntegrationObjectName,
_CostCenter.ControllingArea,
_CostCenter.CostCenter,
_WBSElement.WBSElementExternalID,
_InternalOrder.InternalOrder,
_REIntegrationObject.REParentIntegObjectExternalID