I_SERVICEDOCUMENT

CDS View

Service Transaction

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

CDS Views using this table (84)

ViewTypeJoinVDMDescription
A_BusSolnOrdPartner view_entity inner COMPOSITE Solution Order Partner
A_BusSolnOrdPartnerAddress view_entity inner COMPOSITE Partner Address of Solution Order
A_BusSolnOrdUserStatus view inner COMPOSITE Header User Status
A_ServiceConfUserStatus view_entity inner COMPOSITE Service Confirmation User Status
A_ServiceOrderTmplText view_entity inner COMPOSITE Service Order Template Text
A_ServiceOrdUserStatus view_entity inner COMPOSITE Service Order User Status
A_ServiceQuotationText view_entity inner COMPOSITE Service Quotation Text
A_SrvcConfAppointment view_entity inner COMPOSITE Service Confirmation Appointment
A_SrvcConfDuration view_entity inner COMPOSITE Service Confirmation Duration
A_SrvcOrdAppointment view_entity inner COMPOSITE Service Order Appointment
A_SrvcOrdDuration view_entity inner COMPOSITE Service Order Duration
A_SrvcOrdPartner view_entity inner COMPOSITE Service Order Partner
A_SrvcOrdPartnerAddress view_entity inner COMPOSITE Partner Address of Service Order
A_SrvcOrdTmplAppointment view_entity inner COMPOSITE Service Order Template Appointment
A_SrvcOrdTmplDuration view_entity inner COMPOSITE Service Order Template Duration
A_SrvcOrdTmplPartner view_entity inner COMPOSITE Service Order Template Partner
A_SrvcOrdTmplPartnerAddress view_entity inner COMPOSITE Partner Address of Service Order Template
A_SrvcOrdTmplUserStatus view_entity inner COMPOSITE Service Order Template User Status
C_ARProcFlwAttribForSrvcConf view_entity from CONSUMPTION Service Confirmation Attributes
C_ARProcFlwAttribForSrvcOrder view_entity from CONSUMPTION Service Order Attributes
C_BusSolnOrdOutputParam view from CONSUMPTION Solution Order Output Parameter Determination
C_DspDocFlwServiceConfirmation view_entity from CONSUMPTION Service Confirmation Attributes
C_DspDocFlwServiceContract view_entity from CONSUMPTION Service Contract Attributes
C_DspDocFlwServiceOrder view_entity from CONSUMPTION Service Order Attributes
C_DspDocFlwSolutionOrder view_entity from CONSUMPTION Solution Order Attributes
C_DspDocFlwSolutionOrderVH view_entity from CONSUMPTION Solution Order
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
I_ARProcessFlowDocumentVH view union_all COMPOSITE Document Number
I_BusinessSolutionOrderStdVH view from COMPOSITE Solution Order Value Help
I_RU_Contract view union COMPOSITE Contracts in Russian Financials
I_ServiceContract view_entity from BASIC Service Contract
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_entity from BASIC 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_entity left_outer COMPOSITE View for Service Conf. Billing Items
I_SrvcDocByDocumentType view from BASIC Service Transaction by Transaction Type
I_SrvcDocItemPriceElement view_entity inner BASIC Service Transaction Item Pricing Element
I_SrvcOrdTransfStatusSituation view_entity from COMPOSITE Data Transfer Situations
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_ServiceOrderFulfillment view from COMPOSITE View for service order fulfillment monitor
P_SrvcTransWthSituation view_entity inner COMPOSITE service orders with situation instances
R_BusSolnOrdLongTextTP view_entity inner TRANSACTIONAL Business Solution Order Long Text - TP
R_BusSolnOrdPartnerAddressTP view_entity inner TRANSACTIONAL Business Soln Order Partner Address - 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_SrvcConfLongTextTP view_entity inner TRANSACTIONAL Long Text for Service Confirmation
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_SrvcContrPartnerAddressTP view_entity inner TRANSACTIONAL Partner Address in Service Contract - TP
R_SrvcContrPartnerTP view_entity inner TRANSACTIONAL Service Contract Partner - 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_SrvcOrdLongTextTP view_entity inner TRANSACTIONAL Long Text for Service Order
R_SrvcOrdPartnerAddressTP view_entity inner TRANSACTIONAL Partner Address For Service Order - TP
R_SrvcOrdPartnerTP view_entity inner TRANSACTIONAL Service Order Partner - TP
R_SrvcOrdReferenceObjectTP view_entity inner TRANSACTIONAL Service Order Reference Object - 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_SrvcOrdTmplRefObjectTP view_entity inner TRANSACTIONAL Service Order Template Ref Object - TP
R_SrvcOrdTmplUserStatusTP view_entity inner TRANSACTIONAL Service Order Template User Status - TP
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_SrvcQtanPartnerAddressTP view_entity inner TRANSACTIONAL Partner Address For Service Quotation-TP
R_SrvcQtanPartnerTP view_entity inner TRANSACTIONAL Service Quotation Partner - TP
R_SrvcQtanUserStatusTP view_entity inner TRANSACTIONAL Service Quotation User Status - TP

Fields (59)

