I_SERVICEDOCUMENT

CDS View

Service Transaction

I_SERVICEDOCUMENT is a CDS View in S/4HANA. Service Transaction. It contains 74 fields. 77 CDS views read from this table.

CDS Views using this table (77)

ViewTypeJoinVDMDescription
A_BusSolnOrdUserStatus view inner COMPOSITE Header User Status
A_ServiceConfUserStatus view inner COMPOSITE Service Confirmation User Status
A_ServiceOrdUserStatus view inner COMPOSITE Service Order User Status
A_SrvcConfAppointment view inner COMPOSITE Service Confirmation Appointment
A_SrvcConfDuration view inner COMPOSITE Service Confirmation Duration
A_SrvcOrdAppointment view inner COMPOSITE Service Order Appointment
A_SrvcOrdDuration view inner COMPOSITE Service Order Duration
A_SrvcOrdPartner view inner COMPOSITE Service Order Partner
A_SrvcOrdPartnerAddress view_entity inner COMPOSITE Partner Address of Service Order
A_SrvcOrdTmplAppointment view inner COMPOSITE Service Order Template Appointment
A_SrvcOrdTmplDuration view inner COMPOSITE Service Order Template Duration
A_SrvcOrdTmplPartner view inner COMPOSITE Service Order Template Partner
A_SrvcOrdTmplPartnerAddress view_entity inner COMPOSITE Partner Address of Service Order Template
A_SrvcOrdTmplUserStatus view inner COMPOSITE Service Order Template User Status
C_BSQPMBusSolnQtan view_entity from CONSUMPTION BSQPM Solution Quotation Attribute
C_BusSolnOrdOutputParam view from CONSUMPTION Solution Order Output Parameter Determination
C_BusSolnQtanVH view_entity from CONSUMPTION Business Solution Quotation
C_DspDocFlwServiceContract view_entity from CONSUMPTION Service Contract Attributes
C_SrvcContrOutputParam view from CONSUMPTION Service Contract Output Parameter Determination
C_SrvcOrderOutputParam view from CONSUMPTION Service Order Output Parameter Determination
C_SrvcQtanOutputParam view from CONSUMPTION Service Quotation Output Parameter Determination
C_SrvcQtanProcFlowInformation view from CONSUMPTION Srvc Quotation Info for Transaction History
CRMS4_IU_I_USO view_entity from Utilities Service Order
CRMS4_IU_I_USR view_entity from Utilities Service Request
I_ARProcessFlowDocumentVH view union_all COMPOSITE Document Number
I_BusinessSolutionOrderStdVH view from COMPOSITE Solution Order Value Help
I_ProjectServiceContract view_entity from BASIC Project Service Contract
I_ProjectServiceOrder view_entity from BASIC Project Service Order
I_RU_Contract view union COMPOSITE Contracts in Russian Financials
I_ServiceContractStdVH view from COMPOSITE Service Contract Value Help
I_ServiceDocumentEnhcd view from COMPOSITE Service Transaction Enhanced
I_ServiceDocumentFixedPrice view from BASIC Service Document Fixed Price
I_ServiceOrderConfStdVH view from COMPOSITE Service Confirmation Value Help
I_ServiceOrderStdVH view from BASIC Service Order Value Help
I_ServiceOrderTemplateStdVH view from COMPOSITE Service Order Template Value Help
I_SrvcConfRelBillgListRpt view left_outer COMPOSITE View for Service Conf. Billing Items
I_SrvcDocByDocumentType view from BASIC Service Transaction by Transaction Type
I_SrvcOrdTransfStatusSituation view from COMPOSITE Data Transfer Situations
I_SubscriptionContractStdVH view from COMPOSITE Subscription Contract Value Help
I_SubscriptionOrderPartner view_entity inner COMPOSITE Subscription Order Partner
I_SubscriptionOrderUserStatus view_entity inner COMPOSITE Subscription Order UStatus
P_ARProcessFlowServiceContract view_entity from COMPOSITE Service Contract Attributes
P_BSQPMSolnQtanProcFlw view_entity from COMPOSITE
P_ServiceOrderFulfillment view from COMPOSITE
P_SrvcTransWthSituation view inner COMPOSITE
R_BusSolnOrdLongTextTP view_entity inner TRANSACTIONAL Business Solution Order Long Text - TP
R_BusSolnOrdUserStatusTP view_entity inner TRANSACTIONAL Business Solution Order User Status - TP
R_SrvcConfAppointmentTP view_entity inner TRANSACTIONAL Service Confirmation Appointment - TP
R_SrvcConfDurationTP view_entity inner TRANSACTIONAL Service Confirmation Duration - TP
R_SrvcConfItmTransHistory view_entity inner COMPOSITE Transaction History in SRVC Item
R_SrvcConfLongTextTP view_entity inner TRANSACTIONAL Long Text for Service Confirmation
R_SrvcConfTransHistory view_entity inner COMPOSITE Transaction History in SRVC Header
R_SrvcConfUserStatusTP view_entity inner TRANSACTIONAL Service Confirmation User Status - TP
R_SrvcContrAppointmentTP view_entity inner TRANSACTIONAL Service Contract Appointment - TP
R_SrvcContrDurationTP view_entity inner TRANSACTIONAL Service Contract Duration - TP
R_SrvcContrLongTextTP view_entity inner TRANSACTIONAL Service Contract Long Text - TP
R_SrvcContrTmplDurationTP view_entity inner TRANSACTIONAL Service Contract Template Duration - TP
R_SrvcContrTmplLongTextTP view_entity inner TRANSACTIONAL Service Contract Template Text - TP
R_SrvcContrUserStatusTP view_entity inner TRANSACTIONAL Service Contract User Status - TP
R_SrvcOrdAppointmentTP view_entity inner TRANSACTIONAL Service Order Appointment - TP
R_SrvcOrdDurationTP view_entity inner TRANSACTIONAL Service Order Duration - TP
R_SrvcOrdItmTransHistory view_entity inner COMPOSITE Transaction History in SRVO Item
R_SrvcOrdLongTextTP view_entity inner TRANSACTIONAL Long Text for Service Order
R_SrvcOrdPartnerTP view_entity inner TRANSACTIONAL Service Order Partner - TP
R_SrvcOrdTmplAppointmentTP view_entity inner TRANSACTIONAL Service Order Template Appointment - TP
R_SrvcOrdTmplDurationTP view_entity inner TRANSACTIONAL Service Order Template Duration - TP
R_SrvcOrdTmplLongTextTP view_entity inner TRANSACTIONAL Service Order Template Long Text - TP
R_SrvcOrdTmplPartnerAddressTP view_entity inner TRANSACTIONAL Partner Address For Srvc Ord Tmpl - TP
R_SrvcOrdTmplPartnerTP view_entity inner TRANSACTIONAL Service Order Template Partner - TP
R_SrvcOrdTmplUserStatusTP view_entity inner TRANSACTIONAL Service Order Template User Status - TP
R_SrvcOrdTransHistory view_entity inner COMPOSITE Transaction History in SRVO Header
R_SrvcOrdUserStatusTP view_entity inner TRANSACTIONAL Service Order User Status - TP
R_SrvcQtanAppointmentTP view_entity inner TRANSACTIONAL Service Quotation Appointment - TP
R_SrvcQtanDurationTP view_entity inner TRANSACTIONAL Service Quotation Duration - TP
R_SrvcQtanLongTextTP view_entity inner TRANSACTIONAL Long Text for Service Quotation
R_SrvcQtanUserStatusTP view_entity inner TRANSACTIONAL Service Quotation User Status - TP
R_SubscrpnContrLongTextTP view_entity inner TRANSACTIONAL Subscription Contract Text - TP

