@AbapCatalog.sqlViewName: 'PBUSSOLNORDDATA'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM: {
private:true,
viewType: #COMPOSITE
}
@AccessControl: {
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ObjectModel: {
usageType: {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #XXL
}
}
define view P_BusSolnOrdHdrData
as select from I_ServiceDocumentEnhcd
association [0..1] to I_CalendarDate as _Period on $projection.ServiceDocumentCreationDate = _Period.CalendarDate
{
@ObjectModel.foreignKey.association: '_ServiceObjType'
key ServiceObjectType,
@ObjectModel.text.element: 'ServiceDocumentDescription'
key ServiceDocument as BusinessSolutionOrder,
@ObjectModel.foreignKey.association: '_ServiceDocumentType'
ServiceDocumentType as BusSolnOrdType,
@Semantics.text: true
ServiceDocumentDescription as BusSolnOrdDescription,
@ObjectModel.foreignKey.association: '_DistributionChannel'
DistributionChannel,
@ObjectModel.foreignKey.association: '_Division'
Division,
@ObjectModel.foreignKey.association: '_SalesOrganization'
SalesOrganization,
@ObjectModel.foreignKey.association: '_SalesOffice'
SalesOffice,
@ObjectModel.foreignKey.association: '_SalesGroup'
SalesGroup,
@ObjectModel.foreignKey.association: '_SoldToParty'
SoldToParty,
@ObjectModel.foreignKey.association: '_SoldToPartyCountry'
SoldToPartyCountry,
@ObjectModel.foreignKey.association: '_SoldToPartyRegion'
SoldToPartyRegion,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
@Semantics.currencyCode:true
TransactionCurrency,
@ObjectModel.foreignKey.association: '_SrvcDocLifecycleStatus'
ServiceDocumentStatus as BusSolnOrdStatus,
@DefaultAggregation: #SUM
cast( case when (ServiceDocumentIsOpen = 'X' and ServiceDocumentIsReleased = '')
then 1
else 0
end as abap.int4 ) as NrOfOpenBusSolnOrders,
@DefaultAggregation: #SUM
cast( case when ServiceDocumentIsReleased = 'X'
then 1
else 0
end as abap.int4 ) as NrOfReldBusSolnOrders,
@DefaultAggregation: #SUM
cast( case when (ServiceDocumentIsOpen = '' and ServiceDocumentIsReleased = '')
then 1
else 0
end as abap.int4 ) as NrOfCmpltdBusSolnOrders,
@DefaultAggregation: #SUM
cast(1 as abap.int4) as NrOfCrtedBusSolnOrders,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ServiceDocNetAmount,
ServiceDocumentCreationDate,
@Semantics.calendar.quarter
_Period.CalendarQuarter as BusSolnOrdCreationQuarter,
@Semantics.calendar.month
_Period.CalendarMonth as BusSolnOrdCreationMonth,
@Semantics.calendar.year
_Period.CalendarYear as BusSolnOrdCreationYear,
PostingDate,
_Period,
_ServiceObjType,
_ServiceDocumentType,
_DistributionChannel,
_Division,
_SalesOrganization,
_SalesOffice,
_SalesGroup,
_SoldToParty,
_SoldToPartyCountry,
_SoldToPartyRegion,
_TransactionCurrency,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SrvcDocLifecycleStatus'
_ServiceDocumentStatus,
_SrvcDocLifecycleStatus
}
where
ServiceObjectType = 'BUS2000172'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_SERVICEDOCUMENTENHCD"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_CALENDARDATE",
"I_COUNTRY",
"I_CURRENCY",
"I_CUSTMGMTBUSOBJTYPE",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_REGION",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SERVICEDOCUMENTSTATUS",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCDOCLIFECYCLESTATUS"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/