@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
{
@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
}
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
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FUNCTIONALLOCATION",
"I_MATERIAL",
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTITEMENHCD",
"I_SERVICEDOCUMENTITEMPRDCSSR_2",
"I_SERVICEDOCUMENTREFOBJECT"
],
"ASSOCIATED":
[
"I_CUSTMGMTBUSOBJTYPE",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_EQUIPMENTTEXT",
"I_MATERIALTEXT",
"I_PRODUCTTEXT",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONUNIT",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCMGMTORGANIZATIONUNIT"
],
"BASE":
[
"I_SERVICEDOCUMENTITEMENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/