@AbapCatalog.sqlViewName: 'PBSOLNORDITMFNDT'
@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_BusSolnOrdItmFinData
as select from I_ServiceDocumentItemEnhcd
association [1] to P_BusinessSolnOrdItmFinData as _ServiceDocLinItmFinData on $projection.BusinessSolutionOrder = _ServiceDocLinItmFinData.BusinessSolutionOrder
and $projection.BusinessSolutionOrderItem = _ServiceDocLinItmFinData.BusinessSolutionOrderItem
// association [0..1] to I_CalendarDate as _Period on $projection.ServiceDocItemCreationDate = _Period.CalendarDate
association [1] to P_BusSolnOrdItmWithHdrStat as _SolnOrdHdrStat on $projection.ServiceObjectType = _SolnOrdHdrStat.ServiceObjectType
and $projection.BusinessSolutionOrder = _SolnOrdHdrStat.BusinessSolutionOrder
and $projection.BusinessSolutionOrderItem = _SolnOrdHdrStat.BusinessSolutionOrderItem
{
@ObjectModel.foreignKey.association: '_ServiceObjType'
key ServiceObjectType,
@ObjectModel.text.element: 'BusSolnOrdDescription'
// @ObjectModel.foreignKey.association: '_ServiceDocument'
key ServiceDocument as BusinessSolutionOrder,
@ObjectModel.text.element: 'ServiceDocumentItemDescription'
key ServiceDocumentItem as BusinessSolutionOrderItem,
@ObjectModel.foreignKey.association: '_ServiceDocumentType'
ServiceDocumentType as BusSolnOrdType,
@Semantics.text: true
ServiceDocumentDescription as BusSolnOrdDescription,
@Semantics.text: true
ServiceDocumentItemDescription as BusSolnOrdItmDescription,
@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 as Country,
@ObjectModel.foreignKey.association: '_SoldToPartyRegion'
SoldToPartyRegion as Region,
@ObjectModel.foreignKey.association: '_SrvcDocItmLifecycleStatus'
ServiceDocumentItemStatus as BusSolnOrdItmStatus,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
@Semantics.currencyCode:true
TransactionCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ServiceDocumentItemNetAmount as TotBusSolnOrdItmNetAmtPerPerd,
ServiceDocumentItemObjectType,
@Semantics.currencyCode:true
_ServiceDocLinItmFinData.CompanyCodeCurrency as CompanyCodeCurrency,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
@DefaultAggregation: #SUM
_ServiceDocLinItmFinData.RevenueAmountInCompanyCodeCrcy as RevenueAmountInCompanyCodeCrcy,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
@DefaultAggregation: #SUM
_ServiceDocLinItmFinData.CostAmountInCompanyCodeCrcy as CostAmountInCompanyCodeCrcy,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
@DefaultAggregation: #SUM
_ServiceDocLinItmFinData.RecognizedMarginAmtInCCCrcy as RecognizedMarginAmtInCCCrcy,
@ObjectModel.foreignKey.association: '_SrvcDocLifecycleStatus'
_ServiceDocument.ServiceDocumentStatus as BusSolnOrdStatus,
// _ServiceDocLinItmFinData.PostingDate as PostingDate,
PostingDate,
// // @AnalyticsDetails.query.axis: #ROWS
// @DefaultAggregation: #FORMULA
// @AnalyticsDetails.query.formula: 'NDIV0($projection.RecognizedMarginAmtInCCCrcy / $projection.RevenueAmountInCompanyCodeCrcy) * 100'
// @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
// cast (0 as fis_operatingmargin_ksl) as OpgMargRatioGlobCrcy,
@ObjectModel.foreignKey.association: '_ServiceDocItemCategory'
ServiceDocItemCategory,
@ObjectModel.foreignKey.association: '_Product'
Product,
// ServiceDocItemCreationDate,
// @Semantics.calendar.quarter
// _Period.CalendarQuarter as BusSolnOrdCreationQuarter,
// @Semantics.calendar.month
// _Period.CalendarMonth as BusSolnOrdCreationMonth,
// @Semantics.calendar.year
// _Period.CalendarYear as BusSolnOrdCreationYear,
// @Semantics.systemDate.createdAt: true
// cast( tstmp_to_dats( ServiceDocItemCreationDateTime,
// abap_system_timezone( $session.client,'NULL' ),
// $session.client,
// 'NULL' ) as crms4_created_on preserving type ) as ServiceDocItemCreationDate,
@Semantics.systemDate.createdAt: true
cast( tstmp_to_dats( ServiceDocItemCreationDateTime,
$session.user_timezone,
$session.client,
'NULL' ) as crms4_created_on preserving type ) as ServiceDocItemCreationDate,
@Semantics.systemDate.createdAt: true
_ServiceDocument.ServiceDocumentCreationDate as ServiceDocumentCreationDate,
// @Semantics.systemDate.createdAt: true
// cast( tstmp_to_dats( ServiceDocItemCreationDateTime,
// 'UTC' ,
// $session.client,
// 'NULL' )
// as crms4_created_on preserving type ) as ServiceDocItemCreationDate,
@DefaultAggregation: #SUM
cast( case when (_SolnOrdHdrStat. ServiceDocumentIsOpen = 'X' and _SolnOrdHdrStat.ServiceDocumentIsReleased = '')
then 1
else 0
end as abap.int4 ) as NrOfOpenBusSolnOrders,
@DefaultAggregation: #SUM
cast( case when _SolnOrdHdrStat.ServiceDocumentIsReleased = 'X'
then 1
else 0
end as abap.int4 ) as NrOfReldBusSolnOrders,
@DefaultAggregation: #SUM
cast( case when (_SolnOrdHdrStat. ServiceDocumentIsOpen = '' and _SolnOrdHdrStat.ServiceDocumentIsReleased = '')
then 1
else 0
end as abap.int4 ) as NrOfCmpltdBusSolnOrders,
_ServiceObjType,
_ServiceDocumentType,
_DistributionChannel,
_Division,
_SalesOrganization,
_SalesOffice,
_SalesGroup,
_SoldToParty,
_SoldToPartyCountry,
_SoldToPartyRegion,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SrvcDocItmLifecycleStatus'
_ServiceDocItemStatus,
_SrvcDocItmLifecycleStatus,
_TransactionCurrency,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SrvcDocLifecycleStatus'
_ServiceDocument._ServiceDocumentStatus,
_ServiceDocument._SrvcDocLifecycleStatus,
_ServiceDocItemCategory,
_Product
// _Period
}
where
ServiceObjectType = 'BUS2000172'
// and ServiceDocumentItemIsReleased = 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTITEMENHCD",
"P_BUSINESSSOLNORDITMFINDATA",
"P_BUSSOLNORDITMWITHHDRSTAT"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_COUNTRY",
"I_CURRENCY",
"I_CUSTMGMTBUSOBJTYPE",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_PRODUCT",
"I_REGION",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SERVICEDOCITEMCATEGORY",
"I_SERVICEDOCUMENTSTATUS",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCDOCLIFECYCLESTATUS",
"P_BUSINESSSOLNORDITMFINDATA",
"P_BUSSOLNORDITMWITHHDRSTAT"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTITEMENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/