@EndUserText.label: 'Service Order - Cube'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog: {
sqlViewName: 'ISERVORDCUBE',
compiler.compareFilter: true,
preserveKey: true
}
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #PUBLIC_LOCAL_API,
lifecycle.status: #DEPRECATED,
lifecycle.successor: 'I_ServiceOrderCube_2'
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ObjectModel: {
representativeKey: 'ServiceOrder',
usageType: {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #XXL
}
}
@Analytics.dataCategory: #CUBE
@Metadata.allowExtensions:true
@Metadata.ignorePropagatedAnnotations: true
// View is C1 enabled.
// Conatin Deprecated annotations.
define view I_ServiceOrderCube
as select from I_ServiceDocumentEnhcd
association [0..1] to P_SrvcOrdDistinctConfExist as _SrvcOrdItmConfExist on $projection.ServiceObjectType = _SrvcOrdItmConfExist.ServiceObjectType
and $projection.ServiceOrder = _SrvcOrdItmConfExist.ServiceOrder
association [1..1] to I_SrvcOrdConfStatus as _SrvcOrdConfStatus on $projection.SrvcOrdHasConfdItem = _SrvcOrdConfStatus.SrvcOrdHasConfdItem
association [0..1] to E_ServiceDocument as _ServiceDocumentExt on $projection.ServiceObjectType = _ServiceDocumentExt.ServiceCategory
and $projection.ServiceOrder = _ServiceDocumentExt.ServiceOrder
{
@ObjectModel.foreignKey.association: '_ServiceObjType'
key ServiceObjectType,
key ServiceDocument as ServiceOrder,
ServiceDocumentDescription as ServiceOrderDescription,
@ObjectModel.foreignKey.association: '_ServiceDocumentStatus'
ServiceDocumentStatus as ServiceOrderStatus,
@ObjectModel.foreignKey.association: '_ServiceDocumentType'
ServiceDocumentType,
@ObjectModel.foreignKey.association: '_SoldToParty'
SoldToParty,
RequestedServiceEndDate,
@ObjectModel.foreignKey.association: '_ServiceDocumentPriority'
ServiceDocumentPriority,
@ObjectModel.foreignKey.association: '_ServiceDocHasError'
ServiceDocumentHasError,
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ServiceDocNetAmount,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
@Semantics.currencyCode:true
TransactionCurrency,
@ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit'
SalesOrganizationOrgUnitID,
@ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit'
SalesOfficeOrgUnitID,
@ObjectModel.foreignKey.association: '_SalesGroupOrgUnit'
SalesGroupOrgUnitID,
@ObjectModel.foreignKey.association: '_SalesOrganization'
SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
DistributionChannel,
@ObjectModel.foreignKey.association: '_Division'
Division,
@ObjectModel.foreignKey.association: '_SalesOffice'
SalesOffice,
@ObjectModel.foreignKey.association: '_SalesGroup'
SalesGroup,
@DefaultAggregation: #SUM
cast( case when ServiceDocumentStatus = 'A' then cast (1 as abap.int4)
when ServiceDocumentStatus = 'B' then cast (1 as abap.int4)
when ServiceDocumentStatus = 'D' then cast (1 as abap.int4)
end as abap.int4 ) as NmbrOfIncompleteServiceOrders,
@DefaultAggregation: #SUM
case when RequestedServiceEndDate < $session.system_date and
( ServiceDocumentStatus = 'A' or
ServiceDocumentStatus = 'B' or
ServiceDocumentStatus = 'D' )
then cast (1 as abap.int4)
end as NumberOfOverdueServiceOrders,
// Confirmation exists or not
case
when _SrvcOrdItmConfExist.ServiceConfirmation is not null and
( ServiceDocumentStatus = 'A' or
ServiceDocumentStatus = 'B' or
ServiceDocumentStatus = 'D' )
then 'X'
else ' '
end as SrvcOrdHasConfdItem,
_ServiceObjType,
@ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
_ServiceDocumentStatus,
_ServiceDocumentType,
_ServiceDocumentPriority,
_SoldToParty,
@ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
_ServiceDocHasError,
_SrvcOrdConfStatus,
@ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
_SalesOrganizationOrgUnit,
@ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
_SalesOfficeOrgUnit,
@ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
_SalesGroupOrgUnit,
_SalesOrganization,
_SalesOffice,
_SalesGroup,
_DistributionChannel,
_Division,
_TransactionCurrency
}
where
ServiceObjectType = 'BUS2000116'
and ServiceDocumentIsQuotation != 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SERVICEDOCUMENTENHCD",
"P_SRVCORDDISTINCTCONFEXIST"
],
"ASSOCIATED":
[
"E_SERVICEDOCUMENT",
"I_BUSINESSPARTNER",
"I_CURRENCY",
"I_CUSTMGMTBUSOBJTYPE",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONUNIT",
"I_SERVICEDOCERRORSTATUS",
"I_SERVICEDOCUMENTPRIORITY",
"I_SERVICEDOCUMENTSTATUS",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCORDCONFSTATUS",
"P_SRVCORDDISTINCTCONFEXIST"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/