I_SrvcDocDocumentFlow

DDL: I_SRVCDOCDOCUMENTFLOW SQL: ISRVCDOCFLW Type: view COMPOSITE

Trans Hist of Preced and Follow-Up Trans

I_SrvcDocDocumentFlow is a Composite CDS View that provides data about "Trans Hist of Preced and Follow-Up Trans" in SAP S/4HANA. It reads from 4 data sources (I_ServiceDocumentPredecessor, I_ServiceDocumentSuccessor, I_ServiceDocumentEnhcd, I_ServiceDocumentEnhcd) and exposes 45 fields with key fields ServiceDocument, ServiceDocumentRelationUUID, ServiceDocumentRelationUUID.

Data Sources (4)

SourceAliasJoin Type
I_ServiceDocumentPredecessor _ServiceDocPrdcssr inner
I_ServiceDocumentSuccessor _ServiceDocSuccssr inner
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd from
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd union

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName ISRVCDOCFLW view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Trans Hist of Preced and Follow-Up Trans view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view

Fields (45)

KeyFieldSource TableSource FieldDescription
KEY ServiceDocument I_ServiceDocumentEnhcd ServiceDocument
KEY ServiceDocumentRelationUUID I_ServiceDocumentSuccessor ServiceDocumentRelationUUID
CustMgmtPrdcssrTransactionKey I_ServiceDocumentSuccessor ServiceDocSuccessor
PrdcssrSuccssrDocObjectType I_ServiceDocumentSuccessor ServiceDocSuccessorBusObjType
ServiceDocSuccessorBusObjType I_ServiceDocumentSuccessor ServiceDocSuccessorBusObjType
ServiceDocPrdcssrBusObjType I_ServiceDocumentSuccessor ServiceObjectType
SrvcMgmtObjectUUID I_ServiceDocumentSuccessor ServiceDocumentSuccessorUUID
ServiceObjectType I_ServiceDocumentEnhcd ServiceObjectType
ReltdSrvcDocIsPredecessor
ServiceDocumentendasServiceOrder
ServiceDocumentUUID I_ServiceDocumentEnhcd ServiceDocumentUUID
ServiceDocumentType I_ServiceDocumentEnhcd ServiceDocumentType
RespEmployeeBusinessPartnerId I_ServiceDocumentEnhcd ResponsibleEmployee
SalesOrganization I_ServiceDocumentEnhcd SalesOrganization
SalesOffice I_ServiceDocumentEnhcd SalesOffice
SalesGroup I_ServiceDocumentEnhcd SalesGroup
Division I_ServiceDocumentEnhcd Division
DistributionChannel I_ServiceDocumentEnhcd DistributionChannel
SalesOrganizationOrgUnitID I_ServiceDocumentEnhcd SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID I_ServiceDocumentEnhcd SalesOfficeOrgUnitID
SalesGroupOrgUnitID I_ServiceDocumentEnhcd SalesGroupOrgUnitID
ServiceOrganization I_ServiceDocumentEnhcd ServiceOrganization
ServiceDocument
KEY ServiceDocumentRelationUUID I_ServiceDocumentPredecessor ServiceDocumentRelationUUID
CustMgmtPrdcssrTransactionKey I_ServiceDocumentPredecessor CustMgmtPrdcssrTransactionKey
PrdcssrSuccssrDocObjectType I_ServiceDocumentPredecessor ServiceDocPrdcssrBusObjType
ServiceDocSuccessorBusObjType I_ServiceDocumentPredecessor ServiceObjectType
ServiceDocPrdcssrBusObjType I_ServiceDocumentPredecessor ServiceDocPrdcssrBusObjType
SrvcMgmtObjectUUID I_ServiceDocumentPredecessor ServiceDocumentPredecessorUUID
ServiceObjectType I_ServiceDocumentEnhcd ServiceObjectType
ReltdSrvcDocIsPredecessor
ServiceDocumentendasServiceOrder
ServiceDocumentUUID I_ServiceDocumentEnhcd ServiceDocumentUUID
ServiceDocumentType I_ServiceDocumentEnhcd ServiceDocumentType
RespEmployeeBusinessPartnerId I_ServiceDocumentEnhcd ResponsibleEmployee
SalesOrganization I_ServiceDocumentEnhcd SalesOrganization
SalesOffice I_ServiceDocumentEnhcd SalesOffice
SalesGroup I_ServiceDocumentEnhcd SalesGroup
Division I_ServiceDocumentEnhcd Division
DistributionChannel I_ServiceDocumentEnhcd DistributionChannel
SalesOrganizationOrgUnitID I_ServiceDocumentEnhcd SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID I_ServiceDocumentEnhcd SalesOfficeOrgUnitID
SalesGroupOrgUnitID I_ServiceDocumentEnhcd SalesGroupOrgUnitID
ServiceOrganization I_ServiceDocumentEnhcd ServiceOrganization
ServiceDocumentRelationType I_ServiceDocumentPredecessor ServiceDocumentRelationType
@AbapCatalog.sqlViewName: 'ISRVCDOCFLW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Trans Hist of Preced and Follow-Up Trans'
@VDM: {
  viewType: #COMPOSITE
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #XL
   }
}
define view I_SrvcDocDocumentFlow
  as select from I_ServiceDocumentEnhcd inner join I_ServiceDocumentSuccessor as _ServiceDocSuccssr  on _ServiceDocSuccssr.ServiceDocumentUUID  = I_ServiceDocumentEnhcd.ServiceDocumentUUID
                                                                                                      and _ServiceDocSuccssr.ServiceObjectType    = I_ServiceDocumentEnhcd.ServiceObjectType
                                                                                                      and not (
                                                                                                      _ServiceDocSuccssr.ServiceDocSuccessorBusObjType = _ServiceDocSuccssr.ServiceObjectType 
                                                                                                      and I_ServiceDocumentEnhcd.ServiceDocumentUUID = _ServiceDocSuccssr.ServiceDocumentSuccessorUUID)
{
  key     I_ServiceDocumentEnhcd.ServiceDocument,
  key     _ServiceDocSuccssr.ServiceDocumentRelationUUID,
          _ServiceDocSuccssr.ServiceDocSuccessor           as CustMgmtPrdcssrTransactionKey,
          _ServiceDocSuccssr.ServiceDocSuccessorBusObjType as PrdcssrSuccssrDocObjectType,
          _ServiceDocSuccssr.ServiceDocSuccessorBusObjType as ServiceDocSuccessorBusObjType,
          _ServiceDocSuccssr.ServiceObjectType as ServiceDocPrdcssrBusObjType,
          _ServiceDocSuccssr.ServiceDocumentSuccessorUUID  as SrvcMgmtObjectUUID,
          I_ServiceDocumentEnhcd.ServiceObjectType,
          cast( ' ' as abap.char( 1 ))                       as ReltdSrvcDocIsPredecessor,
          case I_ServiceDocumentEnhcd.ServiceObjectType
          when 'BUS2000117'
          then  I_ServiceDocumentEnhcd._ServiceDocPredecessor[ServiceDocumentRelationType = 'VONA' and ServiceDocumentRelationKind = 'A']._ServiceDoc.ServiceDocument
          when 'BUS2000116' then  I_ServiceDocumentEnhcd.ServiceDocument
          end                                                as ServiceOrder,

          I_ServiceDocumentEnhcd.ServiceDocumentUUID,

          //          case ServiceObjectType

          //          when 'BUS2000117'

          //          then _ServiceDocPredecessor[ServiceDocumentRelationType = 'VONA' and ServiceDocumentRelationKind = 'A']._ServiceDoc.ServiceDocumentUUID

          //          when 'BUS2000116' then ServiceDocumentUUID

          //          end                                                as ServiceDocUUID

           I_ServiceDocumentEnhcd.ServiceDocumentType,
           I_ServiceDocumentEnhcd.ResponsibleEmployee                                as RespEmployeeBusinessPartnerId,
           I_ServiceDocumentEnhcd.SalesOrganization,
           I_ServiceDocumentEnhcd.SalesOffice,
           I_ServiceDocumentEnhcd.SalesGroup,
           I_ServiceDocumentEnhcd.Division,
           I_ServiceDocumentEnhcd.DistributionChannel,
           I_ServiceDocumentEnhcd.SalesOrganizationOrgUnitID,
           I_ServiceDocumentEnhcd.SalesOfficeOrgUnitID,
           I_ServiceDocumentEnhcd.SalesGroupOrgUnitID,
           I_ServiceDocumentEnhcd.ServiceOrganization,
           _ServiceDocSuccssr.ServiceDocumentRelationType as ServiceDocumentRelationType

}
union 
select from I_ServiceDocumentEnhcd inner join I_ServiceDocumentPredecessor as _ServiceDocPrdcssr on _ServiceDocPrdcssr.ServiceDocumentUUID  = I_ServiceDocumentEnhcd.ServiceDocumentUUID
                                                                                                          and _ServiceDocPrdcssr.ServiceObjectType    = I_ServiceDocumentEnhcd.ServiceObjectType
                                                                                                          and not (
                                                                                                      _ServiceDocPrdcssr.ServiceDocPrdcssrBusObjType = _ServiceDocPrdcssr.ServiceObjectType 
                                                                                                      and I_ServiceDocumentEnhcd.ServiceDocumentUUID = _ServiceDocPrdcssr.ServiceDocumentPredecessorUUID )                                                                                                          
{
  key    I_ServiceDocumentEnhcd.ServiceDocument,
  key   _ServiceDocPrdcssr.ServiceDocumentRelationUUID,
        _ServiceDocPrdcssr.CustMgmtPrdcssrTransactionKey  as CustMgmtPrdcssrTransactionKey,
        _ServiceDocPrdcssr.ServiceDocPrdcssrBusObjType    as PrdcssrSuccssrDocObjectType,
        _ServiceDocPrdcssr.ServiceObjectType as ServiceDocSuccessorBusObjType,
        _ServiceDocPrdcssr.ServiceDocPrdcssrBusObjType as ServiceDocPrdcssrBusObjType,

        _ServiceDocPrdcssr.ServiceDocumentPredecessorUUID as SrvcMgmtObjectUUID,

        I_ServiceDocumentEnhcd.ServiceObjectType,
        cast( 'X' as abap.char( 1 ))                          as ReltdSrvcDocIsPredecessor,

        case  I_ServiceDocumentEnhcd.ServiceObjectType
        when 'BUS2000117'
        then  I_ServiceDocumentEnhcd._ServiceDocPredecessor[ServiceDocumentRelationType = 'VONA' and ServiceDocumentRelationKind = 'A']._ServiceDoc.ServiceDocument
        when 'BUS2000116' then  I_ServiceDocumentEnhcd.ServiceDocument
        end                                                   as ServiceOrder,

         I_ServiceDocumentEnhcd.ServiceDocumentUUID,

        //        case ServiceObjectType

        //        when 'BUS2000117'

        //        then _ServiceDocPredecessor[ServiceDocumentRelationType = 'VONA' and ServiceDocumentRelationKind = 'A']._ServiceDoc.ServiceDocumentUUID

        //        when 'BUS2000116' then ServiceDocumentUUID

        //        end                                                   as ServiceDocUUID

         I_ServiceDocumentEnhcd.ServiceDocumentType,
         I_ServiceDocumentEnhcd.ResponsibleEmployee                                   as RespEmployeeBusinessPartnerId,
         I_ServiceDocumentEnhcd.SalesOrganization,
         I_ServiceDocumentEnhcd.SalesOffice,
         I_ServiceDocumentEnhcd.SalesGroup,
         I_ServiceDocumentEnhcd.Division,
         I_ServiceDocumentEnhcd.DistributionChannel,
         I_ServiceDocumentEnhcd.SalesOrganizationOrgUnitID,
         I_ServiceDocumentEnhcd.SalesOfficeOrgUnitID,
         I_ServiceDocumentEnhcd.SalesGroupOrgUnitID,
         I_ServiceDocumentEnhcd.ServiceOrganization,
         _ServiceDocPrdcssr.ServiceDocumentRelationType as ServiceDocumentRelationType
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTPREDECESSOR",
"I_SERVICEDOCUMENTSUCCESSOR"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/