I_ServiceOrderEnhcd

DDL: I_SERVICEORDERENHCD SQL: ISRVENHCD Type: view COMPOSITE Package: CRMS4_SERV_COMMON

Get all basic data for Service Order

I_ServiceOrderEnhcd is a Composite CDS View that provides data about "Get all basic data for Service Order" in SAP S/4HANA. It reads from 1 data source (I_ServiceDocumentEnhcd) and exposes 161 fields with key field ServiceOrder. It has 26 associations to related views. Part of development package CRMS4_SERV_COMMON.

Data Sources (1)

SourceAliasJoin Type
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd from

Associations (26)

CardinalityTargetAliasCondition
[0..1] C_ServiceDocumentSoldToPartyVH _SoldToParty $projection.SoldToParty = _SoldToParty.BusinessPartner
[1..*] C_ServiceDocObjPgNotes _ServiceDocumentNotes $projection.ServiceObjectType = _ServiceDocumentNotes.ServiceObjectType and $projection.ServiceOrder = _ServiceDocumentNotes.ServiceDocument
[1..*] C_SrvcOrdFUPSrvcConfTransHist _SrvcOrdFUPSrvcConfTransHist $projection.ServiceOrder = _SrvcOrdFUPSrvcConfTransHist.ServiceOrder and $projection.ServiceObjectType = _SrvcOrdFUPSrvcConfTransHist.ServiceObjectType
[1..*] C_SrvcDocDocumentFlow _SrvcDocDocumentFlow $projection.ServiceOrder = _SrvcDocDocumentFlow.ServiceOrder
[1..*] C_ServiceDocObjPgErrorLog _ServiceDocumentErrorLog $projection.ServiceObjectType = _ServiceDocumentErrorLog.ServiceObjectType and $projection.ServiceOrder = _ServiceDocumentErrorLog.ServiceDocument
[0..*] C_ServiceDocumentPartner _PartiesInvolved $projection.ServiceObjectType = _PartiesInvolved.CustMgmtObjectType and $projection.ServiceOrder = _PartiesInvolved.CustMgmtDocument and _PartiesInvolved.CustMgmtDocumentItem = '000000'
[1..*] C_SrvcOrderObjPgPricingDets _ServiceOrderPriceDets $projection.ServiceObjectType = _ServiceOrderPriceDets.ServiceObjectType and $projection.ServiceOrder = _ServiceOrderPriceDets.ServiceDocument
[0..1] I_CustMgmtExtRefID _CustMgmtExtRef $projection.ServiceOrder = _CustMgmtExtRef.CustMgmtDocument and $projection.ServiceObjectType = _CustMgmtExtRef.CustMgmtObjectType and _CustMgmtExtRef.CustMgmtExtRefIDSequenceNumber = '000001' and _CustMgmtExtRef.CustMgmtExtRefIDType = '0001'
[1..1] C_ServiceOrderTypeVH _ServiceOrderType $projection.ServiceDocumentType = _ServiceOrderType.ServiceOrderType
[1..1] C_SrvcMgmtCntctPersnQuickVw _SrvcDocBPContactCard $projection.ContactPerson = _SrvcDocBPContactCard.BusinessPartner and $projection.SoldToParty = _SrvcDocBPContactCard.SoldToParty
[0..1] C_SrvcMgmtSoldToPartyQuickVw _SrvcDocBPSoldToParty $projection.SoldToParty = _SrvcDocBPSoldToParty.BusinessPartner and $projection.customer = _SrvcDocBPSoldToParty.Customer
[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_BusinessSolutionOrderStdVH _SolutionOrderVH $projection.RefBusinessSolutionOrder = _SolutionOrderVH.BusinessSolutionOrder
[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..*] C_SrvcDocChangeDocument _ChangeDocument $projection.ServiceOrderUUID = _ChangeDocument.ChangeDocObject
[1..*] I_CustomerSEPAMandate _CustomerSEPAMandate $projection.SEPAMandate = _CustomerSEPAMandate.SEPAMandate and _CustomerSEPAMandate.SEPAMandateVersion = '0000'
[0..1] I_SrvcDocBslnPlannedCost _SrvcDocBslnPlannedCost _SrvcDocBslnPlannedCost.ServiceDocument = $projection.ServiceOrder and _SrvcDocBslnPlannedCost.ServiceDocumentType = $projection.ServiceDocumentType
[1..1] I_SEPAMandateStatus _SEPAMandateStatus $projection.SEPAMandateStatus = _SEPAMandateStatus.SEPAMandateStatus
[0..1] I_SrvcDocBslnPlannedRevenue _SrvcDocBslnPlannedRevenue _SrvcDocBslnPlannedRevenue.ServiceDocument = $projection.ServiceOrder and _SrvcDocBslnPlannedRevenue.ServiceDocumentType = $projection.ServiceDocumentType
[0..1] I_SrvcDocContnsPlannedCost _SrvcDocContinuousPlannedCost _SrvcDocContinuousPlannedCost.ServiceDocument = $projection.ServiceOrder and _SrvcDocContinuousPlannedCost.ServiceDocumentType = $projection.ServiceDocumentType
[0..1] I_SrvcDocContnsPlannedRevenue _SrvcDocContinuousPlannedRevn _SrvcDocContinuousPlannedRevn.ServiceDocument = $projection.ServiceOrder and _SrvcDocContinuousPlannedRevn.ServiceDocumentType = $projection.ServiceDocumentType
[0..1] I_WBSElementBasicData _WBSElement _WBSElement.WBSElementInternalID = $projection.WBSElementInternalID
[0..1] I_SrvcMgmtDocRejectionStatus _SrvcMgmtDocRejectionStatus _SrvcMgmtDocRejectionStatus.SrvcDocRejectionStatus = $projection.SrvcDocRejectionStatus

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName ISRVENHCD view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Get all basic data for Service Order view
Search.searchable true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.representativeKey ServiceOrder view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XXL view

Fields (161)

KeyFieldSource TableSource FieldDescription
KEY ServiceOrder ServiceDocument
ServiceDocumentType ServiceDocumentType
ServiceObjectType ServiceObjectType
ServiceOrderDescription ServiceDocumentDescription
SoldToParty SoldToParty
ShipToParty ShipToParty
BillToParty BillToParty
PayerParty PayerParty
CustMgmtExtRefID _CustMgmtExtRef CustMgmtExtRefID
ServiceOrderPriority ServiceDocumentPriority
PostingDate PostingDate
ServiceDocumentHasError ServiceDocumentHasError
ServiceDocGrossAmount ServiceDocGrossAmount
ServiceDocNetAmount ServiceDocNetAmount
ServiceDocTaxAmount ServiceDocTaxAmount
TransactionCurrency TransactionCurrency
SrvcDocBslnCostPostgStatus SrvcDocBslnCostPostgStatus
SrvcDocBslnPlndCostAmount _SrvcDocBslnPlannedCost SrvcDocBslnPlndCostAmount
SrvcDocBslnPlndRevenueAmount _SrvcDocBslnPlannedRevenue SrvcDocBslnPlndRevenueAmount
SrvcDocContinuousCostStatus SrvcDocContinuousCostStatus
SrvcDocContnsPlndCostAmount _SrvcDocContinuousPlannedCost SrvcDocContnsPlndCostAmount
SrvcDocContnsPlndRevnAmount _SrvcDocContinuousPlannedRevn SrvcDocContnsPlndRevnAmount
SrvcDocTransferStatus SrvcDocTransferStatus
SrvcDocExecutionStatus SrvcDocExecutionStatus
SrvcDocDeliveryStatus SrvcDocDeliveryStatus
ServiceOrderStatus ServiceDocumentStatus
Equipment _ServiceDocRefObj Equipment
EquipmentName
FunctionalLocation _ServiceDocRefObj FunctionalLocation
FunctionalLocationName
ReferenceProductendasReferenceProduct
ProductID _ServiceDocRefObj ProductID
ProductName
WBSElementInternalID WBSElementInternalID
WBSElementExternalID _WBSElement WBSElementExternalID
WBSDescription _WBSElement WBSDescription
PaymentTerms PaymentTerms
PaymentMethod PaymentMethod
SEPAMandate SEPAMandate
SrvcSEPAMandateRelevance SrvcSEPAMandateRelevance
BusinessActivityCategory BusinessActivityCategory
clientNULLasRequestedServiceStartDate
clientNULLasRequestedServiceEndDate
RequestedServiceStartDateTime RequestedServiceStartDateTime
RequestedServiceEndDateTime RequestedServiceEndDateTime
ResponsibleEmployee ResponsibleEmployee
ServiceTeam ServiceTeam
SoldToPartyCountry SoldToPartyCountry
ServiceDocumentIsRejected ServiceDocumentIsRejected
SoldToPartyRegion SoldToPartyRegion
PurchaseOrderByCustomer PurchaseOrderByCustomer
ServiceEmployee ServiceEmployee
ContactPerson ContactPerson
ServiceDocumentUUID ServiceDocumentUUID
ServiceOrderUUID ServiceDocumentCharUUID
ServiceDocumentIsQuotation ServiceDocumentIsQuotation
RefInHouseRepairIsExisting RefInHouseRepairIsExisting
ServiceDocumentIsReleased ServiceDocumentIsReleased
ServiceDocumentIsOpen ServiceDocumentIsOpen
ServiceDocBillingStatusName
ServiceDocIsRelForBillCritlty
ServiceDocOvrlBillgBlkSts
ServiceDocOvrlBillgBlkStsName
SrvcDocOvrlBillgBlkStsCritlty
ServiceDocOvrlBillingSts
ServiceDocOvrlBillingStsName
ServiceDocOvrlBillingStsCritl
PriceIsFixed
OverallCompletionPercent
SrvcConfGrossAmount
ServiceDocDuration
ActualDurationInHours
ServiceConfIsFinalEnabled
IsBillingRelevant
ServiceConfirmationIsCanceled
ServiceConfirmationIsCompleted
ServiceOrderIsEditable
SalesOrganization SalesOrganization
DistributionChannel DistributionChannel
Division Division
SalesOffice SalesOffice
SalesGroup SalesGroup
RespyMgmtServiceTeam I_ServiceDocumentEnhcd RespyMgmtServiceTeam
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID SalesOfficeOrgUnitID
SalesGroupOrgUnitID SalesGroupOrgUnitID
ServiceOrganization ServiceOrganization
RefBusinessSolutionOrder RefBusinessSolutionOrder
ServiceDocumentTemplateType ServiceDocumentTemplateType
SrvcOrdCreditStatus SrvcDocCreditStatus
SEPAMandateCreditor _CustomerSEPAMandate SEPAMandateCreditor
SEPAMandateApplication _CustomerSEPAMandate SEPAMandateApplication
SEPAMandateStatus _CustomerSEPAMandate SEPAMandateStatus
Customer _SoldToPartyToCustomer Customer
ShippingCondition ShippingCondition
DeliveryPriority DeliveryPriority
IncotermsPart1 IncotermsPart1
IncotermsPart2 IncotermsPart2
SrvcDocRejectionStatus SrvcDocRejectionStatus
ServiceDocumentRejectionReason ServiceDocumentRejectionReason
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit _SalesOfficeOrgUnit
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit _SalesGroupOrgUnit
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2
_ServiceOrganizationOrgUnit _ServiceOrganizationOrgUnit
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2
_PaymentTerms _PaymentTerms
_PaymentMethod _PaymentMethod
_SrvcSEPAMandateRelevance _SrvcSEPAMandateRelevance
MaintenancePlan _RefMaintenancePlan MaintenancePlan
MaintenancePlanDesc _RefMaintenancePlan MaintenancePlanDesc
MaintenanceItem _RefMaintenanceItem MaintenanceItem
MaintenanceItemDescription _RefMaintenanceItem MaintenanceItemDescription
_SoldToParty _SoldToParty
_ShipToParty _ShipToParty
_BillToParty _BillToParty
_PayerParty _PayerParty
_RespEmployee _RespEmployee
_ServiceTeam _ServiceTeam
_ServiceTeamHeader _ServiceTeamHeader
_ServiceEmployee _ServiceEmployee
_ContactPerson _ContactPerson
_ServiceDocumentType _ServiceDocumentType
_ServiceDocumentPriority _ServiceDocumentPriority
_ServiceDocumentStatus _ServiceDocumentStatus
_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus
_ServiceDocHasError _ServiceDocHasError
_ActivityCategory _ActivityCategory
_ServiceDocRefObj _ServiceDocRefObj
_ServiceOrderType _ServiceOrderType
_SrvcOrdFUPSrvcConfTransHist _SrvcOrdFUPSrvcConfTransHist
_SrvcDocDocumentFlow _SrvcDocDocumentFlow
_ServiceDocumentErrorLog _ServiceDocumentErrorLog
_SalesOrganization _SalesOrganization
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_Division _Division
_DistributionChannel _DistributionChannel
_ServiceDocumentNotes _ServiceDocumentNotes
_PartiesInvolved _PartiesInvolved
_ServiceOrderPriceDets _ServiceOrderPriceDets
_CustMgmtExtRef _CustMgmtExtRef
_SolutionOrderVH _SolutionOrderVH
_SrvcDocBPContactCard _SrvcDocBPContactCard
_SrvcDocBPSoldToParty _SrvcDocBPSoldToParty
_SrvcDocBPBillToParty _SrvcDocBPBillToParty
_SrvcDocBPShipToParty _SrvcDocBPShipToParty
_SrvcDocBPPayerParty _SrvcDocBPPayerParty
_ChangeDocument _ChangeDocument
_SrvcDocCreditStatus _SrvcDocCreditStatus
_SrvcDocBslnCostPostgStatus _SrvcDocBslnCostPostgStatus
_SrvcDocContinuousCostStatus _SrvcDocContinuousCostStatus
_SrvcDocTransferStatus _SrvcDocTransferStatus
_SrvcDocExecutionStatus _SrvcDocExecutionStatus
_SrvcDocIsQuotation _SrvcDocIsQuotation
_SEPAMandateStatus _SEPAMandateStatus
_CustomerSEPAMandate _CustomerSEPAMandate
_SrvcDocumentRejectionReason _SrvcDocumentRejectionReason
_SrvcMgmtDocRejectionStatus _SrvcMgmtDocRejectionStatus
@AbapCatalog.sqlViewName: 'ISRVENHCD'
@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: #COMPOSITE
}
@ClientHandling.algorithm: #SESSION_VARIABLE