KeyField CDS FieldsUsed in Views
KEY ServiceDocument BusinessSolutionOrder,ServiceConfirmation,ServiceContract,ServiceDocument,ServiceOrder,ServiceOrderTemplate,ServiceQuotation,SubscriptionOrder 30
KEY ServiceDocumentType ServiceDocumentType 3
KEY ServiceDocumentUUID BusinessSolutionOrderUUID,ServiceDocumentUUID 3
KEY ServiceObjectType ServiceObjectType 6
_DistributionChannel _DistributionChannel 2
_Division _Division 2
_RespEmployee _RespEmployee 1
_SalesGroup _SalesGroup 2
_SalesGroupOrgUnit _SalesGroupOrgUnit 1
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2 2
_SalesOffice _SalesOffice 2
_SalesOfficeOrgUnit _SalesOfficeOrgUnit 1
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2 2
_SalesOrganization _SalesOrganization 2
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit 1
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2 2
_ServiceDocBillingStatus _ServiceDocBillingStatus 1
_ServiceDocHasError _ServiceDocHasError 1
_ServiceDocumentIsOpen _ServiceDocumentIsOpen 1
_ServiceDocumentStatus _ServiceDocumentStatus 2
_ServiceDocumentType _ServiceDocumentType 1
_ServiceObjType _ServiceObjType 2
_ServiceOrganizationOrgUnit _ServiceOrganizationOrgUnit 1
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2 1
_SoldToParty _SoldToParty 1
_SoldToPartyCountry _SoldToPartyCountry 1
_SoldToPartyRegion _SoldToPartyRegion 1
_SrvcDocIsRelForBillgSts _SrvcDocIsRelForBillgSts 1
_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus 2
DistributionChannel DistributionChannel 6
Division Division 6
PaymentTerms PaymentTerms 3
PurchaseOrderByCustomer PurchaseOrderByCustomer 3
ResponsibleEmployee RespEmployeeBusinessPartnerId,ResponsibleEmployee 2
SalesGroup SalesGroup 3
SalesGroupOrgUnitID SalesGroupOrgUnitID 3
SalesOffice SalesOffice 3
SalesOfficeOrgUnitID SalesOfficeOrgUnitID 3
SalesOrganization SalesOrganization 10
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID 3
ServiceDocBillingStatus ServiceDocBillingStatus 1
ServiceDocCreationDateTime ServiceDocCreationDateTime 3
ServiceDocGrossAmount ServiceDocGrossAmount 3
ServiceDocIsReleasedForBilling ServiceDocIsReleasedForBilling 1
ServiceDocNetAmount ServiceDocNetAmount 4
ServiceDocumentCreatedByUser ServiceDocumentCreatedByUser 4
ServiceDocumentDescription ServiceDocumentDescription 1
ServiceDocumentHasError ServiceDocumentHasError 1
ServiceDocumentIsOpen ServiceDocumentIsOpen 1
ServiceDocumentIsQuotation ServiceDocumentIsQuotation 1
ServiceDocumentIsRejected ServiceDocumentIsRejected 1
ServiceDocumentIsReleased ServiceDocumentIsReleased 1
ServiceDocumentStatus ServiceDocumentStatus 5
ServiceOrganization ServiceOrganization 2
SoldToParty SoldToParty 8
SoldToPartyCountry SoldToPartyCountry 1
SoldToPartyRegion SoldToPartyRegion 1
SrvcDocTransferStatus SrvcDocTransferStatus 1
TransactionCurrency TransactionCurrency 8
@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" ]  } */
/*+[hideWarning] { "IDS" : [ "CARDINALITY_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 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
  
  association [1..1] to I_SrvcDocQuotationStatus_2   as _SrvcDocIsQuotation_2            on  $projection.ServiceDocumentIsQuotation = _SrvcDocIsQuotation_2.ServiceDocumentIsQuotation
{
      // 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,
      cust_hierarchy_relevance                                   as SrvcDocCustHierarchyRelevance,
      custh_branch_uuid                                          as CustomerHierarchyBranchUUID,
      custh_branch_uuid_ori                                      as SrvcDocCustomerHierarchyOrigin,

      // 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_2'
      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,

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

      // 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,
      
      dlv_prio                                                   as DeliveryPriority,
      incoterms1                                                 as IncotermsPart1,
      incoterms2                                                 as IncotermsPart2,
      contract_account                                           as ContractAccount,
      
      // 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,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SalesOrganizationOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesOfficeOrgUnit_2'
      _SalesOfficeOrgUnit,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SalesOfficeOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SalesGroupOrgUnit_2'
      _SalesGroupOrgUnit,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SalesGroupOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ServiceOrganizationOrgUnit_2'
      _ServiceOrganizationOrgUnit,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _ServiceOrganizationOrgUnit_2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_RespSrvcOrganizationOrgUnit_2'
      _RespSrvcOrganizationOrgUnit,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _RespSrvcOrganizationOrgUnit_2,
      _SalesOrganization,
      _SalesOffice,
      _SalesGroup,
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _DistributionChannel,
      _Division,
      _EnterpriseServiceOrg,

      // Sales Set Assocaition

      _Region,
      _SrvcDocumentRejectionReason,

      // Service Request Association

      _ServiceRisk,
      _ServiceDocProblemCategory,

      // Credit Status association

      _SrvcDocCreditStatus,

      // Baseline Cost Posting status

      _SrvcDocBslnCostPostgStatus,

      // Cost Calc Status for Continuous Planning

      _SrvcDocContinuousCostStatus,

      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_SrvcDocIsQuotation_2'
      _SrvcDocIsQuotation,
      
      @ObjectModel.association.boundFields.dataMatchesSourceAndTargetTypes: true
      _SrvcDocIsQuotation_2,
      
      _SrvcDocExecutionStatus


}