I_FrcElmntToPosExtRelshpUnion

DDL: I_FRCELMNTTOPOSEXTRELSHPUNION SQL: IFEPOSEXTRELUNIN Type: view COMPOSITE

Interface View of FE To Pos Ext Relshp With Union

I_FrcElmntToPosExtRelshpUnion is a Composite CDS View that provides data about "Interface View of FE To Pos Ext Relshp With Union" in SAP S/4HANA. It reads from 4 data sources (I_FrcElmntToPosExtRelshpDrft, I_FrcElmntToPosExtRelshpDrft, I_DFS_ObjExternalRelationship, I_DraftAdministrativeData) and exposes 30 fields with key fields DfsPositionID, DfsObjectDraftUUID.

Data Sources (4)

SourceAliasJoin Type
I_FrcElmntToPosExtRelshpDrft FrcElmntToPosExtRelshpDrft left_outer
I_FrcElmntToPosExtRelshpDrft FrcElmntToPosExtRelshpDrft union_all
I_DFS_ObjExternalRelationship FrcElmntToPosExtRelshpUnion from
I_DraftAdministrativeData I_DraftAdministrativeData inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName IFEPOSEXTRELUNIN view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Interface View of FE To Pos Ext Relshp With Union view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (30)

KeyFieldSource TableSource FieldDescription
KEY DfsPositionID I_DFS_ObjExternalRelationship DfsObjectID
KEY DfsObjectDraftUUID
DfsAssgmtActiveDraft
DfsObjectPlanVersion I_DFS_ObjExternalRelationship DfsObjectPlanVersion
DfsObjectPlngStatus I_DFS_ObjExternalRelationship DfsObjectPlngStatus
DfsObjectValdtyStartDate I_DFS_ObjExternalRelationship DfsObjectValdtyStartDate
DfsObjectValdtyEndDate I_DFS_ObjExternalRelationship DfsObjectValdtyEndDate
DfsObjectType I_DFS_ObjExternalRelationship DfsObjectType
DfsObjectSubType I_DFS_ObjExternalRelationship DfsObjectSubType
DfsObjectInfoType I_DFS_ObjExternalRelationship DfsObjectInfoType
DfsObjectRelatedObjectType I_DFS_ObjExternalRelationship DfsObjectRelatedObjectType
DfsObjectRelatedObjectID I_DFS_ObjExternalRelationship DfsObjectRelatedObjectID
DfsObjectRelshpPriority I_DFS_ObjExternalRelationship DfsObjectRelshpPriority
IsActiveEntity
HasActiveEntity
DfsObjectIDasDfsPositionID
DfsObjectDraftUUID I_FrcElmntToPosExtRelshpDrft DfsObjectDraftUUID
DfsObjectPlanVersion I_FrcElmntToPosExtRelshpDrft DfsObjectPlanVersion
DfsObjectPlngStatus I_FrcElmntToPosExtRelshpDrft DfsObjectPlngStatus
DfsObjectValdtyStartDate I_FrcElmntToPosExtRelshpDrft DfsPositionValdtyStartDate
DfsObjectValdtyEndDate I_FrcElmntToPosExtRelshpDrft DfsPositionValdtyEndDate
DfsObjectType I_FrcElmntToPosExtRelshpDrft DfsObjectType
DfsObjectSubType I_FrcElmntToPosExtRelshpDrft DfsObjectSubType
DfsObjectInfoType I_FrcElmntToPosExtRelshpDrft DfsObjectInfoType
DfsObjectRelatedObjectType I_FrcElmntToPosExtRelshpDrft DfsObjectRelatedObjectType
DfsObjectRelatedObjectID I_FrcElmntToPosExtRelshpDrft DfsObjectRelatedObjectID
DfsObjectRelshpPriority I_FrcElmntToPosExtRelshpDrft DfsObjectRelshpPriority
IsActiveEntity
HasActiveEntity I_FrcElmntToPosExtRelshpDrft HasActiveEntity
HasDraftEntity
@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":""
}
}*/