@ObjectModel: {
   representativeKey: 'ServiceOrder',
   usageType: {
     dataClass:      #MIXED,
     serviceQuality: #C,
     sizeCategory:   #XXL
   }
}


define view I_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
  // 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_SrvcOrdFUPSrvcConfTransHist  as _SrvcOrdFUPSrvcConfTransHist  on  $projection.ServiceOrder      = _SrvcOrdFUPSrvcConfTransHist.ServiceOrder
                                                                                        and $projection.ServiceObjectType = _SrvcOrdFUPSrvcConfTransHist.ServiceObjectType

  association [1..*] to C_SrvcDocDocumentFlow          as _SrvcDocDocumentFlow          on  $projection.ServiceOrder = _SrvcDocDocumentFlow.ServiceOrder

  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'

  association [1..*] to C_SrvcOrderObjPgPricingDets    as _ServiceOrderPriceDets        on  $projection.ServiceObjectType = _ServiceOrderPriceDets.ServiceObjectType
                                                                                        and $projection.ServiceOrder      = _ServiceOrderPriceDets.ServiceDocument

  association [0..1] to I_CustMgmtExtRefID             as _CustMgmtExtRef               on  $projection.ServiceOrder                       = _CustMgmtExtRef.CustMgmtDocument
                                                                                        and $projection.ServiceObjectType                  = _CustMgmtExtRef.CustMgmtObjectType
                                                                                        and _CustMgmtExtRef.CustMgmtExtRefIDSequenceNumber = '000001'
                                                                                        and _CustMgmtExtRef.CustMgmtExtRefIDType           = '0001'

  association [1..1] to C_ServiceOrderTypeVH           as _ServiceOrderType             on  $projection.ServiceDocumentType = _ServiceOrderType.ServiceOrderType
  association [1..1] to C_SrvcMgmtCntctPersnQuickVw    as _SrvcDocBPContactCard         on  $projection.ContactPerson = _SrvcDocBPContactCard.BusinessPartner
                                                                                        and $projection.SoldToParty   = _SrvcDocBPContactCard.SoldToParty

  association [0..1] to C_SrvcMgmtSoldToPartyQuickVw   as _SrvcDocBPSoldToParty         on  $projection.SoldToParty = _SrvcDocBPSoldToParty.BusinessPartner
                                                                                        and $projection.customer    = _SrvcDocBPSoldToParty.Customer
  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..*] to C_ServiceDocumentNote          as _ServiceDocNoteText          on  $projection.ServiceDocumentUUID = _ServiceDocNoteText.ServiceDocumentUUID

  association [0..1] to I_BusinessSolutionOrderStdVH   as _SolutionOrderVH              on  $projection.RefBusinessSolutionOrder = _SolutionOrderVH.BusinessSolutionOrder

  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 C_SrvcDocChangeDocument        as _ChangeDocument               on  $projection.ServiceOrderUUID = _ChangeDocument.ChangeDocObject

  association [1..*] to I_CustomerSEPAMandate          as _CustomerSEPAMandate          on  $projection.SEPAMandate                 = _CustomerSEPAMandate.SEPAMandate
                                                                                        and _CustomerSEPAMandate.SEPAMandateVersion = '0000'
  association [0..1] to I_SrvcDocBslnPlannedCost       as _SrvcDocBslnPlannedCost       on  _SrvcDocBslnPlannedCost.ServiceDocument     = $projection.ServiceOrder
                                                                                        and _SrvcDocBslnPlannedCost.ServiceDocumentType = $projection.ServiceDocumentType

  association [1..1] to I_SEPAMandateStatus            as _SEPAMandateStatus            on  $projection.SEPAMandateStatus = _SEPAMandateStatus.SEPAMandateStatus

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

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

  association [0..1] to I_SrvcDocContnsPlannedRevenue  as _SrvcDocContinuousPlannedRevn on  _SrvcDocContinuousPlannedRevn.ServiceDocument     = $projection.ServiceOrder
                                                                                        and _SrvcDocContinuousPlannedRevn.ServiceDocumentType = $projection.ServiceDocumentType
  association [0..1] to I_WBSElementBasicData          as _WBSElement                   on  _WBSElement.WBSElementInternalID = $projection.WBSElementInternalID
  association [0..1] to I_SrvcMgmtDocRejectionStatus as _SrvcMgmtDocRejectionStatus     on _SrvcMgmtDocRejectionStatus.SrvcDocRejectionStatus = $projection.SrvcDocRejectionStatus
    
