P_SrvcTransactionIssueItemC004

DDL: P_SRVCTRANSACTIONISSUEITEMC004 Type: view COMPOSITE

P_SrvcTransactionIssueItemC004 is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_ServiceDocumentItemSuccssr_2, I_ServiceDocumentItemEnhcd) and exposes 45 fields with key fields ServiceObjectType, ServiceDocument, ServiceDocumentItem, CustMgmtIssue, SrvcConfIssue.

Data Sources (2)

SourceAliasJoin Type
I_ServiceDocumentItemSuccssr_2 Link inner
I_ServiceDocumentItemEnhcd Successor inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PSRVCISSITMC004 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AbapCatalog.dataMaintenance #DISPLAY_ONLY view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (45)

KeyFieldSource TableSource FieldDescription
KEY ServiceObjectType Item ServiceObjectType
KEY ServiceDocument Item ServiceDocument
KEY ServiceDocumentItem Item ServiceDocumentItem
KEY CustMgmtIssue
KEY SrvcConfIssue
ServiceDocumentType
Country
Region
ServiceRisk
ServiceDocumentProblemCategory
TransactionCurrency
SrvcOrdGrossAmount Item ServiceDocItemGrossAmount
Industry Item Industry
ServiceOrganization Item ServiceOrganization
SalesOrganization Item SalesOrganization
SalesOffice Item SalesOffice
SalesGroup Item SalesGroup
DistributionChannel Item DistributionChannel
Division Item Division
SoldToPartyCountry Item SoldToPartyCountry
SoldToPartyRegion Item SoldToPartyRegion
SoldToParty Item SoldToParty
ResponsibleEmployee Item ResponsibleEmployee
ContactPerson Item ContactPerson
ServiceTeam Item ServiceTeam
ServiceEmployee Item ServiceEmployee
ServiceDocItemRejectionReason Item ServiceDocItemRejectionReason
ServiceDocumentItemStatus Item ServiceDocumentItemStatus
ServiceDocumentItemHasError Item ServiceDocumentItemHasError
BillingBlockReason Item BillingBlockReason
ServiceDocItemBillingStatus Item ServiceDocItemBillingStatus
SrvcDocItmIsReleasedForBilling Item SrvcDocItmIsReleasedForBilling
SrvcDocItemTransferStatus Item SrvcDocItemTransferStatus
RefInHouseRepairIsExisting Item RefInHouseRepairIsExisting
RequestedServiceStartDateTime Item RequestedServiceStartDateTime
RequestedServiceEndDateTime Item RequestedServiceEndDateTime
PlannedServiceStartDateTime Item PlannedServiceStartDateTime
PlannedServiceEndDateTime Item PlannedServiceEndDateTime
SrvcDocItemSLADueByDateTime Item SrvcDocItemSLADueByDateTime
ResponseProfile Item ResponseProfile
ServiceProfile Item ServiceProfile
ServiceFirstResponseByDateTime Item ServiceFirstResponseByDateTime
RefBusinessSolutionOrder Item RefBusinessSolutionOrder
RefBusinessSolutionOrderItem Item RefBusinessSolutionOrderItem
_TransactionCurrency
@AbapCatalog:
    {
        sqlViewName: 'PSRVCISSITMC004',
        compiler.compareFilter: true,
        preserveKey: true,
        dataMaintenance: #DISPLAY_ONLY
    }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM:
    {
        private: true,
        viewType: #COMPOSITE
    }
define view P_SrvcTransactionIssueItemC004
  as select distinct from I_ServiceDocumentItemEnhcd     as Item

    inner join            I_ServiceDocumentItemSuccssr_2 as Link      on  Link.ServiceDocumentItemCharUUID    = Item.ServiceDocumentItemCharUUID
                                                                      and Link.ServiceDocumentItmRelationType = 'VONA' // Predecessor/Sucessor Relationship

                                                                      and Link.ServiceDocumentItemObjectType  = Item.ServiceDocumentItemObjectType // only relevant in dev. system due to bad data

    inner join            I_ServiceDocumentItemEnhcd     as Successor on  Successor.ServiceDocumentItemObjectType = Link.ServiceDocItmSuccssrBusObjType
                                                                      and Successor.ServiceDocumentItemCharUUID   = Link.ServiceDocItmSuccssrCharUUID
                                                                      and Successor.ServiceObjectType             = 'BUS2000117' // Successor is a service confirmation

{
  key Item.ServiceObjectType,
  key Item.ServiceDocument,
  key Item.ServiceDocumentItem,
  key cast ( 'C001' as crms4_service_issue )   as CustMgmtIssue,
  key cast ( 'C004' as crms4_srvc_conf_issue ) as SrvcConfIssue,

      Item._ServiceDocument.ServiceDocumentType,
      Item._ServiceDocument.SoldToPartyCountry as Country,
      Item._ServiceDocument.Region,
      Item._ServiceDocument.ServiceRisk,
      Item._ServiceDocument.ServiceDocumentProblemCategory,
      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      @Semantics.currencyCode:true
      Item._ServiceDocument.TransactionCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      Item.ServiceDocItemGrossAmount           as SrvcOrdGrossAmount,
      Item.Industry,

      // Organization Unit fields

      Item.ServiceOrganization,
      Item.SalesOrganization,
      Item.SalesOffice,
      Item.SalesGroup,
      Item.DistributionChannel,
      Item.Division,

      // Sales related fields (ex. BP)

      Item.SoldToPartyCountry,
      Item.SoldToPartyRegion,
      Item.SoldToParty,
      Item.ResponsibleEmployee,
      Item.ContactPerson,
      Item.ServiceTeam,
      Item.ServiceEmployee,

      // Status fields

      Item.ServiceDocItemRejectionReason,
      Item.ServiceDocumentItemStatus,
      Item.ServiceDocumentItemHasError,
      Item.BillingBlockReason,
      Item.ServiceDocItemBillingStatus,
      Item.SrvcDocItmIsReleasedForBilling,
      Item.SrvcDocItemTransferStatus,
      Item.RefInHouseRepairIsExisting,
      
      // Various attributes

      Item.RequestedServiceStartDateTime,
      Item.RequestedServiceEndDateTime,
      Item.PlannedServiceStartDateTime,
      Item.PlannedServiceEndDateTime,

      //SLA Dueby Date


      Item.SrvcDocItemSLADueByDateTime,
      Item.ResponseProfile,
      Item.ServiceProfile,
      Item.ServiceFirstResponseByDateTime,

      Item.RefBusinessSolutionOrder,
      Item.RefBusinessSolutionOrderItem,

      Item._ServiceDocument._TransactionCurrency
}
where
       Item.ServiceObjectType                                =  'BUS2000116' // Service Order

  and  Item._ServiceDocument.ServiceDocumentIsRejected       <> 'X'          // Service transaction is not rejected

  and  Item._ServiceDocument.ServiceDocumentIsReleased       =  'X'          // Service Order is Released

  and  Item._ServiceDocument.ServiceDocumentIsQuotation      <> 'X'          // Service Order is not a quotation

  and  Item.RefInHouseRepairIsExisting                       is initial 
  and  Item._ServiceDocument.ServiceDocumentTemplateType     = ' '
  and(
       Successor._ServiceDocument.ServiceConfirmationIsFinal =  ' '
    or Successor._ServiceDocument.ServiceConfirmationIsFinal =  'N'
  ) // Service Confirmation not Final

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTITEMENHCD",
"I_SERVICEDOCUMENTITEMSUCCSSR_2"
],
"ASSOCIATED":
[
"I_CURRENCY"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/