Fields (74)

KeyField CDS FieldsUsed in Views
KEY ServiceDocument BusinessSolutionOrder,BusinessSolutionQuotation,ServiceConfirmation,ServiceContract,ServiceDocument,ServiceOrder,ServiceOrderTemplate,ServiceQuotation,SubscriptionOrder 28
KEY ServiceObjectType BusinessObjectType,ServiceObjectType 7
_DistributionChannel _DistributionChannel 1
_Division _Division 1
_RespEmployee _RespEmployee 1
_SalesGroup _SalesGroup 1
_SalesGroupOrgUnit _SalesGroupOrgUnit 1
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2 1
_SalesOffice _SalesOffice 1
_SalesOfficeOrgUnit _SalesOfficeOrgUnit 1
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2 1
_SalesOrganization _SalesOrganization 1
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit 1
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2 1
_ServiceDocBillingStatus _ServiceDocBillingStatus 1
_ServiceDocHasError _ServiceDocHasError 1
_ServiceDocumentIsOpen _ServiceDocumentIsOpen 1
_ServiceDocumentStatus _ServiceDocumentStatus 1
_ServiceDocumentType _ServiceDocumentType 1
_ServiceObjType _ServiceObjType 1
_ServiceOrganizationOrgUnit _ServiceOrganizationOrgUnit 1
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2 1
_SoldToParty _SoldToParty 1
_SoldToPartyCountry _SoldToPartyCountry 1
_SoldToPartyRegion _SoldToPartyRegion 1
_SrvcDocIsRelForBillgSts _SrvcDocIsRelForBillgSts 1
_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus 1
DistributionChannel DistributionChannel 5
Division Division 5
PaymentTerms PaymentTerms 1
PostingDate PostingDate 2
PurchaseOrderByCustomer PurchaseOrderByCustomer 1
RequestedServiceEndDateTime RequestedServiceEndDateTime 2
RequestedServiceStartDateTime RequestedServiceStartDateTime 2
ResponsibleEmployee RespEmployeeBusinessPartnerId,ResponsibleEmployee 4
SalesGroup SalesGroup 4
SalesGroupOrgUnitID SalesGroupOrgUnitID 4
SalesOffice SalesOffice 4
SalesOfficeOrgUnitID SalesOfficeOrgUnitID 4
SalesOrganization SalesOrganization 6
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID 4
ServiceDefectCategory ServiceDefectCategory 2
ServiceDefectSchema ServiceDefectSchema 2
ServiceDocBillingStatus ServiceDocBillingStatus 1
ServiceDocCreationDateTime ServiceDocCreationDateTime 1
ServiceDocGrossAmount ServiceDocGrossAmount 2
ServiceDocIsReleasedForBilling ServiceDocIsReleasedForBilling 1
ServiceDocNetAmount ServiceDocNetAmount 3
ServiceDocumentCreatedByUser ServiceDocumentCreatedByUser 1
ServiceDocumentDescription BusSolnQtanDescription,ServiceDocumentDescription 4
ServiceDocumentHasError ServiceDocumentHasError 1
ServiceDocumentImpact ServiceDocumentImpact 1
ServiceDocumentIsOpen ServiceDocumentIsOpen 1
ServiceDocumentIsQuotation ServiceDocumentIsQuotation 2
ServiceDocumentIsRejected ServiceDocumentIsRejected 1
ServiceDocumentIsReleased ServiceDocumentIsReleased 1
ServiceDocumentPriority ServiceDocumentPriority 2
ServiceDocumentProblemCategory ServiceDocumentProblemCategory 1
ServiceDocumentStatus ServiceDocumentStatus 4
ServiceDocumentType ServiceDocumentType 4
ServiceDocumentUrgency ServiceDocumentUrgency 1
ServiceDocumentUUID ServiceDocumentUUID 3
ServiceDueByDateTime ServiceDueByDateTime 1
ServiceEscalationLevel ServiceEscalationLevel 1
ServiceOrganization ServiceOrganization 4
ServiceReasonCategory ServiceReasonCategory 2
ServiceRisk ServiceRisk 1
SoldToParty SoldToParty 6
SoldToPartyCountry SoldToPartyCountry 1
SoldToPartyRegion SoldToPartyRegion 1
SrvcDocIsMaintServiceOrder SrvcDocIsMaintServiceOrder 1
SrvcQtanValidityEndDateTime SrvcQtanValidityEndDateTime 1
SrvcQtanValidityStartDateTime SrvcQtanValidityStartDateTime 1
TransactionCurrency TransactionCurrency 4
@EndUserText.label: 'Service Transaction'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog: {
  sqlViewName: 'ISERVDOC',
  compiler.compareFilter: true,
  preserveKey: true
}