{

  key  ServiceDocument                                                                                                            as ServiceOrder,

       @Consumption.valueHelp:'_ServiceOrderType'
       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


       @ObjectModel.foreignKey.association: '_ShipToParty'
       ShipToParty,

       @ObjectModel.foreignKey.association: '_BillToParty'
       BillToParty,

       @ObjectModel.foreignKey.association: '_PayerParty'
       PayerParty,

       _CustMgmtExtRef.CustMgmtExtRefID,

       ServiceDocumentPriority                                                                                                    as ServiceOrderPriority,

       PostingDate,

       case ServiceDocumentHasError
         when 'X' then 1
         when ' ' then 0
         else 0
       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,

       // Baseline Cost Posting Status

       SrvcDocBslnCostPostgStatus,

       _SrvcDocBslnPlannedCost.SrvcDocBslnPlndCostAmount                                                                          as SrvcDocBslnPlndCostAmount,
       _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount                                                                    as SrvcDocBslnPlndRevenueAmount,

       case
            when _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount is null then 0
            when _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount = 0.00 then 0
            when _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount = 0 then 0
            else division( ( (_SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount - _SrvcDocBslnPlannedCost.SrvcDocBslnPlndCostAmount) * 100 ) , _SrvcDocBslnPlannedRevenue.SrvcDocBslnPlndRevenueAmount, 2 )
            end                                                                                                                   as SrvcDocBslnPlndMarginPercent,


       // Continuous Cost Calculation Status

       SrvcDocContinuousCostStatus,

       _SrvcDocContinuousPlannedCost.SrvcDocContnsPlndCostAmount                                                                  as SrvcDocContnsPlndCostAmount,
       _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount                                                                  as SrvcDocContnsPlndRevnAmount,

       case
              when _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount is null then 0
              when _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount = 0.00 then 0
              when _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount = 0 then 0
              else division( cast ( ( ( _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount - _SrvcDocContinuousPlannedCost.SrvcDocContnsPlndCostAmount) * 100 )  as abap.dec(29, 2) ) ,
                   cast ( _SrvcDocContinuousPlannedRevn.SrvcDocContnsPlndRevnAmount as abap.dec(29,2) ), 2 )
              end                                                                                                                 as SrvcDocContnsPlndMargInPercent,

       SrvcDocTransferStatus,

       @ObjectModel.foreignKey.association: '_SrvcDocExecutionStatus'
       SrvcDocExecutionStatus,
       SrvcDocDeliveryStatus,
       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,


       case _ServiceDocRefObj.ReferenceProduct
                when '' then _ServiceDocRefObj._Equipment.Material
                else _ServiceDocRefObj.ReferenceProduct
       end                                                                                                                        as ReferenceProduct,

       @ObjectModel.text.element: ['ProductName']
       _ServiceDocRefObj.ProductID,

       _ServiceDocRefObj._Product._Text[1: Language=$session.system_language].ProductName                                         as ProductName,

       WBSElementInternalID,

       @ObjectModel.text.element: ['WBSDescription']
       _WBSElement.WBSElementExternalID,

       _WBSElement.WBSDescription,

       @ObjectModel.foreignKey.association: '_PaymentTerms'
       PaymentTerms,

       @ObjectModel.foreignKey.association: '_PaymentMethod'
       PaymentMethod,

       //! SEPA fields

       SEPAMandate,

       @ObjectModel.foreignKey.association: '_SrvcSEPAMandateRelevance'
       SrvcSEPAMandateRelevance,

       BusinessActivityCategory,

       tstmp_to_dats( RequestedServiceStartDateTime,
                      abap_user_timezone($session.user, $session.client,'NULL' ),
                      $session.client,
                      'NULL' )

                                                                                                                                  as RequestedServiceStartDate,


       tstmp_to_dats( RequestedServiceEndDateTime,
                      abap_user_timezone($session.user, $session.client,'NULL' ),
                      $session.client,
                      'NULL' )


                                                                                                                                  as RequestedServiceEndDate,
       RequestedServiceStartDateTime,
       RequestedServiceEndDateTime,

       @Consumption.valueHelp:'_RespEmployee'
       ResponsibleEmployee,

       @Consumption.valueHelp:'_ServiceTeam'
       ServiceTeam,

       SoldToPartyCountry,

       @UI.hidden: true
       ServiceDocumentIsRejected,

       SoldToPartyRegion,

       PurchaseOrderByCustomer,

       ServiceEmployee,

       ContactPerson,

       ServiceDocumentUUID,
       ServiceDocumentCharUUID                                                                                                    as ServiceOrderUUID,

       @ObjectModel.foreignKey.association: '_SrvcDocIsQuotation'
       ServiceDocumentIsQuotation,
       RefInHouseRepairIsExisting,

       ServiceDocumentIsReleased,
       ServiceDocumentIsOpen,

       // Header Billing Status

       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as abap.char( 40 ))                                                                                               as ServiceDocBillingStatusName, //BillingStatusText


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast(3 as abap.int4)                                                                                                       as ServiceDocIsRelForBillCritlty, //BillingStatusCriticality


       // Header Billing Block

       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as abap.char( 1 ))                                                                                                as ServiceDocOvrlBillgBlkSts, //BillingBlockCode


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as abap.char( 40 ))                                                                                               as ServiceDocOvrlBillgBlkStsName, //BillingBlockText


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast(3 as abap.int4)                                                                                                       as SrvcDocOvrlBillgBlkStsCritlty, //BillingBlockCriticality


       // Header Invoice Status

       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as abap.char( 1 ))                                                                                                as ServiceDocOvrlBillingSts, //InvoiceStatusCode


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as abap.char( 40 ))                                                                                               as ServiceDocOvrlBillingStsName, //InvoiceStatusText


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast(3 as abap.int4)                                                                                                       as ServiceDocOvrlBillingStsCritl, //InvoiceStatusCriticality


       // Fixed Price or Time & Material

       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as crmt_boolean )                                                                                                 as PriceIsFixed, //Common


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast(0 as abap.int4)                                                                                                       as OverallCompletionPercent, //MSO


       @Semantics.amount.currencyCode: 'TransactionCurrency'
       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast(0 as crmt_gross_value)                                                                                                as SrvcConfGrossAmount, //MSO


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast( 1 as abap.dec(13,3))                                                                                                 as ServiceDocDuration, //MSO


       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
       cast( 1 as abap.dec(13,3))                                                                                                 as ActualDurationInHours, //MSO


       //Final Confirmation button

       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as crmt_boolean )                                                                                                 as ServiceConfIsFinalEnabled, //Common


       //Release for billing

       @UI.hidden: true
       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as crmt_boolean )                                                                                                 as IsBillingRelevant, //Common


       //Cancelation Relevance

       @UI.hidden: true
       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as crmt_boolean )                                                                                                 as ServiceConfirmationIsCanceled, //Common


       //Completion Relevance

       @UI.hidden: true
       @ObjectModel.virtualElement
       @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_COMMON_HDR_CALC_EXIT'
       cast( '' as crmt_boolean )                                                                                                 as ServiceConfirmationIsCompleted, //Common


       cast( '' as crmt_boolean )                                                                                                 as ServiceOrderIsEditable,

       @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,

       @ObjectModel.foreignKey.association: '_ServiceTeamHeader'
       I_ServiceDocumentEnhcd.RespyMgmtServiceTeam,

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

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

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

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

       @ObjectModel.foreignKey.association: '_ServiceOrganizationOrgUnit_2'
       ServiceOrganization,


       @Consumption.valueHelp:'_SolutionOrderVH'
       RefBusinessSolutionOrder,

       ServiceDocumentTemplateType,

       @ObjectModel.foreignKey.association: '_SrvcDocCreditStatus'
       SrvcDocCreditStatus                                                                                                        as SrvcOrdCreditStatus,

       _CustomerSEPAMandate.SEPAMandateCreditor                                                                                   as SEPAMandateCreditor,

       _CustomerSEPAMandate.SEPAMandateApplication                                                                                as SEPAMandateApplication,

       _CustomerSEPAMandate.SEPAMandateStatus                                                                                     as SEPAMandateStatus,

       _SoldToPartyToCustomer.Customer,
        ShippingCondition,
        
        DeliveryPriority,
        IncotermsPart1,
        IncotermsPart2,
        @ObjectModel.foreignKey.association: '_SrvcMgmtDocRejectionStatus'
        SrvcDocRejectionStatus,
        @ObjectModel.foreignKey.association: '_SrvcDocumentRejectionReason'
        ServiceDocumentRejectionReason,

       @Consumption.filter.hidden: true
       @API.element.releaseState: #DEPRECATED
       @API.element.successor: '_SalesOrganizationOrgUnit_2'
       _SalesOrganizationOrgUnit,
       _SalesOrganizationOrgUnit_2,


       @Consumption.filter.hidden: true
       @API.element.releaseState: #DEPRECATED
       @API.element.successor: '_SalesOfficeOrgUnit_2'
       _SalesOfficeOrgUnit,
       _SalesOfficeOrgUnit_2,



       @Consumption.filter.hidden: true
       @API.element.releaseState: #DEPRECATED
       @API.element.successor: '_SalesGroupOrgUnit_2'
       _SalesGroupOrgUnit,
       _SalesGroupOrgUnit_2,


       @Consumption.filter.hidden: true
       @API.element.releaseState: #DEPRECATED
       @API.element.successor: '_ServiceOrganizationOrgUnit_2'
       _ServiceOrganizationOrgUnit,
       _ServiceOrganizationOrgUnit_2,


       //for payment terms.

       _PaymentTerms,
       _PaymentMethod,
       _SrvcSEPAMandateRelevance,

       _RefMaintenancePlan.MaintenancePlan,
       _RefMaintenancePlan.MaintenancePlanDesc,
       _RefMaintenanceItem.MaintenanceItem,
       _RefMaintenanceItem.MaintenanceItemDescription,

       // Associations

       _SoldToParty,

       _ShipToParty,

       _BillToParty,

       _PayerParty,

       _RespEmployee,

       _ServiceTeam,

       _ServiceTeamHeader,

       _ServiceEmployee,

       _ContactPerson,

       _ServiceDocumentType,

       _ServiceDocumentPriority,

       @API.element.releaseState: #DEPRECATED
       @API.element.successor: '_SrvcDocLifecycleStatus'
       _ServiceDocumentStatus,
       _SrvcDocLifecycleStatus,

       _ServiceDocHasError,

       _ActivityCategory,

       _ServiceDocRefObj,

       _ServiceOrderType,

       //  _SrvcOrdItemListRptAndObjPg,


       _SrvcOrdFUPSrvcConfTransHist,

       _SrvcDocDocumentFlow,

       _ServiceDocumentErrorLog,

       _SalesOrganization,

       _SalesOffice,

       _SalesGroup,

       _Division,
       _DistributionChannel,
       _ServiceDocumentNotes,
       _PartiesInvolved,
       _ServiceOrderPriceDets,
       _CustMgmtExtRef,
       //    _ServiceDocNoteText,

       _SolutionOrderVH,

       @UI.hidden: true
       _SrvcDocBPContactCard,
       @UI.hidden: true
       _SrvcDocBPSoldToParty,
       @UI.hidden: true
       _SrvcDocBPBillToParty,
       @UI.hidden: true
       _SrvcDocBPShipToParty,
       @UI.hidden: true
       _SrvcDocBPPayerParty,
       _ChangeDocument,
       _SrvcDocCreditStatus,
       // Baseline Cost Posting Status

       _SrvcDocBslnCostPostgStatus,
       // Continuous Cost Calculation Status

       _SrvcDocContinuousCostStatus,

       //       _SrvcDocBslnPlannedCost,

       //       _SrvcDocBslnPlannedRevenue,

       _SrvcDocTransferStatus,
       _SrvcDocExecutionStatus,
       _SrvcDocIsQuotation,
       _SEPAMandateStatus,
       _CustomerSEPAMandate,
       _SrvcDocumentRejectionReason,
       _SrvcMgmtDocRejectionStatus
}
where
      ServiceObjectType           = 'BUS2000116'
  and ServiceDocumentIsQuotation  = ' '
  and ServiceDocumentTemplateType = ' '
  and RefInHouseRepairIsExisting  = ' '
  and SrvcDocIsMaintServiceOrder  = ' '
/* Fetches only the Service Orders based on above conditions  */