C_Customer360ServiceOrder

DDL: C_CUSTOMER360SERVICEORDER Type: view_entity CONSUMPTION

Customer 360 Service Order

C_Customer360ServiceOrder is a Consumption CDS View that provides data about "Customer 360 Service Order" in SAP S/4HANA. It reads from 2 data sources (I_Customer360BusDocSetting, I_ServiceDocumentEnhcd) and exposes 144 fields with key field ServiceOrder. It has 18 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_Customer360BusDocSetting Customer360BusDocSetting inner
I_ServiceDocumentEnhcd ServiceOrder from

Associations (18)

CardinalityTargetAliasCondition
[1..1] C_SrvcOrderDateTimeline _SrvcOrderDateTimeline $projection.ServiceOrder = _SrvcOrderDateTimeline.ServiceDocument
[1..*] C_ServiceDocumentItemRefObject _ServiceDocumentItemRefObject $projection.ServiceOrder = _ServiceDocumentItemRefObject.ServiceDocument and _ServiceDocumentItemRefObject.ServiceDocumentItem = '000000'
[0..1] C_SrvcDocBPContactCardQuickVw _SrvcDocBPContactCard $projection.ContactPersonBusinessPartnerId = _SrvcDocBPContactCard.BusinessPartner
[1..*] C_SrvcDocDateInformation _SrvcDateInfo ( $projection.ServiceOrder = _SrvcDateInfo.ServiceDocument and $projection.ServiceObjectType = _SrvcDateInfo.ServiceObjectType and _SrvcDateInfo.ServiceDocumentItem = '000000' ) or ( $projection.ServiceDocumentUUID = _SrvcDateInfo.SrvcMgmtObjectUUID )
[0..*] C_SrvcDocUserStatus _SrvcOrdUserStatus $projection.ServiceDocumentUUID = _SrvcOrdUserStatus.StatusObjectUUID
[0..*] I_StatusObjectUUIDStatus _SrvcDocSystemStatus $projection.ServiceDocumentUUID = _SrvcDocSystemStatus.StatusObjectUUID and ( _SrvcDocSystemStatus.StatusCode = 'I1002' or _SrvcDocSystemStatus.StatusCode = 'I1003' or _SrvcDocSystemStatus.StatusCode = 'I1004' or _SrvcDocSystemStatus.StatusCode = 'I1005' ) and _SrvcDocSystemStatus.StatusIsActive = 'X'
[0..1] I_CustMgmtLifecycleUserStsText _CustMgmtLifecycleUserStsText $projection.ServiceOrderStatus = _CustMgmtLifecycleUserStsText.CustMgmtLifecycleUserStatus and _CustMgmtLifecycleUserStsText.Language = $session.system_language
[0..*] I_ServiceOrderStdVH _ServiceOrderStdVH $projection.ServiceOrder = _ServiceOrderStdVH.ServiceDocument
[0..1] I_SrvcDocBslnPlannedCost _SrvcDocBslnPlannedCost _SrvcDocBslnPlannedCost.ServiceDocument = $projection.ServiceOrder and _SrvcDocBslnPlannedCost.ServiceDocumentType = $projection.ServiceDocumentType
[0..1] I_SrvcDocBslnPlannedRevenue _SrvcDocBslnPlannedRevenue _SrvcDocBslnPlannedRevenue.ServiceDocument = $projection.ServiceOrder and _SrvcDocBslnPlannedRevenue.ServiceDocumentType = $projection.ServiceDocumentType
[0..1] C_SrvcMgmtSoldToPartyQuickVw _SrvcDocBPBillToParty $projection.BillToParty = _SrvcDocBPBillToParty.BusinessPartner
[0..1] C_SrvcMgmtSoldToPartyQuickVw _SrvcDocBPShipToParty $projection.ShipToParty = _SrvcDocBPShipToParty.BusinessPartner
[0..1] C_SrvcMgmtSoldToPartyQuickVw _SrvcDocBPPayerParty $projection.PayerParty = _SrvcDocBPPayerParty.BusinessPartner
[0..1] I_CustMgmtExtRefID _CustMgmtExtRef $projection.ServiceOrder = _CustMgmtExtRef.CustMgmtDocument and $projection.ServiceObjectType = _CustMgmtExtRef.CustMgmtObjectType and _CustMgmtExtRef.CustMgmtExtRefIDType = '0009'
[0..1] I_SrvcOrdRefMaintenancePlan _RefMaintenancePlan $projection.ServiceDocumentUUID = _RefMaintenancePlan.ServiceDocumentUUID and $projection.ServiceObjectType = _RefMaintenancePlan.ServiceObjectType
[0..1] I_SrvcOrdRefMaintenanceItem _RefMaintenanceItem $projection.ServiceDocumentUUID = _RefMaintenanceItem.ServiceDocumentUUID and $projection.ServiceObjectType = _RefMaintenanceItem.ServiceObjectType
[0..*] I_ServiceDocumentTypeText _ServiceOrderType $projection.ServiceDocumentType = _ServiceOrderType.ServiceDocumentType
[1..*] I_CustomerSEPAMandate _CustomerSEPAMandate $projection.SEPAMandate = _CustomerSEPAMandate.SEPAMandate and _CustomerSEPAMandate.SEPAMandateVersion = '0000'

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Customer 360 Service Order view
Metadata.allowExtensions true view
Search.searchable true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XXL view
VDM.viewType #CONSUMPTION view