@VDM: {
  viewType: #BASIC,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}

@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}

@ObjectModel: {
   representativeKey: 'ServiceDocument',
   supportedCapabilities: [#ANALYTICAL_DIMENSION, #CDS_MODELING_ASSOCIATION_TARGET, #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE],
   modelingPattern: #ANALYTICAL_DIMENSION,
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #A,
     sizeCategory:   #XXL
   }
}
@Analytics.dataCategory: #DIMENSION
@Metadata.allowExtensions:true
@Metadata.ignorePropagatedAnnotations: true

/*+[hideWarning] { "IDS" : [ "CALCULATED_FIELD_CHECK" ]  } */
define view I_ServiceDocument
  as select from crms4d_serv_h
  association [0..1] to I_BusinessPartner            as _SoldToParty                   on  $projection.SoldToParty = _SoldToParty.BusinessPartner
  association [0..1] to I_BusinessPartner            as _RespEmployee                  on  $projection.ResponsibleEmployee = _RespEmployee.BusinessPartner
  association [0..1] to I_BusinessPartner            as _ServiceTeam                   on  $projection.ServiceTeam = _ServiceTeam.BusinessPartner
  association [0..1] to I_BusinessPartner            as _ServiceEmployee               on  $projection.ServiceEmployee = _ServiceEmployee.BusinessPartner
  association [0..1] to I_BusinessPartner            as _ContactPerson                 on  $projection.ContactPerson = _ContactPerson.BusinessPartner
  association [0..1] to I_BusinessPartner            as _ShipToParty                   on  $projection.ShipToParty = _ShipToParty.BusinessPartner
  association [0..1] to I_BusinessPartner            as _BillToParty                   on  $projection.BillToParty = _BillToParty.BusinessPartner
  association [0..1] to I_BusinessPartner            as _PayerParty                    on  $projection.PayerParty = _PayerParty.BusinessPartner
  association [0..*] to I_BusinessPartnerCustomer    as _SoldToPartyToCustomer         on  $projection.SoldToParty = _SoldToPartyToCustomer.BusinessPartner

  association [0..1] to I_ServiceDocumentType        as _ServiceDocumentType           on  $projection.ServiceDocumentType = _ServiceDocumentType.ServiceDocumentType
  association [0..1] to I_ServiceDocumentPriority    as _ServiceDocumentPriority       on  $projection.ServiceDocumentPriority = _ServiceDocumentPriority.ServiceDocumentPriority
  association [0..1] to I_ServiceDocumentStatus      as _ServiceDocumentStatus         on  $projection.ServiceDocumentStatus = _ServiceDocumentStatus.ServiceDocumentStatus
  association [0..1] to I_SrvcDocLifecycleStatus     as _SrvcDocLifecycleStatus        on  $projection.ServiceDocumentStatus = _SrvcDocLifecycleStatus.ServiceDocumentStatus
  association [0..1] to I_ServiceDocBillingStatus    as _ServiceDocBillingStatus       on  $projection.ServiceDocBillingStatus = _ServiceDocBillingStatus.ServiceDocBillingStatus
  association [0..1] to I_SrvcDocRelForBillgSts      as _SrvcDocIsRelForBillgSts       on  $projection.ServiceDocIsReleasedForBilling = _SrvcDocIsRelForBillgSts.ServiceDocIsReleasedForBilling
  association [0..1] to I_ServiceDocErrorStatus      as _ServiceDocHasError            on  $projection.ServiceDocumentHasError = _ServiceDocHasError.ServiceDocumentHasError
  association [0..1] to I_ServiceDocOpenStatus       as _ServiceDocumentIsOpen         on  $projection.ServiceDocumentIsOpen = _ServiceDocumentIsOpen.ServiceDocumentIsOpen
  association [0..1] to I_BillingBlockReason         as _BillingBlockReason            on  $projection.BillingBlockReason = _BillingBlockReason.BillingBlockReason
  association [0..1] to I_BusinessActivityCategory   as _ActivityCategory              on  $projection.BusinessActivityCategory = _ActivityCategory.BusinessActivityCategory

  association [1..1] to I_CustMgmtBusObjType         as _ServiceObjType                on  $projection.ServiceObjectType = _ServiceObjType.BusinessObjectType

  association [0..1] to I_Currency                   as _TransactionCurrency           on  $projection.TransactionCurrency = _TransactionCurrency.Currency

  association [0..1] to I_PaymentTerms               as _PaymentTerms                  on  $projection.PaymentTerms = _PaymentTerms.PaymentTerms

  association [0..1] to I_SrvcSEPAMandateRelevance   as _SrvcSEPAMandateRelevance      on  $projection.SrvcSEPAMandateRelevance = _SrvcSEPAMandateRelevance.SrvcSEPAMandateRelevance

  association [0..1] to I_ServiceDocumentFixedPrice  as _FixedPrice                    on  $projection.ServiceObjectType   = _FixedPrice.ServiceObjectType
                                                                                       and $projection.ServiceDocument     = _FixedPrice.ServiceDocument
                                                                                       and $projection.PricingDocument     = _FixedPrice.PricingDocument
                                                                                       and _FixedPrice.PricingDocumentItem = '000000'

  association [0..1] to I_SalesOrganizationUnit      as _SalesOrganizationOrgUnit      on  $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit.OrganizationalUnit

  association [0..1] to I_SalesOrganizationUnit      as _SalesOfficeOrgUnit            on  $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit.OrganizationalUnit

  association [0..1] to I_SalesOrganizationUnit      as _SalesGroupOrgUnit             on  $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit.OrganizationalUnit

  association [0..1] to I_SalesOrganizationUnit      as _ServiceOrganizationOrgUnit    on  $projection.ServiceOrganization = _ServiceOrganizationOrgUnit.OrganizationalUnit

  association [0..1] to I_SalesOrganizationUnit      as _RespSrvcOrganizationOrgUnit   on  $projection.ResponsibleServiceOrganization = _RespSrvcOrganizationOrgUnit.OrganizationalUnit

  // Added to correct the CRM Organizational Unit

  association [0..1] to I_SrvcMgmtOrganizationUnit   as _SalesOrganizationOrgUnit_2    on  $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit   as _SalesOfficeOrgUnit_2          on  $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit   as _SalesGroupOrgUnit_2           on  $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit   as _ServiceOrganizationOrgUnit_2  on  $projection.ServiceOrganization = _ServiceOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated

  association [0..1] to I_SrvcMgmtOrganizationUnit   as _RespSrvcOrganizationOrgUnit_2 on  $projection.ResponsibleServiceOrganization = _RespSrvcOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated
  //


  association [0..1] to I_SalesOrganization          as _SalesOrganization             on  $projection.SalesOrganization = _SalesOrganization.SalesOrganization

  association [0..1] to I_SalesOffice                as _SalesOffice                   on  $projection.SalesOffice = _SalesOffice.SalesOffice

  association [0..1] to I_SalesGroup                 as _SalesGroup                    on  $projection.SalesGroup = _SalesGroup.SalesGroup

  association [0..1] to I_Division                   as _Division                      on  $projection.Division = _Division.Division

  association [0..1] to I_DistributionChannel        as _DistributionChannel           on  $projection.DistributionChannel = _DistributionChannel.DistributionChannel

  association [0..1] to I_SalesDocumentRjcnReason    as _SrvcDocumentRejectionReason   on  $projection.ServiceDocumentRejectionReason = _SrvcDocumentRejectionReason.SalesDocumentRjcnReason

  association [0..1] to I_Country                    as _SoldToPartyCountry            on  $projection.SoldToPartyCountry = _SoldToPartyCountry.Country

  association [0..1] to I_Region                     as _SoldToPartyRegion             on  $projection.SoldToPartyRegion  = _SoldToPartyRegion.Region
                                                                                       and $projection.SoldToPartyCountry = _SoldToPartyRegion.Country

  association [0..1] to I_Region                     as _Region                        on  $projection.Region             = _Region.Region
                                                                                       and $projection.SoldToPartyCountry = _Region.Country

  association [0..1] to I_ServiceRisk                as _ServiceRisk                   on  $projection.ServiceRisk = _ServiceRisk.ServiceRisk

  association [0..1] to I_ServiceDocProblemCategory  as _ServiceDocProblemCategory     on  $projection.ServiceDocumentProblemCategory = _ServiceDocProblemCategory.ServiceDocumentProblemCategory

  association [0..1] to I_RespyMgmtTeamHeaderDetail  as _ServiceTeamHeader             on  $projection.RespyMgmtServiceTeam = _ServiceTeamHeader.RespyMgmtTeamID

  association [0..1] to I_EnterpriseServiceOrg       as _EnterpriseServiceOrg          on  $projection.EnterpriseServiceOrganization = _EnterpriseServiceOrg.EnterpriseServiceOrganization

  association [0..1] to I_ServiceContractCanclnSts   as _ServiceContractCanclnSts      on  $projection.ServiceContractCanclnSts = _ServiceContractCanclnSts.ServiceContractCanclnSts

  association [0..1] to I_SrvcDocTransferStatus      as _SrvcDocTransferStatus         on  $projection.SrvcDocTransferStatus = _SrvcDocTransferStatus.SrvcDocTransferStatus

  association [0..1] to I_SrvcDocCreditStatus        as _SrvcDocCreditStatus           on  $projection.SrvcDocCreditStatus = _SrvcDocCreditStatus.SrvcDocCreditStatus

  association [0..1] to I_SrvcDocGTSStatus           as _SrvcDocGTSEmbargoStatus       on  $projection.SrvcDocGTSEmbargoStatus = _SrvcDocGTSEmbargoStatus.SrvcDocGTSStatus

  association [0..1] to I_SrvcDocGTSStatus           as _SrvcDocGTSLglControlStatus    on  $projection.SrvcDocGTSLglControlStatus = _SrvcDocGTSLglControlStatus.SrvcDocGTSStatus

  association [0..1] to I_SrvcDocGTSStatus           as _SrvcDocGTSScreeningStatus     on  $projection.SrvcDocGTSScreeningStatus = _SrvcDocGTSScreeningStatus.SrvcDocGTSStatus

  association [0..1] to E_ServiceDocument            as _ServiceDocumentExt            on  $projection.ServiceObjectType = _ServiceDocumentExt.ServiceCategory
                                                                                       and $projection.ServiceDocument   = _ServiceDocumentExt.ServiceOrder

  association [0..1] to I_SrvcDocBslnCostPostgStatus as _SrvcDocBslnCostPostgStatus    on  $projection.SrvcDocBslnCostPostgStatus = _SrvcDocBslnCostPostgStatus.SrvcDocBslnCostPostgStatus

  association [0..1] to I_SrvcDocBslnCostPostgStatus as _SrvcDocContinuousCostStatus   on  $projection.SrvcDocContinuousCostStatus = _SrvcDocContinuousCostStatus.SrvcDocBslnCostPostgStatus

  association [0..1] to I_SrvcDocPaymentMethod       as _PaymentMethod                 on  $projection.PaymentMethod                = _PaymentMethod.PaymentMethod
                                                                                       and (
                                                                                          $projection.SalesOrganization             = _PaymentMethod.SalesOrganization
                                                                                          or $projection.SalesOrganizationOrgUnitID = _PaymentMethod.OrgUnitTypeIDConcatenated
                                                                                        )

  association [0..1] to I_SrvcDocExecutionStatus     as _SrvcDocExecutionStatus        on  $projection.SrvcDocExecutionStatus     = _SrvcDocExecutionStatus.SrvcDocExecutionStatus
                                                                                       and $projection.ServiceDocumentIsQuotation = _SrvcDocExecutionStatus.ServiceDocumentIsQuotation

  association [1..1] to I_Indicator                  as _SrvcDocIsQuotation            on  $projection.ServiceDocumentIsQuotation = _SrvcDocIsQuotation.IndicatorValue
{
      // Header Keys

      @ObjectModel.foreignKey.association: '_ServiceObjType'
  key objtype_h                                                            as ServiceObjectType,
      @ObjectModel.text.element: 'ServiceDocumentDescription'
  key object_id                                                            as ServiceDocument,

      // Header Details

      header_guid                                                          as ServiceDocumentUUID,
      header_guid_char                                                     as ServiceDocumentCharUUID,
      @ObjectModel.foreignKey.association: '_ServiceDocumentType'
      process_type                                                         as ServiceDocumentType,
      @Semantics.text: true
      description_h                                                        as ServiceDocumentDescription,
      descr_language                                                       as Language,
      posting_date                                                         as PostingDate,
      template_type                                                        as ServiceDocumentTemplateType,
      created_at_h                                                         as ServiceDocCreationDateTime,
      changed_at_h                                                         as ServiceDocChangedDateTime,
      created_by_h                                                         as ServiceDocumentCreatedByUser,
      changed_by_h                                                         as ServiceDocumentChangedByUser,
      pricing_document                                                     as PricingDocument,
      pricing_procedure                                                    as PricingProcedure,
      refbussolnord                                                        as RefBusinessSolutionOrder,
      is_maintenance_order                                                 as SrvcDocIsMaintServiceOrder,

      // Activity

      @ObjectModel.foreignKey.association: '_ActivityCategory'
      category                                                             as BusinessActivityCategory,
      @ObjectModel.foreignKey.association: '_ServiceDocumentPriority'
      priority                                                             as ServiceDocumentPriority,

      // Cumulate Extension

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      net_value_h                                                          as ServiceDocNetAmount,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      gross_value_h                                                        as ServiceDocGrossAmount,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      tax_amount_h                                                         as ServiceDocTaxAmount,

      // Partner Details

      @ObjectModel.foreignKey.association: '_SoldToParty'
      sold_to_party                                                        as SoldToParty,
      @ObjectModel.foreignKey.association: '_SoldToPartyRegion'
      sold_to_region                                                       as SoldToPartyRegion,
      @ObjectModel.foreignKey.association: '_SoldToPartyCountry'
      sold_to_country                                                      as SoldToPartyCountry,
      @ObjectModel.foreignKey.association: '_ServiceTeam'
      service_team                                                         as ServiceTeam,
      @ObjectModel.foreignKey.association: '_RespEmployee'
      person_resp                                                          as ResponsibleEmployee,
      @ObjectModel.foreignKey.association: '_ServiceEmployee'
      service_employee                                                     as ServiceEmployee,
      @ObjectModel.foreignKey.association: '_ContactPerson'
      contact_person                                                       as ContactPerson,
      @ObjectModel.foreignKey.association: '_ShipToParty'
      ship_to_party                                                        as ShipToParty,
      @ObjectModel.foreignKey.association: '_BillToParty'
      bill_to_party                                                        as BillToParty,
      payer                                                                as PayerParty,

      // Dates

      cast( valid_from as crms4_template_start preserving type )           as SrvcDocTmplValdtyStartDateTime,
      cast( valid_to as crms4_template_end preserving type )               as SrvcDocTmplValdtyEndDateTime,
      srv_cust_beg                                                         as RequestedServiceStartDateTime,
      srv_cust_end                                                         as RequestedServiceEndDateTime,
      contstart                                                            as ServiceContractStartDateTime,
      contend                                                              as ServiceContractEndDateTime,
      sc_earliest_start_date                                               as SrvcContrEarliestStartDateTime,
      sc_latest_end_date                                                   as SrvcContrLatestEndDateTime,
      cast( quot_start as crms4_cont_start )                               as SrvcQtanValidityStartDateTime,
      cast( quot_end as crms4_cont_end )                                   as SrvcQtanValidityEndDateTime,


      // Pricing Parameter Set

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

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

      @ObjectModel.foreignKey.association: '_SrvcSEPAMandateRelevance'
      sepa_on                                                              as SrvcSEPAMandateRelevance,
      mandate_id                                                           as SEPAMandate,

      wbs_element                                                          as WBSElementInternalID,

      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      @Semantics.currencyCode:true
      currency                                                             as TransactionCurrency,

      // Sales Set

      po_number_sold                                                       as PurchaseOrderByCustomer,
      po_date_sold                                                         as CustomerPurchaseOrderDate,
      @ObjectModel.foreignKey.association: '_SrvcDocumentRejectionReason'
      rejection                                                            as ServiceDocumentRejectionReason,
      @ObjectModel.foreignKey.association: '_Region'
      region                                                               as Region,

      // Status

      @ObjectModel.foreignKey.association: '_SrvcDocLifecycleStatus'
      stat_lifecycle                                                       as ServiceDocumentStatus,
      stat_released                                                        as ServiceDocumentIsReleased,
      @ObjectModel.foreignKey.association: '_ServiceDocHasError'
      stat_error                                                           as ServiceDocumentHasError,
      @ObjectModel.foreignKey.association: '_ServiceDocBillingStatus'
      stat_billing                                                         as ServiceDocBillingStatus,
      @ObjectModel.foreignKey.association: '_SrvcDocIsRelForBillgSts'
      stat_for_billing                                                     as ServiceDocIsReleasedForBilling,
      stat_cancelled                                                       as ServiceDocumentIsRejected,
      @ObjectModel.foreignKey.association: '_ServiceDocumentIsOpen'
      stat_open                                                            as ServiceDocumentIsOpen,
      @ObjectModel.foreignKey.association: '_SrvcDocTransferStatus'
      stat_transfer                                                        as SrvcDocTransferStatus,
      @ObjectModel.foreignKey.association: '_SrvcDocIsQuotation'
      stat_quotation                                                       as ServiceDocumentIsQuotation,
      stat_final_conf                                                      as ServiceConfirmationIsFinal,
      @ObjectModel.foreignKey.association: '_ServiceContractCanclnSts'
      stat_contract_cancelled                                              as ServiceContractCanclnSts,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'SrvcDocExecutionStatus'
      stat_maintenance                                                     as MaintSrvcOrdExecutionStatus,
      @ObjectModel.foreignKey.association: '_SrvcDocExecutionStatus'
      stat_maintenance                                                     as SrvcDocExecutionStatus,
      stat_delivery                                                        as SrvcDocDeliveryStatus,
      stat_goods_issue                                                     as SrvcDocGoodsIssueStatus,
      stat_rejection                                                       as SrvcDocRejectionStatus,
      // Business complete status

      @Semantics.booleanIndicator: true
      case stat_business_completed
      when 'M' then ''
      else stat_business_completed
       end                                                       as SrvcOrdIsBusinessCompleted,

      // Business reopened status

      @Semantics.booleanIndicator: true
      case stat_business_completed
            when 'X'
               then ''
            when 'M'
               then 'X'
            else
                    '' end                                                 as SrvcOrdIsBusinessReopened,
      // Organizational Unit Set

      @ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit_2'
      sales_org                                                            as SalesOrganizationOrgUnitID,
      @ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit_2'
      sales_office                                                         as SalesOfficeOrgUnitID,
      @ObjectModel.foreignKey.association: '_SalesGroupOrgUnit_2'
      sales_group                                                          as SalesGroupOrgUnitID,
      @ObjectModel.foreignKey.association: '_DistributionChannel'
      dis_channel                                                          as DistributionChannel,
      @ObjectModel.foreignKey.association: '_Division'
      division                                                             as Division,
      @ObjectModel.foreignKey.association: '_ServiceOrganizationOrgUnit_2'
      service_org                                                          as ServiceOrganization,
      @ObjectModel.foreignKey.association: '_RespSrvcOrganizationOrgUnit_2'
      service_org_resp                                                     as ResponsibleServiceOrganization,

      // Organizational units with the S/4 SD codes

      @ObjectModel.foreignKey.association: '_SalesOrganization'
      sales_org_sd                                                         as SalesOrganization,
      @ObjectModel.foreignKey.association: '_SalesOffice'
      sales_office_sd                                                      as SalesOffice,
      @ObjectModel.foreignKey.association: '_SalesGroup'
      sales_group_sd                                                       as SalesGroup,

      // Service Organizational Units with S/4 Code

      service_team_rm                                                      as RespyMgmtServiceTeam,
      @ObjectModel.foreignKey.association: '_EnterpriseServiceOrg'
      enterprise_service_org                                               as EnterpriseServiceOrganization,

      // Billing Set

      @ObjectModel.foreignKey.association: '_BillingBlockReason'
      billing_block                                                        as BillingBlockReason,

      // Subject

      asp_id_01                                                            as ServiceReasonSchema,
      cat_id_01                                                            as ServiceReasonCategory,
      asp_id_02                                                            as ServiceDefectSchema,
      cat_id_02                                                            as ServiceDefectCategory,

      // Dates

      srv_rfirst                                                           as ServiceFirstResponseByDateTime,
      due_on                                                               as ServiceDueByDateTime,
      cast(req_dlv_date_h as  tzntstmps)                                   as ErlstRequestedDeliveryDateTime,

      // Service Request

      rec_priority                                                         as RecommendedServicePriority,
      urgency                                                              as ServiceDocumentUrgency,
      impact                                                               as ServiceDocumentImpact,
      escalation                                                           as ServiceEscalationLevel,
      @ObjectModel.foreignKey.association: '_ServiceDocProblemCategory'
      problem_category                                                     as ServiceDocumentProblemCategory,
      @ObjectModel.foreignKey.association: '_ServiceRisk'
      risk                                                                 as ServiceRisk,

      // Cancel Header

      cancparty                                                            as ServiceDocumentCanclnParty,
      canc_reason                                                          as ServiceDocumentCanclnReason,

      // In-House Repair Reference

      ref_inhouse_repair                                                   as ReferenceInHouseRepair,
      ref_inhouse_repair_item                                              as ReferenceInHouseRepairItem,
      has_ref_inhouse_repair                                               as RefInHouseRepairIsExisting,

      templ_searchterm                                                     as SrvcDocTemplateSearchTermText,

      // Credit Status

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

      // GTS Embargo Status

      @ObjectModel.foreignKey.association: '_SrvcDocGTSEmbargoStatus'
      stat_gts_embargo                                                     as SrvcDocGTSEmbargoStatus,

      // GTS Screening Status

      @ObjectModel.foreignKey.association: '_SrvcDocGTSScreeningStatus'
      stat_gts_screening                                                   as SrvcDocGTSScreeningStatus,

      // GTS Legal Control

      @ObjectModel.foreignKey.association: '_SrvcDocGTSLglControlStatus'
      stat_gts_legal_control                                               as SrvcDocGTSLglControlStatus,

      // Baseline Cost Posting Status

      @ObjectModel.foreignKey.association: '_SrvcDocBslnCostPostgStatus'
      stat_bsln_cost_postg                                                 as SrvcDocBslnCostPostgStatus,

      // Cost Posting Status for Continuous Planning

      @ObjectModel.foreignKey.association: '_SrvcDocContinuousCostStatus'
      stat_cont_cost_calc                                                  as SrvcDocContinuousCostStatus,

      //Shipping

      ship_cond                                                            as ShippingCondition,

      //Pricing Group

      price_grp                                                            as CustomerPriceGroup,

      cast(ac_object_type as crmt_ac_object_type_no_conv preserving type ) as SrvcDocAcctAssgmtObjectType,
      ac_assignment                                                        as SrvcDocAcctAssgmtObject,

      // Associations to next level

      // Header Keys Assocations

      _ServiceObjType,

      // Header Details Assocations

      _ServiceDocumentType,

      // Partner Details Associations

      _SoldToParty,
      _RespEmployee,
      _ServiceTeam,
      _ServiceEmployee,
      _ContactPerson,
      _ShipToParty,
      _BillToParty,
      _PayerParty,
      _SoldToPartyToCustomer,
      _SoldToPartyCountry,
      _SoldToPartyRegion,
      _ServiceTeamHeader,

      // Status Assocations

      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SrvcDocLifecycleStatus'
      _ServiceDocumentStatus,
      _SrvcDocLifecycleStatus,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _ServiceDocBillingStatus,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SrvcDocIsRelForBillgSts,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _ServiceDocumentIsOpen,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _ServiceDocHasError,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _ServiceContractCanclnSts,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SrvcDocTransferStatus,

      // Billing Set Associations

      _BillingBlockReason,

      // Activity Associations

      _ActivityCategory,
      _ServiceDocumentPriority,

      // Pricing Parameter Set

      _TransactionCurrency,
      _PaymentTerms,
      _PaymentMethod,

      //sepa mandate

      _SrvcSEPAMandateRelevance,

      _FixedPrice,

      // Organization Unit Set Assocations

      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesOrganizationOrgUnit_2'
      _SalesOrganizationOrgUnit,
      _SalesOrganizationOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesOfficeOrgUnit_2'
      _SalesOfficeOrgUnit,
      _SalesOfficeOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesGroupOrgUnit_2'
      _SalesGroupOrgUnit,
      _SalesGroupOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ServiceOrganizationOrgUnit_2'
      _ServiceOrganizationOrgUnit,
      _ServiceOrganizationOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_RespSrvcOrganizationOrgUnit_2'
      _RespSrvcOrganizationOrgUnit,
      _RespSrvcOrganizationOrgUnit_2,
      _SalesOrganization,
      _SalesOffice,
      _SalesGroup,
      _DistributionChannel,
      _Division,
      _EnterpriseServiceOrg,

      // Sales Set Assocaition

      _Region,
      _SrvcDocumentRejectionReason,

      // Service Request Association

      _ServiceRisk,
      _ServiceDocProblemCategory,

      // Credit Status association

      _SrvcDocCreditStatus,

      // GTS Legal Control Status association

      _SrvcDocGTSLglControlStatus,

      //GTS Screening Status

      _SrvcDocGTSScreeningStatus,

      //GTS Embargo Status

      _SrvcDocGTSEmbargoStatus,

      // Baseline Cost Posting status

      _SrvcDocBslnCostPostgStatus,

      // Cost Calc Status for Continuous Planning

      _SrvcDocContinuousCostStatus,

      _SrvcDocIsQuotation,
      _SrvcDocExecutionStatus


}