P_ServiceDocItemAvgDuration
Average Duration Of Service Trans. Items
P_ServiceDocItemAvgDuration is a Composite CDS View that provides data about "Average Duration Of Service Trans. Items" in SAP S/4HANA. It reads from 1 data source (I_ServiceDocumentItemEnhcd) and exposes 41 fields with key fields ServiceObjectType, SalesOrganization, DistributionChannel, Division, SalesOffice. It has 4 associations to related views. Part of development package CRMS4_ANALYTICS_COMMON.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_ServiceDocumentItemEnhcd | I_ServiceDocumentItemEnhcd | from |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..*] | I_EquipmentText | _EquipmentText | $projection.Equipment = _EquipmentText.Equipment |
| [0..*] | I_MaterialText | _MaterialText | $projection.Material = _MaterialText.Material |
| [0..*] | I_ProductText | _ProductIDText | $projection.ProductID = _ProductIDText.Product |
| [0..1] | I_ServiceDocumentType | _ServiceOrderType | $projection.ServiceOrderType = _ServiceOrderType.ServiceDocumentType |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.sqlViewName | PSERVITMAVGDUR | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (41)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | ServiceObjectType | ServiceObjectType | ||
| KEY | SalesOrganization | SalesOrganization | ||
| KEY | DistributionChannel | DistributionChannel | ||
| KEY | Division | Division | ||
| KEY | SalesOffice | SalesOffice | ||
| KEY | SalesGroup | SalesGroup | ||
| SalesOrganizationOrgUnitID | SalesOrganizationOrgUnitID | |||
| SalesOfficeOrgUnitID | SalesOfficeOrgUnitID | |||
| SalesGroupOrgUnitID | SalesGroupOrgUnitID | |||
| ServiceOrganization | ServiceOrganization | |||
| ServiceDocumentType | ServiceDocumentType | |||
| ServiceOrderType | ||||
| FunctionalLocation | ||||
| Material | ||||
| ProductID | ||||
| Equipment | ||||
| ProductIDendasFuncLocBasedMaterial | ||||
| char4endasFuncLocBasedMaterialText | ||||
| ActualServiceDuration | ActualServiceDuration | |||
| ActualServiceDurationUnit | ActualServiceDurationUnit | |||
| ServiceDocumentIsOpen | _ServiceDocument | ServiceDocumentIsOpen | ||
| ServiceDocumentItemIsOpen | ServiceDocumentItemIsOpen | |||
| ServiceDocumentStatus | _ServiceDocument | ServiceDocumentStatus | ||
| ServiceDocumentItemStatus | ServiceDocumentItemStatus | |||
| _EquipmentText | _EquipmentText | |||
| _MaterialText | _MaterialText | |||
| _ProductIDText | _ProductIDText | |||
| _SalesOrganization | _SalesOrganization | |||
| _DistributionChannel | _DistributionChannel | |||
| _Division | _Division | |||
| _SalesOffice | _SalesOffice | |||
| _SalesGroup | _SalesGroup | |||
| _SalesOrganizationOrgUnit | _SalesOrganizationOrgUnit | |||
| _SalesOfficeOrgUnit | _SalesOfficeOrgUnit | |||
| _SalesGroupOrgUnit | _SalesGroupOrgUnit | |||
| _SalesOrganizationOrgUnit_2 | _SalesOrganizationOrgUnit_2 | |||
| _SalesOfficeOrgUnit_2 | _SalesOfficeOrgUnit_2 | |||
| _SalesGroupOrgUnit_2 | _SalesGroupOrgUnit_2 | |||
| _ServiceObjType | _ServiceObjType | |||
| _ServiceDocumentType | _ServiceDocumentType | |||
| _ServiceOrderType | _ServiceOrderType |
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog:{
sqlViewName: 'PSERVITMAVGDUR',
compiler.compareFilter: true,
preserveKey: true
}
@AccessControl: {
authorizationCheck: #NOT_REQUIRED,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ObjectModel: {
usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #XXL
}
}
@VDM: {
viewType: #COMPOSITE,
private:true
}
define view P_ServiceDocItemAvgDuration
as select from I_ServiceDocumentItemEnhcd
association [0..*] to I_EquipmentText as _EquipmentText on $projection.Equipment = _EquipmentText.Equipment
association [0..*] to I_MaterialText as _MaterialText on $projection.Material = _MaterialText.Material
association [0..*] to I_ProductText as _ProductIDText on $projection.ProductID = _ProductIDText.Product
// A separate association for order type, which technically is a document type, but the source is different
association [0..1] to I_ServiceDocumentType as _ServiceOrderType on $projection.ServiceOrderType = _ServiceOrderType.ServiceDocumentType
{
@ObjectModel.foreignKey.association: '_ServiceObjType'
key ServiceObjectType,
@ObjectModel.foreignKey.association: '_SalesOrganization'
key SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
key DistributionChannel,
@ObjectModel.foreignKey.association: '_Division'
key Division,
@ObjectModel.foreignKey.association: '_SalesOffice'
key SalesOffice,
@ObjectModel.foreignKey.association: '_SalesGroup'
key SalesGroup,
// @ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit'
@ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit_2'
SalesOrganizationOrgUnitID,
// @ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit'
@ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit_2'
SalesOfficeOrgUnitID,
// @ObjectModel.foreignKey.association: '_SalesGroupOrgUnit'
@ObjectModel.foreignKey.association: '_SalesGroupOrgUnit_2'
SalesGroupOrgUnitID,
ServiceOrganization,
//@ObjectModel.foreignKey.association: '_ServiceDocumentType'
ServiceDocumentType,
//to get the filter value passed from global filter to the card
_ServiceDocItmPrdcssr_2._ServiceDocItm.ServiceDocumentType as ServiceOrderType,
// @ObjectModel.foreignKey.association: '_FunctionalLocation'
_ServiceDocument._ServiceDocRefObj.FunctionalLocation as FunctionalLocation,
_ServiceDocument._ServiceDocRefObj._FunctionalLocation._ConstructionMaterial.Material as Material,
_ServiceDocument._ServiceDocRefObj.ProductID as ProductID,
_ServiceDocument._ServiceDocRefObj.Equipment as Equipment,
case when _ServiceDocument._ServiceDocRefObj.FunctionalLocation is not initial or
_ServiceDocument._ServiceDocRefObj.FunctionalLocation <> ''
then
_ServiceDocument._ServiceDocRefObj._FunctionalLocation._ConstructionMaterial.Material
when _ServiceDocument._ServiceDocRefObj.ProductID is not initial or
_ServiceDocument._ServiceDocRefObj.ProductID <> ''
then
_ServiceDocument._ServiceDocRefObj.ProductID
end as FuncLocBasedMaterial,
case when _ServiceDocument._ServiceDocRefObj.FunctionalLocation is not initial or
_ServiceDocument._ServiceDocRefObj.FunctionalLocation <> ''
then
cast( 'FLOC' as abap.char(4) )
when _ServiceDocument._ServiceDocRefObj.ProductID is not initial or
_ServiceDocument._ServiceDocRefObj.ProductID <> ''
then
cast( 'PROD' as abap.char(4) )
end as FuncLocBasedMaterialText,
@Semantics: { quantity : {unitOfMeasure: 'ActualServiceDurationUnit'} }
ActualServiceDuration,
@Semantics.unitOfMeasure:true
ActualServiceDurationUnit,
_ServiceDocument.ServiceDocumentIsOpen,
ServiceDocumentItemIsOpen,
_ServiceDocument.ServiceDocumentStatus,
ServiceDocumentItemStatus,
_EquipmentText,
_MaterialText,
_ProductIDText,
_SalesOrganization,
_DistributionChannel,
_Division,
_SalesOffice,
_SalesGroup,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOrganizationOrgUnit_2'
_SalesOrganizationOrgUnit,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOfficeOrgUnit_2'
_SalesOfficeOrgUnit,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesGroupOrgUnit_2'
_SalesGroupOrgUnit,
_SalesOrganizationOrgUnit_2,
_SalesOfficeOrgUnit_2,
_SalesGroupOrgUnit_2,
_ServiceObjType,
_ServiceDocumentType,
_ServiceOrderType
}
where
ServiceObjectType = 'BUS2000117'
and _ServiceDocument.ServiceDocumentIsOpen <> 'X'
and ServiceDocumentItemIsOpen <> 'X'
and _ServiceDocument.SrvcDocIsMaintServiceOrder != 'X'
and ActualServiceDurationUnit <> ''
and(
ActualServiceDuration is not null
or ActualServiceDuration <> 0
)
and ServiceDocumentTemplateType is initial
and RefInHouseRepairIsExisting is initial
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA