I_SERVICEORDERENHCD

CDS View

Get all basic data for Service Order

I_SERVICEORDERENHCD is a CDS View in S/4HANA. Get all basic data for Service Order. It contains 62 fields. 6 CDS views read from this table.

CDS Views using this table (6)

ViewTypeJoinVDMDescription
C_MyTeamSrvcOrdListRptAndObjPg view from CONSUMPTION All Released Service Orders
C_RelForBillgListRptAndObjPg view from CONSUMPTION List of all Service Orders which can be Released for Billing
C_SrvcConfPndgActnListRptObjPg view from CONSUMPTION Displays Orders with Confirmation in Open, Cancelled Status
C_SrvcOrdDocListRptAndObjPg view from CONSUMPTION Displays all the Service Orders
C_SrvcOrderNoConfListRptObjPg view from CONSUMPTION Displays all Srvc Orders which do not have Srvc Confirmation
P_SrvcOpenOrderWorkList view_entity inner COMPOSITE OPen Orders In Worklist

Fields (62)

KeyField CDS FieldsUsed in Views
KEY ServiceOrder ServiceOrder 2
_ServiceDocumentPriority _ServiceDocumentPriority 1
_ServiceDocumentType _ServiceDocumentType 1
_SrvcDocCreditStatus _SrvcDocCreditStatus 1
ActualDurationInHours ActualDurationInHours 3
BillToParty BillToParty 2
BusinessActivityCategory BusinessActivityCategory 2
ContactPerson ContactPerson 2
DistributionChannel DistributionChannel 2
Division Division 2
OverallCompletionPercent OverallCompletionPercent 2
PayerParty PayerParty 2
PostingDate PostingDate 2
PriceIsFixed PriceIsFixed 2
PurchaseOrderByCustomer PurchaseOrderByCustomer 2
RefBusinessSolutionOrder RefBusinessSolutionOrder 2
RequestedServiceEndDate RequestedServiceEndDate 3
RequestedServiceStartDate RequestedServiceStartDate 3
ResponsibleEmployee ResponsibleEmployee 3
RespyMgmtServiceTeam RespyMgmtServiceTeam 4
SalesGroup SalesGroup 2
SalesGroupOrgUnitID SalesGroupOrgUnitID 2
SalesOffice SalesOffice 2
SalesOfficeOrgUnitID SalesOfficeOrgUnitID 2
SalesOrganization SalesOrganization 2
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID 2
ServiceDocBillingStatusName ServiceDocBillingStatusName 2
ServiceDocDuration ServiceDocDuration 2
ServiceDocGrossAmount ServiceDocGrossAmount 3
ServiceDocIsRelForBillCritlty ServiceDocIsRelForBillCritlty 2
ServiceDocNetAmount ServiceDocNetAmount 2
ServiceDocOvrlBillgBlkSts ServiceDocOvrlBillgBlkSts 2
ServiceDocOvrlBillgBlkStsName ServiceDocOvrlBillgBlkStsName 2
ServiceDocOvrlBillingSts ServiceDocOvrlBillingSts 2
ServiceDocOvrlBillingStsCritl ServiceDocOvrlBillingStsCritl 2
ServiceDocOvrlBillingStsName ServiceDocOvrlBillingStsName 2
ServiceDocumentHasError ServiceDocumentHasError 2
ServiceDocumentIsOpen ServiceDocumentIsOpen 2
ServiceDocumentIsQuotation ServiceDocumentIsQuotation 2
ServiceDocumentIsRejected ServiceDocumentIsRejected 2
ServiceDocumentIsReleased ServiceDocumentIsReleased 2
ServiceDocumentType ServiceDocumentType 2
ServiceDocumentUUID ServiceDocumentUUID 2
ServiceEmployee ServiceEmployee 2
ServiceObjectType ServiceObjectType 2
ServiceOrderDescription ServiceOrderDescription 2
ServiceOrderPriority ServiceOrderPriority 3
ServiceOrdErrorStsCriticality ServiceOrdErrorStsCriticality 1
ServiceOrderStatus ServiceOrderStatus 3
ServiceOrderUUID ServiceOrderUUID 2
ServiceOrganization ServiceOrganization 2
ServiceTeam ServiceTeam 2
ShipToParty ShipToParty 2
SoldToParty SoldToParty 2
SoldToPartyCountry SoldToPartyCountry 2
SoldToPartyRegion SoldToPartyRegion 2
SrvcConfGrossAmount SrvcConfGrossAmount 3
SrvcDocOvrlBillgBlkStsCritlty SrvcDocOvrlBillgBlkStsCritlty 2
SrvcOrdCreditStatus SrvcOrdCreditStatus 2
TechnicalObject TechnicalObject 1
TechObjIsEquipOrFuncnlLoc TechObjIsEquipOrFuncnlLoc 1
TransactionCurrency TransactionCurrency 3
@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  */