Fields (144)

KeyFieldSource TableSource FieldDescription
KEY ServiceOrder I_ServiceDocumentEnhcd ServiceDocument
ServiceDocumentType I_ServiceDocumentEnhcd ServiceDocumentType
ServiceDocumentTypeName
ServiceObjectType I_ServiceDocumentEnhcd ServiceObjectType
ServiceOrderDescription I_ServiceDocumentEnhcd ServiceDocumentDescription
SoldToParty I_ServiceDocumentEnhcd SoldToParty
CompanyContactPersonFullName
BillToPartyName _SrvcDocBPBillToParty BusinessPartnerName
ShipToPartyName _SrvcDocBPShipToParty BusinessPartnerName
PayerPartyName _SrvcDocBPPayerParty BusinessPartnerName
ShipToParty I_ServiceDocumentEnhcd ShipToParty
BillToParty I_ServiceDocumentEnhcd BillToParty
PayerParty I_ServiceDocumentEnhcd PayerParty
ContactPersonBusinessPartnerId I_ServiceDocumentEnhcd ContactPerson
PaymentTerms I_ServiceDocumentEnhcd PaymentTerms
PaymentTermsName
PaymentMethod I_ServiceDocumentEnhcd PaymentMethod
PaymentMethodDescription
SEPAMandate I_ServiceDocumentEnhcd SEPAMandate Mandate Reference
SEPAMandateCreditor _CustomerSEPAMandate SEPAMandateCreditor
SEPAMandateApplication _CustomerSEPAMandate SEPAMandateApplication
CustMgmtExtRefID _CustMgmtExtRef CustMgmtExtRefID
ServiceOrderPriority I_ServiceDocumentEnhcd ServiceDocumentPriority
ServiceDocumentPriorityName
PostingDate I_ServiceDocumentEnhcd PostingDate
ServiceDocumentHasError I_ServiceDocumentEnhcd ServiceDocumentHasError
ServiceDocGrossAmount I_ServiceDocumentEnhcd ServiceDocGrossAmount
ServiceDocNetAmount I_ServiceDocumentEnhcd ServiceDocNetAmount
ServiceDocTaxAmount I_ServiceDocumentEnhcd ServiceDocTaxAmount
TransactionCurrency I_ServiceDocumentEnhcd TransactionCurrency
ServiceDocumentHasErrorName
ServiceOrderStatus I_ServiceDocumentEnhcd ServiceDocumentStatus
Material Reference Product
MaterialType
ProductID
ProductName
BusinessActivityCategory I_ServiceDocumentEnhcd BusinessActivityCategory
RequestedServiceStartDate I_ServiceDocumentEnhcd RequestedServiceStartDate Requested Start
RequestedServiceEndDate I_ServiceDocumentEnhcd RequestedServiceEndDate Requested End
ServiceDocCreationDateTime I_ServiceDocumentEnhcd ServiceDocCreationDateTime Creation Date
RequestedServiceStartDateTime
RequestedServiceEndDateTime
RespEmployeeBusinessPartnerId I_ServiceDocumentEnhcd ResponsibleEmployee
ResponsibleEmployeeName
ServiceTeam I_ServiceDocumentEnhcd ServiceTeam
BusinessPartnerFullName
SoldToPartyCountry I_ServiceDocumentEnhcd SoldToPartyCountry
SoldToPartyRegion I_ServiceDocumentEnhcd SoldToPartyRegion
PurchaseOrderByCustomer I_ServiceDocumentEnhcd PurchaseOrderByCustomer
ServiceEmployee I_ServiceDocumentEnhcd ServiceEmployee
ServiceDocumentUUID I_ServiceDocumentEnhcd ServiceDocumentUUID
ServiceDocumentIsReleased I_ServiceDocumentEnhcd ServiceDocumentIsReleased
ServiceDocumentIsOpen I_ServiceDocumentEnhcd ServiceDocumentIsOpen
ServiceDocumentIsRejected I_ServiceDocumentEnhcd ServiceDocumentIsRejected
SalesOrganization I_ServiceDocumentEnhcd SalesOrganization
SalesOrganizationName
DistributionChannel I_ServiceDocumentEnhcd DistributionChannel
DistributionChannelName
Division I_ServiceDocumentEnhcd Division
DivisionName
SalesOffice I_ServiceDocumentEnhcd SalesOffice
SalesOfficeName
SalesGroup I_ServiceDocumentEnhcd SalesGroup
SalesGroupName
Equipment
EquipmentName
SalesOrganizationOrgUnitID I_ServiceDocumentEnhcd SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID I_ServiceDocumentEnhcd SalesOfficeOrgUnitID
SalesGroupOrgUnitID I_ServiceDocumentEnhcd SalesGroupOrgUnitID
ServiceOrganization I_ServiceDocumentEnhcd ServiceOrganization
RefBusinessSolutionOrder I_ServiceDocumentEnhcd RefBusinessSolutionOrder
SrvcOrdCreditStatus I_ServiceDocumentEnhcd SrvcDocCreditStatus
SrvcDocCreditStatusText
_SalesOrganizationOrgUnit_2 I_ServiceDocumentEnhcd _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit_2 I_ServiceDocumentEnhcd _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit_2 I_ServiceDocumentEnhcd _SalesGroupOrgUnit_2
_ServiceOrganizationOrgUnit_2 I_ServiceDocumentEnhcd _ServiceOrganizationOrgUnit_2
RespyMgmtServiceTeam I_ServiceDocumentEnhcd RespyMgmtServiceTeam
RespyMgmtServiceTeamDesc
RespyMgmtServiceTeamName
ActualServiceStartDateTime
PlannedServiceEndDateTime
PlannedServiceStartDateTime
ServiceFirstResponseByDateTime
SrvcDocItemSLADueByDateTime
MaintenancePlan _RefMaintenancePlan MaintenancePlan
MaintenancePlanDesc _RefMaintenancePlan MaintenancePlanDesc
SrvcDocBslnCostPostgStatus I_ServiceDocumentEnhcd SrvcDocBslnCostPostgStatus
SrvcDocBslnCostPostgStatusText
SrvcDocTransferStatus I_ServiceDocumentEnhcd SrvcDocTransferStatus
SrvcDocTransferStatusText
MaintenanceItem _RefMaintenanceItem MaintenanceItem
MaintenanceItemDescription _RefMaintenanceItem MaintenanceItemDescription
SystemStatus _SrvcDocSystemStatus StatusCode
StatusProfile
SrvcDocBslnPlndCostAmount _SrvcDocBslnPlannedCost SrvcDocBslnPlndCostAmount
SrvcDocBslnPlndRevenueAmount _SrvcDocBslnPlannedRevenue SrvcDocBslnPlndRevenueAmount
Customer
SitnNumberOfInstances
SitnNmbrOfInstceInHierarchy
SrvcDocSituationStatusText
SrvcDocSituationStatus
_SoldToParty I_ServiceDocumentEnhcd _SoldToParty
_ShipToParty I_ServiceDocumentEnhcd _ShipToParty
_BillToParty I_ServiceDocumentEnhcd _BillToParty
_PayerParty I_ServiceDocumentEnhcd _PayerParty
_RespEmployee I_ServiceDocumentEnhcd _RespEmployee
_ServiceTeam I_ServiceDocumentEnhcd _ServiceTeam
_ServiceEmployee I_ServiceDocumentEnhcd _ServiceEmployee
_ContactPerson I_ServiceDocumentEnhcd _ContactPerson
_ServiceDocumentType I_ServiceDocumentEnhcd _ServiceDocumentType
_ServiceDocumentPriority I_ServiceDocumentEnhcd _ServiceDocumentPriority
_ServiceDocumentStatus I_ServiceDocumentEnhcd _ServiceDocumentStatus
_ServiceDocHasError I_ServiceDocumentEnhcd _ServiceDocHasError
_ActivityCategory I_ServiceDocumentEnhcd _ActivityCategory
_ServiceDocRefObj I_ServiceDocumentEnhcd _ServiceDocRefObj
_SrvcDocBPContactCard _SrvcDocBPContactCard
_SalesOrganization I_ServiceDocumentEnhcd _SalesOrganization
_SalesOffice I_ServiceDocumentEnhcd _SalesOffice
_SalesGroup I_ServiceDocumentEnhcd _SalesGroup
_Division I_ServiceDocumentEnhcd _Division
_DistributionChannel I_ServiceDocumentEnhcd _DistributionChannel
_PaymentTerms I_ServiceDocumentEnhcd _PaymentTerms
_PaymentMethod I_ServiceDocumentEnhcd _PaymentMethod
_Product
_SrvcDocCreditStatus I_ServiceDocumentEnhcd _SrvcDocCreditStatus
_SrvcDocBPSoldToParty I_ServiceDocumentEnhcd _SrvcDocBPSoldToParty
_SrvcDocBPBillToParty _SrvcDocBPBillToParty
_SrvcDocBPShipToParty _SrvcDocBPShipToParty
_SrvcDocBPPayerParty _SrvcDocBPPayerParty
_ServiceDocumentItemRefObject _ServiceDocumentItemRefObject
_SrvcDateInfo _SrvcDateInfo
_CustomerSEPAMandate _CustomerSEPAMandate
_SrvcOrdUserStatus _SrvcOrdUserStatus
_SrvcDocSystemStatus _SrvcDocSystemStatus
_CustMgmtLifecycleUserStsText _CustMgmtLifecycleUserStsText
_ServiceOrderStdVH _ServiceOrderStdVH
_SrvcDocBslnPlannedCost _SrvcDocBslnPlannedCost
_SrvcDocBslnPlannedRevenue _SrvcDocBslnPlannedRevenue
_ServiceObjType I_ServiceDocumentEnhcd _ServiceObjType
_SrvcDocBslnCostPostgStatus I_ServiceDocumentEnhcd _SrvcDocBslnCostPostgStatus
_SrvcDocTransferStatus I_ServiceDocumentEnhcd _SrvcDocTransferStatus
_ServiceOrderType _ServiceOrderType
_Equipment
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Customer 360 Service Order'
@Metadata.allowExtensions: true
@Search.searchable: true
@ObjectModel: {
//   compositionRoot: true,

//   representativeKey: 'SalesDocument',

   usageType: {
 dataClass:      #MIXED,
     serviceQuality: #C,
     sizeCategory:   #XXL
   }
}
@VDM.viewType: #CONSUMPTION

