@AbapCatalog.sqlViewName: 'CSRVENHCD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl :{
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@EndUserText.label: 'Get all basic data for Service Order'
@Search.searchable: true
@VDM: {
viewType: #CONSUMPTION //#COMPOSITE
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel: {
representativeKey: 'ServiceOrder',
usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #XXL
}
}
define view C_ServiceOrderEnhcd
as select from I_ServiceDocumentEnhcd
//Use this association when Sold-to party field is used
association [0..1] to C_ServiceDocumentSoldToPartyVH as _SoldToParty on $projection.SoldToParty = _SoldToParty.BusinessPartner
//Use this association when CustomerName field is used
//association [0..1] to C_ServiceDocumentSoldToPartyVH as _SoldToParty on $projection.Customer = _SoldToParty.BusinessPartner
// association [1..*] to C_SrvcOrdItemListRptAndObjPg as _SrvcOrdItemListRptAndObjPg on $projection.ServiceOrder = _SrvcOrdItemListRptAndObjPg.ServiceOrder
association [1..*] to C_ServiceDocObjPgNotes as _ServiceDocumentNotes on $projection.ServiceObjectType = _ServiceDocumentNotes.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentNotes.ServiceDocument
association [1..*] to C_SrvcDocObjPgTransHistory as _ServiceDocumentTransHistory on $projection.ServiceObjectType = _ServiceDocumentTransHistory.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentTransHistory.ServiceDocument
association [1..*] to C_ServiceDocObjPgErrorLog as _ServiceDocumentErrorLog on $projection.ServiceObjectType = _ServiceDocumentErrorLog.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentErrorLog.ServiceDocument
association [0..*] to C_ServiceDocumentPartner as _PartiesInvolved on $projection.ServiceObjectType = _PartiesInvolved.CustMgmtObjectType
and $projection.ServiceOrder = _PartiesInvolved.CustMgmtDocument
and _PartiesInvolved.CustMgmtDocumentItem = '000000'
//OLD
// association [0..1] to C_SrvcDocBusinessPartnerVH as _ServiceTeam on $projection.ServiceTeam = _ServiceTeam.BusinessPartner
// association [0..1] to C_SrvcDocBusinessPartnerVH as _RespEmployee on $projection.ResponsibleEmployee = _RespEmployee.BusinessPartner
// association [1..*] to C_ServiceDocumentItem as _ServiceDocumentItem on $projection.ServiceObjectType = _ServiceDocumentItem.ServiceObjectType
// and $projection.ServiceOrder = _ServiceDocumentItem.ServiceDocument
//Add At outer C_view association [1..*] to C_SrvcConfirmationItem as _SrvcConfItemSrvcOrder on $projection.ServiceOrder = _SrvcConfItemSrvcOrder.ServiceOrder
//Add At outer C_view association [0..1] to E_ServiceDocument as _ServiceDocumentExt on $projection.ServiceObjectType = _ServiceDocumentExt.ServiceCategory
//Add At outer C_view and $projection.ServiceOrder = _ServiceDocumentExt.ServiceOrder
//ENDOLD
{
key ServiceDocument as ServiceOrder,
ServiceDocumentType,
ServiceObjectType,
ServiceDocumentDescription as ServiceOrderDescription,
@Consumption.valueHelp:'_SoldToParty'
SoldToParty,
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.FirstName,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.LastName,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.GroupBusinessPartnerName1,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH,fuzzinessThreshold: 0.8 }
// _SoldToParty.GroupBusinessPartnerName2,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.OrganizationBPName1,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.OrganizationBPName2,
ShipToParty,
BillToParty,
ServiceDocumentPriority as ServiceOrderPriority,
PostingDate,
case ServiceDocumentHasError
when 'X' then 1
when ' ' then 3
else 3
end as ServiceOrdErrorStsCriticality,
ServiceDocumentHasError,
// @ObjectModel.readOnly: true
//
// case ServiceDocumentPriority
// when ' ' then 2
// when '3' then 2 // NEW: yellow colour
// when '5' then 0 // IN_PROGRESS: grey color
// when '9' then 0 // PAID: grey color
// when '1' then 1 // CANCELLED: red color
// else 0
// end as Priority,
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocGrossAmount,
//
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocNetAmount,
//
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocTaxAmount,
//
// @Semantics.currencyCode: true
// TransactionCurrency,
// _ServiceDocumentNotes.ServiceDocNoteText as ServiceOrderNoteText,
ServiceDocumentStatus as ServiceOrderStatus,
case _ServiceDocRefObj.ServiceReferenceObjectType
when 'B' then 'EAMS_FL'
when 'C' then 'EAMS_EQUI'
end as TechObjIsEquipOrFuncnlLoc,
case _ServiceDocRefObj.ServiceReferenceObjectType
when 'B' then cast (_ServiceDocRefObj.FunctionalLocation as eams_tec_obj)
when 'C' then cast (_ServiceDocRefObj.Equipment as eams_tec_obj)
end as TechnicalObject,
@ObjectModel.text.element: ['EquipmentName']
_ServiceDocRefObj.Equipment,
// for equipment ID navigation
_ServiceDocRefObj._Equipment._EquipmentText[1: Language=$session.system_language].EquipmentName as EquipmentName,
@ObjectModel.text.element: ['FunctionalLocationName']
_ServiceDocRefObj.FunctionalLocation,
_ServiceDocRefObj._FunctionalLocation._FunctionalLocationText[1: Language=$session.system_language].FunctionalLocationName as FunctionalLocationName,
_ServiceDocRefObj._Equipment.Material as ReferenceProduct,
_ServiceDocRefObj.ProductID,
_ServiceDocRefObj._Product._Text[1: Language=$session.system_language].ProductName as ProductName,
@Consumption.filter.hidden: true
PaymentTerms,
BusinessActivityCategory,
tstmp_to_dats( RequestedServiceStartDateTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ) as RequestedServiceStartDate,
tstmp_to_dats( RequestedServiceEndDateTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ) as RequestedServiceEndDate,
@Consumption.valueHelp:'_RespEmployee'
ResponsibleEmployee,
@Consumption.valueHelp:'_ServiceTeam'
ServiceTeam,
SoldToPartyCountry,
SoldToPartyRegion,
PurchaseOrderByCustomer,
ServiceEmployee,
ContactPerson,
ServiceDocumentUUID,
ServiceDocumentCharUUID as ServiceOrderUUID,
ServiceDocumentIsQuotation,
ServiceDocumentIsReleased,
ServiceDocumentIsOpen,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocBillingStatusName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as ServiceDocIsRelForBillCritlty,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocOvrlBillgBlkStsName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as SrvcDocOvrlBillgBlkStsCritlty,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocOvrlBillingStsName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 1 )) as ServiceDocOvrlBillgBlkSts,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as ServiceDocOvrlBillingStsCritl,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 1 )) as ServiceDocOvrlBillingSts,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as crmt_boolean ) as PriceIsFixed,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(0 as abap.int4) as OverallCompletionPercent,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(0 as abap.curr(15,2)) as SrvcConfGrossAmount,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( 1 as abap.dec(13,3)) as ServiceDocDuration,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( 1 as abap.dec(13,3)) as ActualDurationInHours,
@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,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesOrganizationOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesOfficeOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesGroupOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
ServiceOrganization,
@Consumption.filter.hidden: true
@UI.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOrganizationOrgUnit_2'
_SalesOrganizationOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOfficeOrgUnit_2'
_SalesOfficeOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesGroupOrgUnit_2'
_SalesGroupOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_ServiceOrganizationOrgUnit_2'
_ServiceOrganizationOrgUnit,
@Consumption.filter.hidden: true
_SalesOrganizationOrgUnit_2,
@Consumption.filter.hidden: true
_SalesOfficeOrgUnit_2,
@Consumption.filter.hidden: true
_SalesGroupOrgUnit_2,
@Consumption.filter.hidden: true
_ServiceOrganizationOrgUnit_2,
_PaymentTerms, //for payment terms
// Associations
_SoldToParty,
_RespEmployee,
_ServiceTeam,
_ServiceEmployee,
_ContactPerson,
_ServiceDocumentType,
_ServiceDocumentPriority,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SrvcDocLifecycleStatus'
_ServiceDocumentStatus,
_SrvcDocLifecycleStatus,
_ServiceDocHasError,
_ActivityCategory,
_ServiceDocRefObj,
// _SrvcOrdItemListRptAndObjPg,
_ServiceDocumentTransHistory,
_ServiceDocumentErrorLog,
_SalesOrganization,
_SalesOffice,
_SalesGroup,
_Division,
_DistributionChannel,
_ServiceDocumentNotes,
_PartiesInvolved
}
where
ServiceObjectType = 'BUS2000116'
and ServiceDocumentIsQuotation != 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EQUIPMENT",
"I_EQUIPMENTTEXT",
"I_FUNCTIONALLOCATION",
"I_FUNCTIONALLOCATIONTEXT",
"I_PRODUCT",
"I_PRODUCTTEXT",
"I_SERVICEDOCUMENTENHCD",
"I_SERVICEDOCUMENTREFOBJECT"
],
"ASSOCIATED":
[
"C_SERVICEDOCOBJPGERRORLOG",
"C_SERVICEDOCOBJPGNOTES",
"C_SERVICEDOCUMENTPARTNER",
"C_SERVICEDOCUMENTSOLDTOPARTYVH",
"C_SRVCDOCOBJPGTRANSHISTORY",
"I_BUSINESSACTIVITYCATEGORY",
"I_BUSINESSPARTNER",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_PAYMENTTERMS",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONUNIT",
"I_SERVICEDOCERRORSTATUS",
"I_SERVICEDOCUMENTPRIORITY",
"I_SERVICEDOCUMENTREFOBJECT",
"I_SERVICEDOCUMENTSTATUS",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCDOCLIFECYCLESTATUS",
"I_SRVCMGMTORGANIZATIONUNIT"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/