@AbapCatalog.sqlViewName: 'IFEPOSEXTRELUNIN'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Interface View of FE To Pos Ext Relshp With Union'
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@ObjectModel:{
usageType:{
dataClass: #TRANSACTIONAL,
serviceQuality: #C,
sizeCategory: #L
}
}
define view I_FrcElmntToPosExtRelshpUnion
as select from I_DFS_ObjExternalRelationship as FrcElmntToPosExtRelshpUnion
left outer join I_FrcElmntToPosExtRelshpDrft as FrcElmntToPosExtRelshpDrft on FrcElmntToPosExtRelshpUnion.DfsObjectID = FrcElmntToPosExtRelshpDrft.DfsObjectID
and FrcElmntToPosExtRelshpUnion.DfsObjectRelatedObjectID = FrcElmntToPosExtRelshpDrft.DfsObjectRelatedObjectID
{
key FrcElmntToPosExtRelshpUnion.DfsObjectID as DfsPositionID,
key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x preserving type ) as DfsObjectDraftUUID,
'1' as DfsAssgmtActiveDraft,
FrcElmntToPosExtRelshpUnion.DfsObjectPlanVersion,
FrcElmntToPosExtRelshpUnion.DfsObjectPlngStatus,
FrcElmntToPosExtRelshpUnion.DfsObjectValdtyStartDate,
FrcElmntToPosExtRelshpUnion.DfsObjectValdtyEndDate,
FrcElmntToPosExtRelshpUnion.DfsObjectType,
case FrcElmntToPosExtRelshpUnion.DfsObjectPlngStatus
when '1' then 3 when '5' then 1 else 2 end as FrcElmntOrgPlngStsCritlty,
FrcElmntToPosExtRelshpUnion.DfsObjectSubType,
FrcElmntToPosExtRelshpUnion.DfsObjectConcatenatedID,
FrcElmntToPosExtRelshpUnion.DfsObjectInfoType,
FrcElmntToPosExtRelshpUnion.DfsObjectRelatedObjectType,
FrcElmntToPosExtRelshpUnion.DfsObjectRelatedObjectID,
FrcElmntToPosExtRelshpUnion.DfsObjectRelshpPriority,
// Active & Draft Handling
cast( 'X' as boole_d preserving type ) as IsActiveEntity,
cast( ' ' as boole_d preserving type ) as HasActiveEntity,
case
// when( DraftDocument.DfsAssgmtUUID is null ) then cast( ' ' as boole_d preserving type )
when( FrcElmntToPosExtRelshpDrft.DfsObjectDraftUUID is null ) then cast( ' ' as boole_d preserving type )
else cast( 'X' as boole_d preserving type )
end as HasDraftEntity,
3 as Criticality
}
union all select from I_FrcElmntToPosExtRelshpDrft as FrcElmntToPosExtRelshpDrft
inner join I_DraftAdministrativeData on I_DraftAdministrativeData.DraftUUID = FrcElmntToPosExtRelshpDrft.DfsObjectDraftUUID
{
FrcElmntToPosExtRelshpDrft.DfsObjectID as DfsPositionID,
FrcElmntToPosExtRelshpDrft.DfsObjectDraftUUID,
case
// Locked by somebody else
when(I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ') then '2' //2 = Locked
// Locked by somebody else
when (I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ') then '2'
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then '3' //3 = Draft
when (I_DraftAdministrativeData.DraftIsProcessedByMe = ' ' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then '3'
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ' ) then '3'
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ' ) then '3'
when (I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then '4' //4 = Draft by Other
else '0'
end as DfsAssgmtActiveDraft,
FrcElmntToPosExtRelshpDrft.DfsObjectPlanVersion,
FrcElmntToPosExtRelshpDrft.DfsObjectPlngStatus,
FrcElmntToPosExtRelshpDrft.DfsPositionValdtyStartDate as DfsObjectValdtyStartDate,
FrcElmntToPosExtRelshpDrft.DfsPositionValdtyEndDate as DfsObjectValdtyEndDate,
FrcElmntToPosExtRelshpDrft.DfsObjectType,
case FrcElmntToPosExtRelshpDrft.DfsObjectPlngStatus
when '1' then 3 when '5' then 1 else 2 end as FrcElmntOrgPlngStsCritlty,
FrcElmntToPosExtRelshpDrft.DfsObjectSubType,
FrcElmntToPosExtRelshpDrft.DfsObjectConcatenatedID,
FrcElmntToPosExtRelshpDrft.DfsObjectInfoType,
FrcElmntToPosExtRelshpDrft.DfsObjectRelatedObjectType,
FrcElmntToPosExtRelshpDrft.DfsObjectRelatedObjectID,
FrcElmntToPosExtRelshpDrft.DfsObjectRelshpPriority,
cast( ' ' as boole_d preserving type ) as IsActiveEntity,
FrcElmntToPosExtRelshpDrft.HasActiveEntity,
cast( ' ' as boole_d preserving type) as HasDraftEntity,
case
// Locked by somebody else
when(I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ') then 1 //2 = Locked
// Locked by somebody else
when (I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ') then 1
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then 2 //3 = Draft
when (I_DraftAdministrativeData.DraftIsProcessedByMe = ' ' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then 2
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ' ) then 2
when (I_DraftAdministrativeData.DraftIsProcessedByMe = 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe = 'X' and
I_DraftAdministrativeData.InProcessByUser <> ' ' ) then 2
when (I_DraftAdministrativeData.DraftIsProcessedByMe <> 'X' and
I_DraftAdministrativeData.DraftIsCreatedByMe <> 'X' and
I_DraftAdministrativeData.InProcessByUser = ' ' ) then 1 //4 = Draft by Other
else 0
end as Criticality
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DFS_OBJEXTERNALRELATIONSHIP",
"I_DRAFTADMINISTRATIVEDATA",
"I_FRCELMNTTOPOSEXTRELSHPDRFT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/