define view entity C_Customer360ServiceOrder
  as select from I_ServiceDocumentEnhcd     as ServiceOrder
    inner join   I_Customer360BusDocSetting as Customer360BusDocSetting on  Customer360BusDocSetting.Cust360BusDocCategory     = 'SVO'
                                                                        and Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'

  association [1..1] to C_SrvcOrderDateTimeline        as _SrvcOrderDateTimeline        on  $projection.ServiceOrder = _SrvcOrderDateTimeline.ServiceDocument

  association [1..*] to C_ServiceDocumentItemRefObject as _ServiceDocumentItemRefObject on  $projection.ServiceOrder                          = _ServiceDocumentItemRefObject.ServiceDocument
                                                                                        and _ServiceDocumentItemRefObject.ServiceDocumentItem = '000000'
  association [0..1] to C_SrvcDocBPContactCardQuickVw  as _SrvcDocBPContactCard         on  $projection.ContactPersonBusinessPartnerId = _SrvcDocBPContactCard.BusinessPartner

  association [1..*] to C_SrvcDocDateInformation       as _SrvcDateInfo                 on  (
                      $projection.ServiceOrder                                                                              = _SrvcDateInfo.ServiceDocument
                      and $projection.ServiceObjectType                                                                     = _SrvcDateInfo.ServiceObjectType
                      and _SrvcDateInfo.ServiceDocumentItem                                                                 = '000000'
                    )
                                                                                        or  (
                                                                                            $projection.ServiceDocumentUUID = _SrvcDateInfo.SrvcMgmtObjectUUID
                                                                                          )
  association [0..*] to C_SrvcDocUserStatus            as _SrvcOrdUserStatus            on  $projection.ServiceDocumentUUID = _SrvcOrdUserStatus.StatusObjectUUID

  association [0..*] to I_StatusObjectUUIDStatus       as _SrvcDocSystemStatus          on  $projection.ServiceDocumentUUID     = _SrvcDocSystemStatus.StatusObjectUUID
                                                                                        and (
                                                                                           _SrvcDocSystemStatus.StatusCode      = 'I1002'
                                                                                           or _SrvcDocSystemStatus.StatusCode   = 'I1003'
                                                                                           or _SrvcDocSystemStatus.StatusCode   = 'I1004'
                                                                                           or _SrvcDocSystemStatus.StatusCode   = 'I1005'
                                                                                         )
                                                                                        and _SrvcDocSystemStatus.StatusIsActive = 'X'

  association [0..1] to I_CustMgmtLifecycleUserStsText as _CustMgmtLifecycleUserStsText on  $projection.ServiceOrderStatus         = _CustMgmtLifecycleUserStsText.CustMgmtLifecycleUserStatus
                                                                                        and _CustMgmtLifecycleUserStsText.Language = $session.system_language

  association [0..*] to I_ServiceOrderStdVH            as _ServiceOrderStdVH            on  $projection.ServiceOrder = _ServiceOrderStdVH.ServiceDocument


  association [0..1] to I_SrvcDocBslnPlannedCost       as _SrvcDocBslnPlannedCost       on  _SrvcDocBslnPlannedCost.ServiceDocument     = $projection.ServiceOrder
                                                                                        and _SrvcDocBslnPlannedCost.ServiceDocumentType = $projection.ServiceDocumentType


  association [0..1] to I_SrvcDocBslnPlannedRevenue    as _SrvcDocBslnPlannedRevenue    on  _SrvcDocBslnPlannedRevenue.ServiceDocument     = $projection.ServiceOrder
                                                                                        and _SrvcDocBslnPlannedRevenue.ServiceDocumentType = $projection.ServiceDocumentType

  association [0..1] to C_SrvcMgmtSoldToPartyQuickVw   as _SrvcDocBPBillToParty         on  $projection.BillToParty = _SrvcDocBPBillToParty.BusinessPartner
  association [0..1] to C_SrvcMgmtSoldToPartyQuickVw   as _SrvcDocBPShipToParty         on  $projection.ShipToParty = _SrvcDocBPShipToParty.BusinessPartner

  association [0..1] to C_SrvcMgmtSoldToPartyQuickVw   as _SrvcDocBPPayerParty          on  $projection.PayerParty = _SrvcDocBPPayerParty.BusinessPartner
  association [0..1] to I_CustMgmtExtRefID             as _CustMgmtExtRef               on  $projection.ServiceOrder             = _CustMgmtExtRef.CustMgmtDocument
                                                                                        and $projection.ServiceObjectType        = _CustMgmtExtRef.CustMgmtObjectType
                                                                                        and _CustMgmtExtRef.CustMgmtExtRefIDType = '0009'

  association [0..1] to I_SrvcOrdRefMaintenancePlan    as _RefMaintenancePlan           on  $projection.ServiceDocumentUUID = _RefMaintenancePlan.ServiceDocumentUUID
                                                                                        and $projection.ServiceObjectType   = _RefMaintenancePlan.ServiceObjectType

  association [0..1] to I_SrvcOrdRefMaintenanceItem    as _RefMaintenanceItem           on  $projection.ServiceDocumentUUID = _RefMaintenanceItem.ServiceDocumentUUID
                                                                                        and $projection.ServiceObjectType   = _RefMaintenanceItem.ServiceObjectType

  association [0..*] to I_ServiceDocumentTypeText      as _ServiceOrderType             on  $projection.ServiceDocumentType = _ServiceOrderType.ServiceDocumentType

  association [1..*] to I_CustomerSEPAMandate          as _CustomerSEPAMandate          on  $projection.SEPAMandate                 = _CustomerSEPAMandate.SEPAMandate
                                                                                        and _CustomerSEPAMandate.SEPAMandateVersion = '0000'

