@AbapCatalog.sqlViewName: 'IBPPROCRECKPITYP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'MD Chg Proc Record Type KPI of a Record'
@ObjectModel : {
usageType : {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #M
}
}
@VDM.viewType: #TRANSACTIONAL
define view I_BPProcessKPIRecordType
// New Single Record
as select from I_MDChgProcessStep as Step
join I_MasterDataChangeProcess as Process on Step.MasterDataChangeProcess = Process.MasterDataChangeProcess
left outer to many join I_BusinessPartnerProcess as BusinessPartner on BusinessPartner.MasterDataChangeProcess = Step.MasterDataChangeProcess
and BusinessPartner.MDChgProcessStep = Step.MDChgProcessStep
left outer to many join I_MDChgProcessMatchGroupRecord as MatchGroup on BusinessPartner.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and BusinessPartner.MDChgProcessSrceSystem = MatchGroup.MDChgProcessSrceSystem
and BusinessPartner.MDChgProcessSrceObject = MatchGroup.MDChgProcessSrceObject
association [0..1] to P_MDChgProcessOpenMatchGroup as _OpenMatchGroup on _OpenMatchGroup.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and _OpenMatchGroup.MDChgProcessMatchGroupID = MatchGroup.MDChgProcessMatchGroupID
association [0..1] to I_MDChgProcKPIFilterRecordType as _KPIRecordTypeText on $projection.MDChgProcKPIRecordType = _KPIRecordTypeText.MDChangeProcKPIValueKey
association [0..1] to I_MDChgProcessStep as _MTCStep on $projection.MasterDataChangeProcess = _MTCStep.MasterDataChangeProcess
and _MTCStep.MDChgProcessStepType = 'MTC'
and (
_MTCStep.MDChgProcessSrceObjectTypeCode = '147'
or _MTCStep.MDChgProcessSrceObjectTypeCode = '986'
)
{
key BusinessPartner.MasterDataChangeProcess,
key BusinessPartner.MDChgProcessStep,
key BusinessPartner.MDChgProcessSrceSystem,
key BusinessPartner.MDChgProcessSrceObject,
cast ('S' as mdc_kpi_filter_val ) as MDChgProcKPIRecordType,
@ObjectModel.text.element: ['_KpiRecordTypeText.MDChangeProcKPIValueKeyDesc']
_KPIRecordTypeText
}
where
Process.MDChgProcessGoal <> 'U'
and Process.MDChgProcessGoal <> 'B'
and Process.MDChgProcessGoal <> 'R'
and Process.MDChgProcessGoal <> 'D'
and Process.MDChgProcessGoal <> 'E'
and(
Step.MDChgProcessStepType = 'VAL'
or Step.MDChgProcessStepType = 'BRC'
)
and(
MatchGroup.MDChgProcessMatchGroupID is null
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'D'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = ''
or _OpenMatchGroup.MDChgProcessMatchGroupID is not null
or Step.MDChgProcessStep < _MTCStep.MDChgProcessStep
)
// Update
union select from I_MDChgProcessStep as Step
join I_MasterDataChangeProcess as Process on Step.MasterDataChangeProcess = Process.MasterDataChangeProcess
left outer to many join I_BusinessPartnerProcess as BusinessPartner on BusinessPartner.MasterDataChangeProcess = Step.MasterDataChangeProcess
and BusinessPartner.MDChgProcessStep = Step.MDChgProcessStep
join mdc_own_bus_sys as OwnBusSystem on BusinessPartner.MDChgProcessSrceSystem = OwnBusSystem.own_business_system
join I_MDChgProcessMatchGroupRecord as MatchGroup on BusinessPartner.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and BusinessPartner.MDChgProcessSrceSystem = MatchGroup.MDChgProcessSrceSystem
and BusinessPartner.MDChgProcessSrceObject = MatchGroup.MDChgProcessSrceObject
association [0..1] to I_MDChgProcKPIFilterRecordType as _KpiRecordTypeText on $projection.MDChgProcKPIRecordType = _KpiRecordTypeText.MDChangeProcKPIValueKey
{
key BusinessPartner.MasterDataChangeProcess,
key BusinessPartner.MDChgProcessStep,
key BusinessPartner.MDChgProcessSrceSystem,
key BusinessPartner.MDChgProcessSrceObject,
cast ('U' as mdc_kpi_filter_val ) as MDChgProcKPIRecordType,
@ObjectModel.text.element: ['_KPIRecordTypeText.MDChangeProcKPIValueKeyDesc']
_KpiRecordTypeText
}
where
(
Step.MDChgProcessStepType = 'VAL'
or Step.MDChgProcessStepType = 'BRC'
)
and MatchGroup.MDChgProcMatchGrpIsBestRecord = 'X'
and(
MatchGroup.MDChgProcMatchGrpApprvlStatus = 'A'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'M'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'U'
)
// Update
union select from I_MDChgProcessStep as Step
join I_MasterDataChangeProcess as Process on Step.MasterDataChangeProcess = Process.MasterDataChangeProcess
left outer to many join I_BusinessPartnerProcess as BusinessPartner on BusinessPartner.MasterDataChangeProcess = Step.MasterDataChangeProcess
and BusinessPartner.MDChgProcessStep = Step.MDChgProcessStep
join mdc_own_bus_sys as OwnBusSystem on BusinessPartner.MDChgProcessSrceSystem = OwnBusSystem.own_business_system
join I_MDChgProcessMatchGroupRecord as MatchGroup on BusinessPartner.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and BusinessPartner.MDChgProcessSrceSystem = MatchGroup.MDChgProcessSrceSystem
and BusinessPartner.MDChgProcessSrceObject = MatchGroup.MDChgProcessSrceObject
association [0..1] to I_MDChgProcKPIFilterRecordType as _KPIRecordTypeText on $projection.MDChgProcKPIRecordType = _KPIRecordTypeText.MDChangeProcKPIValueKey
{
key BusinessPartner.MasterDataChangeProcess,
key BusinessPartner.MDChgProcessStep,
key BusinessPartner.MDChgProcessSrceSystem,
key BusinessPartner.MDChgProcessSrceObject,
cast ('U' as mdc_kpi_filter_val ) as MDChgProcKPIRecordType,
@ObjectModel.text.element: ['_KPIRecordTypeText.MDChangeProcKPIValueKeyDesc']
_KPIRecordTypeText
}
where
(
Step.MDChgProcessStepType = 'VAL'
or Step.MDChgProcessStepType = 'BRC'
)
and MatchGroup.MDChgProcMatchGrpIsBestRecord = 'X'
and(
MatchGroup.MDChgProcMatchGrpApprvlStatus = 'A'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'M'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'U'
)
// Update without MTC
union select from I_MDChgProcessStep as Step
join I_MasterDataChangeProcess as Process on Step.MasterDataChangeProcess = Process.MasterDataChangeProcess
left outer to many join I_BusinessPartnerProcess as BusinessPartner on BusinessPartner.MasterDataChangeProcess = Step.MasterDataChangeProcess
and BusinessPartner.MDChgProcessStep = Step.MDChgProcessStep
join mdc_own_bus_sys as OwnBusSystem on BusinessPartner.MDChgProcessSrceSystem = OwnBusSystem.own_business_system
association [0..1] to I_MDChgProcKPIFilterRecordType as _KPIRecordTypeText on $projection.MDChgProcKPIRecordType = _KPIRecordTypeText.MDChangeProcKPIValueKey
{
key BusinessPartner.MasterDataChangeProcess,
key BusinessPartner.MDChgProcessStep,
key BusinessPartner.MDChgProcessSrceSystem,
key BusinessPartner.MDChgProcessSrceObject,
cast ('U' as mdc_kpi_filter_val ) as MDChgProcKPIRecordType,
@ObjectModel.text.element: ['_KPIRecordTypeText.MDChangeProcKPIValueKeyDesc']
_KPIRecordTypeText
}
where
Process.MDChgProcessGoal = 'U'
or Process.MDChgProcessGoal = 'B'
or Process.MDChgProcessGoal = 'R'
or Process.MDChgProcessGoal = 'D'
or Process.MDChgProcessGoal = 'E'
and(
Step.MDChgProcessStepType = 'VAL'
or Step.MDChgProcessStepType = 'BRC'
)
// New Best Record
union select from I_MDChgProcessStep as Step
join I_MasterDataChangeProcess as Process on Step.MasterDataChangeProcess = Process.MasterDataChangeProcess
left outer to many join I_BusinessPartnerProcess as BusinessPartner on BusinessPartner.MasterDataChangeProcess = Step.MasterDataChangeProcess
and BusinessPartner.MDChgProcessStep = Step.MDChgProcessStep
join mdc_own_bus_sys as OwnBusSystem on BusinessPartner.MDChgProcessSrceSystem <> OwnBusSystem.own_business_system
join I_MDChgProcessMatchGroupRecord as MatchGroup on BusinessPartner.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and BusinessPartner.MDChgProcessSrceSystem = MatchGroup.MDChgProcessSrceSystem
and BusinessPartner.MDChgProcessSrceObject = MatchGroup.MDChgProcessSrceObject
association [0..1] to P_MDChgProcessOpenMatchGroup as _OpenMatchGroup on _OpenMatchGroup.MasterDataChangeProcess = MatchGroup.MasterDataChangeProcess
and _OpenMatchGroup.MDChgProcessMatchGroupID = MatchGroup.MDChgProcessMatchGroupID
association [0..1] to I_MDChgProcKPIFilterRecordType as _KPIRecordTypeText on $projection.MDChgProcKPIRecordType = _KPIRecordTypeText.MDChangeProcKPIValueKey
{
key BusinessPartner.MasterDataChangeProcess,
key BusinessPartner.MDChgProcessStep,
key BusinessPartner.MDChgProcessSrceSystem,
key BusinessPartner.MDChgProcessSrceObject,
cast ('B' as mdc_kpi_filter_val ) as MDChgProcKPIRecordType,
@ObjectModel.text.element: ['_KPIRecordTypeText.MDChangeProcKPIValueKeyDesc']
_KPIRecordTypeText
}
where
(
Step.MDChgProcessStepType = 'VAL'
or Step.MDChgProcessStepType = 'BRC'
)
and MatchGroup.MDChgProcMatchGrpIsBestRecord = 'X'
and _OpenMatchGroup.MDChgProcessMatchGroupID is null
and(
MatchGroup.MDChgProcMatchGrpApprvlStatus = 'A'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'M'
or MatchGroup.MDChgProcMatchGrpApprvlStatus = 'U'
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BUSINESSPARTNERPROCESS",
"I_MASTERDATACHANGEPROCESS",
"I_MDCHGPROCESSMATCHGROUPRECORD",
"I_MDCHGPROCESSSTEP",
"P_MDCHGPROCESSOPENMATCHGROUP",
"MDC_OWN_BUS_SYS"
],
"ASSOCIATED":
[
"I_MDCHGPROCESSSTEP",
"I_MDCHGPROCKPIFILTERRECORDTYPE",
"P_MDCHGPROCESSOPENMATCHGROUP"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/