P_SrvcContrList

DDL: P_SRVCCONTRLIST SQL: PSRVCCONTRLIST Type: view COMPOSITE Package: CRMS4_ANALYTICS_SERVICE_CONTR

Service Contracts List

P_SrvcContrList is a Composite CDS View that provides data about "Service Contracts List" in SAP S/4HANA. It reads from 1 data source (I_ServiceDocumentEnhcd) and exposes 6 fields with key fields ServiceObjectType, ServiceContract. It has 1 association to related views. Part of development package CRMS4_ANALYTICS_SERVICE_CONTR.

Data Sources (1)

SourceAliasJoin Type
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd from

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_SrvcContrDays _ContractDays $projection.ServiceContract = _ContractDays.ServiceDocument

Annotations (9)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName PSRVCCONTRLIST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY ServiceObjectType ServiceObjectType
KEY ServiceContract ServiceDocument
ServiceDocNetAmount ServiceDocNetAmount
ServiceDocumentStatus ServiceDocumentStatus
NumberOfDays _ContractDays NumberOfDays
TotalSrvcContrValueInDC ServiceDocNetAmount
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.sqlViewName: 'PSRVCCONTRLIST'
@AbapCatalog.compiler.compareFilter: true
@AccessControl: {
  authorizationCheck: #NOT_REQUIRED,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}
//@EndUserText.label: 'Service Contracts List'


@ObjectModel: {
   usageType: {
     dataClass:      #MIXED,
     serviceQuality: #D,
     sizeCategory:   #XXL
   }
   }
@VDM: {
  viewType: #COMPOSITE,
  private:true
}
define view P_SrvcContrList
  as select from I_ServiceDocumentEnhcd
  association [0..1] to P_SrvcContrDays as _ContractDays on $projection.ServiceContract = _ContractDays.ServiceDocument
{
  key ServiceObjectType,
  key ServiceDocument     as ServiceContract,
      ServiceDocNetAmount,
      ServiceDocumentStatus,
      _ContractDays.NumberOfDays,
      @DefaultAggregation: #MAX
      case
      when _ContractDays.NumberOfDays >= 365
      then ServiceDocNetAmount *(division(365,_ContractDays.NumberOfDays,2))
      else ServiceDocNetAmount
      end                 as AnnualSrvcContrValueInDC,

      ServiceDocNetAmount as TotalSrvcContrValueInDC

}

where
       ServiceObjectType     = 'BUS2000112'
  and(
       ServiceDocumentStatus = 'A'
    or ServiceDocumentStatus = 'B'
    or ServiceDocumentStatus = 'D'
  )