{
       @ObjectModel.readOnly: true
       @Search.defaultSearchElement: true
       @Search.fuzzinessThreshold: 0.8
       @Search.ranking: #HIGH
       @Consumption.valueHelp: '_ServiceOrderStdVH'
  key  ServiceOrder.ServiceDocument                                                                                                                   as ServiceOrder,
       @ObjectModel.text.element: ['ServiceDocumentTypeName']
       ServiceOrder.ServiceDocumentType,
       @UI.hidden: true
       _ServiceOrderType[1:Language = $session.system_language].ServiceDocumentTypeName                                                               as ServiceDocumentTypeName,

       ServiceOrder.ServiceObjectType,

       @Search.defaultSearchElement: true
       @Search.fuzzinessThreshold:0.9
       @Search.ranking : #MEDIUM
       ServiceOrder.ServiceDocumentDescription                                                                                                        as ServiceOrderDescription,

       //  //For Quick View

       @ObjectModel.foreignKey.association: '_SrvcDocBPSoldToParty'
       ServiceOrder.SoldToParty,
       //       @UI.hidden: true

       //       ServiceOrder._SoldToParty.BusinessPartnerName                                                                               as BusinessPartnerName,

       @UI.hidden: true
       ServiceOrder._ContactPerson.BusinessPartnerName                                                                                                as CompanyContactPersonFullName,
       @UI.hidden: true
       _SrvcDocBPBillToParty.BusinessPartnerName                                                                                                      as BillToPartyName,
       @UI.hidden: true
       _SrvcDocBPShipToParty.BusinessPartnerName                                                                                                      as ShipToPartyName,
       @UI.hidden: true
       _SrvcDocBPPayerParty.BusinessPartnerName                                                                                                       as PayerPartyName,

       @ObjectModel.text.element: ['ShipToPartyName']
       @ObjectModel.foreignKey.association: '_SrvcDocBPShipToParty'
       ServiceOrder.ShipToParty,

       @ObjectModel.text.element: ['BillToPartyName']
       @ObjectModel.foreignKey.association: '_SrvcDocBPBillToParty'
       ServiceOrder.BillToParty,

       @ObjectModel.text.element: ['PayerPartyName']
       @ObjectModel.foreignKey.association: '_SrvcDocBPPayerParty'
       ServiceOrder.PayerParty,

       @ObjectModel.text.element: [ 'CompanyContactPersonFullName' ]
       @ObjectModel.foreignKey.association: '_SrvcDocBPContactCard'
       @Consumption.semanticObject: 'ContactCardSemanticObjectID'
       ServiceOrder.ContactPerson                                                                                                                     as ContactPersonBusinessPartnerId,


       @ObjectModel.text.element: ['PaymentTermsName']
       @ObjectModel.foreignKey.association: '_PaymentTerms'
       ServiceOrder.PaymentTerms,
       @UI.hidden: true
       ServiceOrder._PaymentTerms._Text[1:Language = $session.system_language].PaymentTermsName,

       @ObjectModel.text.element: ['PaymentMethodDescription']
       @ObjectModel.foreignKey.association: '_PaymentMethod'
       ServiceOrder.PaymentMethod,

       @UI.hidden: true
       ServiceOrder._PaymentMethod[1:SalesOrganization = $projection.salesorganization ].PaymentMethodDescription                                     as PaymentMethodDescription,
       @EndUserText.label: 'Mandate Reference'
       ServiceOrder.SEPAMandate,
       @UI.hidden: true
       _CustomerSEPAMandate.SEPAMandateCreditor,
       @UI.hidden: true
       _CustomerSEPAMandate.SEPAMandateApplication,


       _CustMgmtExtRef.CustMgmtExtRefID,
       @ObjectModel.text.element: ['ServiceDocumentPriorityName']
       ServiceOrder.ServiceDocumentPriority                                                                                                           as ServiceOrderPriority,
       @UI.hidden: true
       ServiceOrder._ServiceDocumentPriority._ServiceDocumentPriorityText[1:Language = $session.system_language].ServiceDocumentPriorityName          as ServiceDocumentPriorityName,

       ServiceOrder.PostingDate,

       case ServiceOrder.ServiceDocumentHasError
        when 'X' then 1
        when ' ' then 0
        else 0
       end                                                                                                                                            as ServiceOrdErrorStsCriticality,



       @ObjectModel.text.element: ['ServiceDocumentHasErrorName']
       ServiceOrder.ServiceDocumentHasError,

       //       @ObjectModel.readOnly: true

       //

       //       Priority,


       @Semantics.amount.currencyCode: 'TransactionCurrency'
       ServiceOrder.ServiceDocGrossAmount,

       @Semantics.amount.currencyCode: 'TransactionCurrency'
       ServiceOrder.ServiceDocNetAmount,

       @Semantics.amount.currencyCode: 'TransactionCurrency'
       ServiceOrder.ServiceDocTaxAmount,

       //       @Semantics.currencyCode: true

       ServiceOrder.TransactionCurrency,
       @UI.hidden: true
       ServiceOrder._ServiceDocHasError._ServiceDocHasErrorText[1:Language = $session.system_language].ServiceDocumentHasErrorName                    as ServiceDocumentHasErrorName,

       @ObjectModel.text.element: [ 'ServiceOrderStatusName' ]
       ServiceOrder.ServiceDocumentStatus                                                                                                             as ServiceOrderStatus,

       //       case ServiceOrder._ServiceDocRefObj.ServiceReferenceObjectType

       //       when 'B' then 'EAMS_FL'

       //       when 'C' then 'EAMS_EQUI'

       //       end as TechObjIsEquipOrFuncnlLoc,



       case ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000'].ServiceReferenceObjectType
       when 'B' then cast (ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000'].FunctionalLocation as eams_tec_obj)
       when 'C' then cast (ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000'].Equipment as eams_tec_obj)
       end                                                                                                                                            as TechnicalObject,


       //  _SrvcOrdItemListRptAndObjPg[ServiceFirstResponseByDateTime = min(ServiceFirstResponseByDateTime)].ServiceFirstResponseByDateTime As ServiceFirstResponseByDate,



       // @ObjectModel.text.element: ['FunctionalLocationName']

       //       FunctionalLocation,


       //       FunctionalLocationName,

       //       @EndUserText.label: 'Reference Product'

       //       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Equipment.Material                                                                          as ReferenceProduct,

       @ObjectModel.text.element: ['MaterialType']
       @EndUserText.label: 'Reference Product'
       @UI.textArrangement: #TEXT_SEPARATE
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Equipment.Material,
       @UI.hidden: true
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Equipment._Material.MaterialType                                             as MaterialType,


       @ObjectModel.text.element: ['ProductName']
       @ObjectModel.foreignKey.association: '_Product'
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000'].ProductID,
       @UI.hidden: true
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Product._Text[1:Language=$session.system_language].ProductName               as ProductName,


       ServiceOrder.BusinessActivityCategory,

       @EndUserText.label: 'Requested Start'
       ServiceOrder.RequestedServiceStartDate,

       @EndUserText.label: 'Requested End'
       ServiceOrder.RequestedServiceEndDate,

       @EndUserText.label: 'Creation Date'
       ServiceOrder.ServiceDocCreationDateTime,
       
       @UI.hidden: true
       cast (ServiceOrder.RequestedServiceStartDateTime as timestamp)                                                                                 as RequestedServiceStartDateTime,
       @UI.hidden: true
       cast (ServiceOrder.RequestedServiceEndDateTime as timestamp)                                                                                   as RequestedServiceEndDateTime,


       @ObjectModel.text.element: ['ResponsibleEmployeeName']
       ServiceOrder.ResponsibleEmployee                                                                                                               as RespEmployeeBusinessPartnerId,

       @UI.hidden: true
       ServiceOrder._RespEmployee.BusinessPartnerName                                                                                                 as ResponsibleEmployeeName,

       @ObjectModel.text.element: ['BusinessPartnerFullName']
       @ObjectModel.foreignKey.association: '_ServiceTeam'
       @Consumption.valueHelp:'_ServiceTeam'
       ServiceOrder.ServiceTeam,

       @UI.hidden: true
       ServiceOrder._ServiceTeam.BusinessPartnerFullName                                                                                              as BusinessPartnerFullName,

       ServiceOrder.SoldToPartyCountry,

       ServiceOrder.SoldToPartyRegion,

       ServiceOrder.PurchaseOrderByCustomer,

       ServiceOrder.ServiceEmployee,

       ServiceOrder.ServiceDocumentUUID,
       //       @ObjectModel.foreignKey.association: '_'

       //       ServiceOrder.ServiceDocumentIsQuotation,

       ServiceOrder.ServiceDocumentIsReleased,
       ServiceOrder.ServiceDocumentIsOpen,
       ServiceOrder.ServiceDocumentIsRejected,

       @ObjectModel.foreignKey.association: '_SalesOrganization'
       @ObjectModel.text.element: ['SalesOrganizationName']
       ServiceOrder.SalesOrganization,
       @UI.hidden: true
       ServiceOrder._SalesOrganization._Text[1:Language = $session.system_language].SalesOrganizationName                                             as SalesOrganizationName,

       //       ServiceOrder.SalesOrganization,


       @ObjectModel.foreignKey.association: '_DistributionChannel'
       @ObjectModel.text.element: ['DistributionChannelName']
       ServiceOrder.DistributionChannel,
       @UI.hidden: true
       ServiceOrder._DistributionChannel._Text[1:Language = $session.system_language].DistributionChannelName                                         as DistributionChannelName,

       //       ServiceOrder.DistributionChannel,


       @ObjectModel.foreignKey.association: '_Division'
       @ObjectModel.text.element: ['DivisionName']
       ServiceOrder.Division,
       @UI.hidden: true
       ServiceOrder._Division._Text[1:Language = $session.system_language].DivisionName                                                               as DivisionName,

       //       ServiceOrder.Division,


       @ObjectModel.foreignKey.association: '_SalesOffice'
       @ObjectModel.text.element: ['SalesOfficeName']
       ServiceOrder.SalesOffice,
       @UI.hidden: true
       ServiceOrder._SalesOffice._Text[1:Language = $session.system_language].SalesOfficeName                                                         as SalesOfficeName,


       @ObjectModel.foreignKey.association: '_SalesGroup'
       @ObjectModel.text.element: ['SalesGroupName']
       ServiceOrder.SalesGroup,
       @UI.hidden: true
       ServiceOrder._SalesGroup._Text[1:Language = $session.system_language].SalesGroupName                                                           as SalesGroupName,



       // Reference Section

       @ObjectModel.text.element: ['EquipmentName']
       @ObjectModel.foreignKey.association: '_Equipment'
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000'].Equipment,
       @UI.hidden: true
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Equipment._EquipmentText[1: Language=$session.system_language].EquipmentName as EquipmentName,


       // On-Premise Sales Org., Sales Office, Sales Group, Service Org.

       @ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit_2'
       ServiceOrder.SalesOrganizationOrgUnitID,

       @ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit_2'
       ServiceOrder.SalesOfficeOrgUnitID,

       @ObjectModel.foreignKey.association: '_SalesGroupOrgUnit_2'
       ServiceOrder.SalesGroupOrgUnitID,

       @ObjectModel.foreignKey.association: '_ServiceOrganizationOrgUnit_2'
       @UI.hidden: true
       ServiceOrder.ServiceOrganization,

       ServiceOrder.RefBusinessSolutionOrder,

       @ObjectModel.text.element: ['SrvcDocCreditStatusText']
       ServiceOrder.SrvcDocCreditStatus                                                                                                               as SrvcOrdCreditStatus,
       @UI.hidden: true
       ServiceOrder._SrvcDocCreditStatus._SrvcDocCreditStatusText[1:Language = $session.system_language].SrvcDocCreditStatusText                      as SrvcDocCreditStatusText,


       @UI.hidden: true
       case ServiceOrder.SrvcDocCreditStatus
         when ' ' then 0
         else 1
       end                                                                                                                                            as UICT_SrvcOrdCreditStatus,

       case ServiceOrder.SrvcDocCreditStatus
          when 'A' then 0
          when 'B' then 3
          when 'C' then 1
          when 'D' then 2
          else 0
       end                                                                                                                                            as SrvcOrdCrdtStsCriticality,

       @Consumption.filter.hidden: true
       ServiceOrder._SalesOrganizationOrgUnit_2,




       @Consumption.filter.hidden: true
       ServiceOrder._SalesOfficeOrgUnit_2,


       @Consumption.filter.hidden: true
       ServiceOrder._SalesGroupOrgUnit_2,


       @Consumption.filter.hidden: true
       ServiceOrder._ServiceOrganizationOrgUnit_2,

       // On-Premise changes end


       //   @ObjectModel.foreignKey.association: '_ServiceTeamHeader'

       ServiceOrder.RespyMgmtServiceTeam,
       @UI.hidden: true
       ServiceOrder._ServiceTeamHeader._TeamDescription.TeamDescription                                                                               as RespyMgmtServiceTeamDesc,
       @UI.hidden: true
       @ObjectModel.text.element:['RespyMgmtServiceTeamDesc']
       ServiceOrder._ServiceTeamHeader.TeamName                                                                                                       as RespyMgmtServiceTeamName,

       cast (_SrvcOrderDateTimeline.ActualServiceStartDateTime as timestamp)                                                                          as ActualServiceStartDateTime,
       cast (_SrvcOrderDateTimeline.PlannedServiceEndDateTime as timestamp)                                                                           as PlannedServiceEndDateTime,
       cast (_SrvcOrderDateTimeline.PlannedServiceStartDateTime as timestamp)                                                                         as PlannedServiceStartDateTime,
       //           tstmp_to_dats(_SrvcOrderDateTimeline.PlannedServiceStartDateTime,

       //                      abap_user_timezone($session.user, $session.client,'NULL' ),

       //                      $session.client,

       //                     'NULL' )     as PlannedServiceStartDateTime,

       //cast(substring(cast(_SrvcOrderDateTimeline.PlannedServiceStartDateTime as abap.char(32)),1,16) as abap.dats ) as PlannedServiceStartDateTime,

       //  cast(substring(cast(_SrvcOrderDateTimeline.PlannedServiceStartDateTime) as timestamp ) ) as PlannedServiceStartDateTime,

       cast (_SrvcOrderDateTimeline.ServiceFirstResponseByDateTime as timestamp)                                                                      as ServiceFirstResponseByDateTime,
       cast(_SrvcOrderDateTimeline.SrvcDocItemSLADueByDateTime as timestamp)                                                                          as SrvcDocItemSLADueByDateTime,

       @ObjectModel.text.element: ['MaintenancePlanDesc']
       _RefMaintenancePlan.MaintenancePlan                                                                                                            as MaintenancePlan,
       @UI.hidden: true
       _RefMaintenancePlan.MaintenancePlanDesc                                                                                                        as MaintenancePlanDesc,

       @ObjectModel.text.element: ['SrvcDocBslnCostPostgStatusText']
       @Consumption.valueHelp:'_SrvcDocBslnCostPostgStatus'
       ServiceOrder.SrvcDocBslnCostPostgStatus,
       @UI.hidden: true
       ServiceOrder._SrvcDocBslnCostPostgStatus._Text[1:Language = $session.system_language].SrvcDocBslnCostPostgStatusText,


       @ObjectModel.text.element: ['SrvcDocTransferStatusText']
       @Consumption.valueHelp:'_SrvcDocTransferStatus'
       ServiceOrder.SrvcDocTransferStatus,
       ServiceOrder._SrvcDocTransferStatus._ServiceDocTransferStatusText[1:Language = $session.system_language].SrvcDocTransferStatusText,

       @ObjectModel.text.element: ['MaintenanceItemDescription']
       _RefMaintenanceItem.MaintenanceItem                                                                                                            as MaintenanceItem,
       @UI.hidden: true
       _RefMaintenanceItem.MaintenanceItemDescription                                                                                                 as MaintenanceItemDescription,

       _SrvcDocSystemStatus.StatusCode                                                                                                                as SystemStatus,
       ServiceOrder._ServiceDocumentType.StatusProfile,
       @UI.hidden: true
       case
           when ServiceOrder._ServiceDocumentType.StatusProfile <> '' and _CustMgmtLifecycleUserStsText[1:Language = $session.system_language].CustMgmtLifecycleUserStatus <> ''
            then _CustMgmtLifecycleUserStsText[1:Language = $session.system_language].CustMgmtLifecycleUserStsName
           when ServiceOrder._ServiceDocumentType.StatusProfile = ''
            then ServiceOrder._ServiceDocumentStatus._ServiceDocumentStatusText[1:Language = $session.system_language].ServiceDocumentStatusName
           else ServiceOrder._ServiceDocumentStatus._ServiceDocumentStatusText[1:Language = $session.system_language].ServiceDocumentStatusName
       end                                                                                                                                            as ServiceOrderStatusName,

       @Semantics.amount.currencyCode: 'TransactionCurrency'
       _SrvcDocBslnPlannedCost.SrvcDocBslnPlndCostAmount                                                                                              as SrvcDocBslnPlndCostAmount,

       @Semantics.amount.currencyCode: 'TransactionCurrency'
       _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount                                                                                        as SrvcDocBslnPlndRevenueAmount,

       ServiceOrder._SoldToPartyToCustomer.Customer,


       // Situations

       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast ( 0 as sit_de_inst_count )                                                                                                                as SitnNumberOfInstances,

       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast ( 0 as sit_de_inst_count )                                                                                                                as SitnNmbrOfInstceInHierarchy,

       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast ('' as val_text)                                                                                                                          as SrvcDocSituationStatusText,

       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       @ObjectModel.filter.transformedBy:'ABAP:CL_CRMS4_MANG_SRVHDR_FLTR_EXIT'
       @ObjectModel.text.element: ['SrvcDocSituationStatusText']
       @Semantics.booleanIndicator:true
       cast( '' as crmt_boolean )                                                                                                                     as SrvcDocSituationStatus,



       // Associations

       ServiceOrder._SoldToParty,

       ServiceOrder._ShipToParty,

       ServiceOrder._BillToParty,

       ServiceOrder._PayerParty,

       ServiceOrder._RespEmployee,

       ServiceOrder._ServiceTeam,

       ServiceOrder._ServiceEmployee,

       ServiceOrder._ContactPerson,

       ServiceOrder._ServiceDocumentType,

       ServiceOrder._ServiceDocumentPriority,

       ServiceOrder._ServiceDocumentStatus,

       ServiceOrder._ServiceDocHasError,

       ServiceOrder._ActivityCategory,

       ServiceOrder._ServiceDocRefObj,

       @Consumption.filter.hidden: true
       _SrvcDocBPContactCard,

       ServiceOrder._SalesOrganization,

       ServiceOrder._SalesOffice,

       ServiceOrder._SalesGroup,

       ServiceOrder._Division,

       ServiceOrder._DistributionChannel,

       ServiceOrder._PaymentTerms,
       ServiceOrder._PaymentMethod,
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Product                                                                      as _Product,

       // Credit Status association

       ServiceOrder._SrvcDocCreditStatus,


       ServiceOrder._SrvcDocBPSoldToParty,
       _SrvcDocBPBillToParty,
       _SrvcDocBPShipToParty,
       _SrvcDocBPPayerParty,
       _ServiceDocumentItemRefObject,

       _SrvcDateInfo,
       _CustomerSEPAMandate,

       _SrvcOrdUserStatus,
       _SrvcDocSystemStatus,
       _CustMgmtLifecycleUserStsText,
       _ServiceOrderStdVH,

       _SrvcDocBslnPlannedCost,
       _SrvcDocBslnPlannedRevenue,
       ServiceOrder._ServiceObjType,
       // Baseline Cost Posting Status

       ServiceOrder._SrvcDocBslnCostPostgStatus,
       ServiceOrder._SrvcDocTransferStatus,
       _ServiceOrderType,
       @Consumption.filter.hidden: true
       ServiceOrder._ServiceDocRefObj[1:ServiceDocumentItem = '000000']._Equipment


}
where
      ServiceOrder.ServiceObjectType          =  'BUS2000116'
  and ServiceOrder.ServiceDocumentIsQuotation <> 'X'
  and ServiceOrder.ServiceDocCreationDateTime >  dats_tims_to_tstmp(dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), - Customer360BusDocSetting.BusDocumentDurationInDays, 'INITIAL'), tstmp_to_tims(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL')
  and ServiceOrder.ServiceDocCreationDateTime <= tstmp_current_utctimestamp()