I_ServiceDocument

DDL: I_SERVICEDOCUMENT Type: view BASIC

Service Transaction

I_ServiceDocument is a Basic CDS View (Dimension) that provides data about "Service Transaction" in SAP S/4HANA. It reads from 1 data source (crms4d_serv_h) and exposes 162 fields with key fields ServiceObjectType, ServiceDocument. It has 56 associations to related views.

Data Sources (1)

SourceAliasJoin Type
crms4d_serv_h crms4d_serv_h from

Associations (56)

CardinalityTargetAliasCondition
[0..1] I_BusinessPartner _SoldToParty $projection.SoldToParty = _SoldToParty.BusinessPartner
[0..1] I_BusinessPartner _RespEmployee $projection.ResponsibleEmployee = _RespEmployee.BusinessPartner
[0..1] I_BusinessPartner _ServiceTeam $projection.ServiceTeam = _ServiceTeam.BusinessPartner
[0..1] I_BusinessPartner _ServiceEmployee $projection.ServiceEmployee = _ServiceEmployee.BusinessPartner
[0..1] I_BusinessPartner _ContactPerson $projection.ContactPerson = _ContactPerson.BusinessPartner
[0..1] I_BusinessPartner _ShipToParty $projection.ShipToParty = _ShipToParty.BusinessPartner
[0..1] I_BusinessPartner _BillToParty $projection.BillToParty = _BillToParty.BusinessPartner
[0..1] I_BusinessPartner _PayerParty $projection.PayerParty = _PayerParty.BusinessPartner
[0..*] I_BusinessPartnerCustomer _SoldToPartyToCustomer $projection.SoldToParty = _SoldToPartyToCustomer.BusinessPartner
[0..1] I_ServiceDocumentType _ServiceDocumentType $projection.ServiceDocumentType = _ServiceDocumentType.ServiceDocumentType
[0..1] I_ServiceDocumentPriority _ServiceDocumentPriority $projection.ServiceDocumentPriority = _ServiceDocumentPriority.ServiceDocumentPriority
[0..1] I_ServiceDocumentStatus _ServiceDocumentStatus $projection.ServiceDocumentStatus = _ServiceDocumentStatus.ServiceDocumentStatus
[0..1] I_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus $projection.ServiceDocumentStatus = _SrvcDocLifecycleStatus.ServiceDocumentStatus
[0..1] I_ServiceDocBillingStatus _ServiceDocBillingStatus $projection.ServiceDocBillingStatus = _ServiceDocBillingStatus.ServiceDocBillingStatus
[0..1] I_SrvcDocRelForBillgSts _SrvcDocIsRelForBillgSts $projection.ServiceDocIsReleasedForBilling = _SrvcDocIsRelForBillgSts.ServiceDocIsReleasedForBilling
[0..1] I_ServiceDocErrorStatus _ServiceDocHasError $projection.ServiceDocumentHasError = _ServiceDocHasError.ServiceDocumentHasError
[0..1] I_ServiceDocOpenStatus _ServiceDocumentIsOpen $projection.ServiceDocumentIsOpen = _ServiceDocumentIsOpen.ServiceDocumentIsOpen
[0..1] I_BillingBlockReason _BillingBlockReason $projection.BillingBlockReason = _BillingBlockReason.BillingBlockReason
[0..1] I_BusinessActivityCategory _ActivityCategory $projection.BusinessActivityCategory = _ActivityCategory.BusinessActivityCategory
[1..1] I_CustMgmtBusObjType _ServiceObjType $projection.ServiceObjectType = _ServiceObjType.BusinessObjectType
[0..1] I_Currency _TransactionCurrency $projection.TransactionCurrency = _TransactionCurrency.Currency
[0..1] I_PaymentTerms _PaymentTerms $projection.PaymentTerms = _PaymentTerms.PaymentTerms
[0..1] I_SrvcSEPAMandateRelevance _SrvcSEPAMandateRelevance $projection.SrvcSEPAMandateRelevance = _SrvcSEPAMandateRelevance.SrvcSEPAMandateRelevance
[0..1] I_ServiceDocumentFixedPrice _FixedPrice $projection.ServiceObjectType = _FixedPrice.ServiceObjectType and $projection.ServiceDocument = _FixedPrice.ServiceDocument and $projection.PricingDocument = _FixedPrice.PricingDocument and _FixedPrice.PricingDocumentItem = '000000'
[0..1] I_SalesOrganizationUnit _SalesOrganizationOrgUnit $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit.OrganizationalUnit
[0..1] I_SalesOrganizationUnit _SalesOfficeOrgUnit $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit.OrganizationalUnit
[0..1] I_SalesOrganizationUnit _SalesGroupOrgUnit $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit.OrganizationalUnit
[0..1] I_SalesOrganizationUnit _ServiceOrganizationOrgUnit $projection.ServiceOrganization = _ServiceOrganizationOrgUnit.OrganizationalUnit
[0..1] I_SalesOrganizationUnit _RespSrvcOrganizationOrgUnit $projection.ResponsibleServiceOrganization = _RespSrvcOrganizationOrgUnit.OrganizationalUnit
[0..1] I_SrvcMgmtOrganizationUnit _SalesOrganizationOrgUnit_2 $projection.SalesOrganizationOrgUnitID = _SalesOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated
[0..1] I_SrvcMgmtOrganizationUnit _SalesOfficeOrgUnit_2 $projection.SalesOfficeOrgUnitID = _SalesOfficeOrgUnit_2.OrgUnitTypeIDConcatenated
[0..1] I_SrvcMgmtOrganizationUnit _SalesGroupOrgUnit_2 $projection.SalesGroupOrgUnitID = _SalesGroupOrgUnit_2.OrgUnitTypeIDConcatenated
[0..1] I_SrvcMgmtOrganizationUnit _ServiceOrganizationOrgUnit_2 $projection.ServiceOrganization = _ServiceOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated
[0..1] I_SrvcMgmtOrganizationUnit _RespSrvcOrganizationOrgUnit_2 $projection.ResponsibleServiceOrganization = _RespSrvcOrganizationOrgUnit_2.OrgUnitTypeIDConcatenated
[0..1] I_SalesOrganization _SalesOrganization $projection.SalesOrganization = _SalesOrganization.SalesOrganization
[0..1] I_SalesOffice _SalesOffice $projection.SalesOffice = _SalesOffice.SalesOffice
[0..1] I_SalesGroup _SalesGroup $projection.SalesGroup = _SalesGroup.SalesGroup
[0..1] I_Division _Division $projection.Division = _Division.Division
[0..1] I_DistributionChannel _DistributionChannel $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] I_SalesDocumentRjcnReason _SrvcDocumentRejectionReason $projection.ServiceDocumentRejectionReason = _SrvcDocumentRejectionReason.SalesDocumentRjcnReason
[0..1] I_Country _SoldToPartyCountry $projection.SoldToPartyCountry = _SoldToPartyCountry.Country
[0..1] I_Region _SoldToPartyRegion $projection.SoldToPartyRegion = _SoldToPartyRegion.Region and $projection.SoldToPartyCountry = _SoldToPartyRegion.Country
[0..1] I_Region _Region $projection.Region = _Region.Region and $projection.SoldToPartyCountry = _Region.Country
[0..1] I_ServiceRisk _ServiceRisk $projection.ServiceRisk = _ServiceRisk.ServiceRisk
[0..1] I_ServiceDocProblemCategory _ServiceDocProblemCategory $projection.ServiceDocumentProblemCategory = _ServiceDocProblemCategory.ServiceDocumentProblemCategory
[0..1] I_RespyMgmtTeamHeaderDetail _ServiceTeamHeader $projection.RespyMgmtServiceTeam = _ServiceTeamHeader.RespyMgmtTeamID
[0..1] I_EnterpriseServiceOrg _EnterpriseServiceOrg $projection.EnterpriseServiceOrganization = _EnterpriseServiceOrg.EnterpriseServiceOrganization
[0..1] I_ServiceContractCanclnSts _ServiceContractCanclnSts $projection.ServiceContractCanclnSts = _ServiceContractCanclnSts.ServiceContractCanclnSts
[0..1] I_SrvcDocTransferStatus _SrvcDocTransferStatus $projection.SrvcDocTransferStatus = _SrvcDocTransferStatus.SrvcDocTransferStatus
[0..1] I_SrvcDocCreditStatus _SrvcDocCreditStatus $projection.SrvcDocCreditStatus = _SrvcDocCreditStatus.SrvcDocCreditStatus
[0..1] E_ServiceDocument _ServiceDocumentExt $projection.ServiceObjectType = _ServiceDocumentExt.ServiceCategory and $projection.ServiceDocument = _ServiceDocumentExt.ServiceOrder
[0..1] I_SrvcDocBslnCostPostgStatus _SrvcDocBslnCostPostgStatus $projection.SrvcDocBslnCostPostgStatus = _SrvcDocBslnCostPostgStatus.SrvcDocBslnCostPostgStatus
[0..1] I_SrvcDocBslnCostPostgStatus _SrvcDocContinuousCostStatus $projection.SrvcDocContinuousCostStatus = _SrvcDocContinuousCostStatus.SrvcDocBslnCostPostgStatus
[0..1] I_SrvcDocPaymentMethod _PaymentMethod $projection.PaymentMethod = _PaymentMethod.PaymentMethod and ( $projection.SalesOrganization = _PaymentMethod.SalesOrganization or $projection.SalesOrganizationOrgUnitID = _PaymentMethod.OrgUnitTypeIDConcatenated )
[0..1] I_SrvcDocExecutionStatus _SrvcDocExecutionStatus $projection.SrvcDocExecutionStatus = _SrvcDocExecutionStatus.SrvcDocExecutionStatus and $projection.ServiceDocumentIsQuotation = _SrvcDocExecutionStatus.ServiceDocumentIsQuotation
[1..1] I_Indicator _SrvcDocIsQuotation $projection.ServiceDocumentIsQuotation = _SrvcDocIsQuotation.IndicatorValue

Annotations (16)

NameValueLevelField
EndUserText.label Service Transaction view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName ISERVDOC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
AccessControl.authorizationCheck #CHECK view
ObjectModel.representativeKey ServiceDocument view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #XXL view
Analytics.dataCategory #DIMENSION view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view

Fields (162)

KeyFieldSource TableSource FieldDescription
KEY ServiceObjectType objtype_h
KEY ServiceDocument object_id
ServiceDocumentUUID header_guid
ServiceDocumentCharUUID header_guid_char
ServiceDocumentType process_type
ServiceDocumentDescription description_h
Language descr_language
PostingDate posting_date
ServiceDocumentTemplateType template_type
ServiceDocCreationDateTime created_at_h
ServiceDocChangedDateTime changed_at_h
ServiceDocumentCreatedByUser created_by_h
ServiceDocumentChangedByUser changed_by_h
PricingDocument pricing_document
PricingProcedure pricing_procedure
RefBusinessSolutionOrder refbussolnord
SrvcDocIsMaintServiceOrder is_maintenance_order
BusinessActivityCategory category
ServiceDocumentPriority priority
ServiceDocNetAmount net_value_h
ServiceDocGrossAmount gross_value_h
ServiceDocTaxAmount tax_amount_h
SoldToParty sold_to_party
SoldToPartyRegion sold_to_region
SoldToPartyCountry sold_to_country
ServiceTeam service_team
ResponsibleEmployee person_resp
ServiceEmployee service_employee
ContactPerson contact_person
ShipToParty ship_to_party
BillToParty bill_to_party
PayerParty payer
SrvcDocTmplValdtyStartDateTime
SrvcDocTmplValdtyEndDateTime
RequestedServiceStartDateTime srv_cust_beg
RequestedServiceEndDateTime srv_cust_end
ServiceContractStartDateTime contstart
ServiceContractEndDateTime contend
SrvcContrEarliestStartDateTime sc_earliest_start_date
SrvcContrLatestEndDateTime sc_latest_end_date
SrvcQtanValidityStartDateTime
SrvcQtanValidityEndDateTime
PaymentTerms pmnttrms
PaymentMethod payment_method
SrvcSEPAMandateRelevance sepa_on
SEPAMandate mandate_id
WBSElementInternalID wbs_element
TransactionCurrency currency
PurchaseOrderByCustomer po_number_sold
CustomerPurchaseOrderDate po_date_sold
ServiceDocumentRejectionReason rejection
Region region
ServiceDocumentStatus stat_lifecycle
ServiceDocumentIsReleased stat_released
ServiceDocumentHasError stat_error
ServiceDocBillingStatus stat_billing
ServiceDocIsReleasedForBilling stat_for_billing
ServiceDocumentIsRejected stat_cancelled
ServiceDocumentIsOpen stat_open
SrvcDocTransferStatus stat_transfer
ServiceDocumentIsQuotation stat_quotation
ServiceConfirmationIsFinal stat_final_conf
ServiceContractCanclnSts stat_contract_cancelled
MaintSrvcOrdExecutionStatus stat_maintenance
SrvcDocExecutionStatus stat_maintenance
SrvcDocDeliveryStatus stat_delivery
SrvcDocGoodsIssueStatus stat_goods_issue
SrvcDocRejectionStatus stat_rejection
SalesOrganizationOrgUnitID sales_org
SalesOfficeOrgUnitID sales_office
SalesGroupOrgUnitID sales_group
DistributionChannel dis_channel
Division division
ServiceOrganization service_org
ResponsibleServiceOrganization service_org_resp
SalesOrganization sales_org_sd
SalesOffice sales_office_sd
SalesGroup sales_group_sd
RespyMgmtServiceTeam service_team_rm
EnterpriseServiceOrganization enterprise_service_org
BillingBlockReason billing_block
ServiceReasonSchema asp_id_01
ServiceReasonCategory cat_id_01
ServiceDefectSchema asp_id_02
ServiceDefectCategory cat_id_02
ServiceFirstResponseByDateTime srv_rfirst
ServiceDueByDateTime due_on
ErlstRequestedDeliveryDateTime
RecommendedServicePriority rec_priority
ServiceDocumentUrgency urgency
ServiceDocumentImpact impact
ServiceEscalationLevel escalation
ServiceDocumentProblemCategory problem_category
ServiceRisk risk
ServiceDocumentCanclnParty cancparty
ServiceDocumentCanclnReason canc_reason
ReferenceInHouseRepair ref_inhouse_repair
ReferenceInHouseRepairItem ref_inhouse_repair_item
RefInHouseRepairIsExisting has_ref_inhouse_repair
SrvcDocTemplateSearchTermText templ_searchterm
SrvcDocCreditStatus stat_credit
SrvcDocBslnCostPostgStatus stat_bsln_cost_postg
SrvcDocContinuousCostStatus stat_cont_cost_calc
ShippingCondition ship_cond
CustomerPriceGroup price_grp
SrvcDocAcctAssgmtObjectType
SrvcDocAcctAssgmtObject ac_assignment
_ServiceObjType _ServiceObjType
_ServiceDocumentType _ServiceDocumentType
_SoldToParty _SoldToParty
_RespEmployee _RespEmployee
_ServiceTeam _ServiceTeam
_ServiceEmployee _ServiceEmployee
_ContactPerson _ContactPerson
_ShipToParty _ShipToParty
_BillToParty _BillToParty
_PayerParty _PayerParty
_SoldToPartyToCustomer _SoldToPartyToCustomer
_SoldToPartyCountry _SoldToPartyCountry
_SoldToPartyRegion _SoldToPartyRegion
_ServiceTeamHeader _ServiceTeamHeader
_ServiceDocumentStatus _ServiceDocumentStatus
_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus
_ServiceDocBillingStatus _ServiceDocBillingStatus
_SrvcDocIsRelForBillgSts _SrvcDocIsRelForBillgSts
_ServiceDocumentIsOpen _ServiceDocumentIsOpen
_ServiceDocHasError _ServiceDocHasError
_ServiceContractCanclnSts _ServiceContractCanclnSts
_SrvcDocTransferStatus _SrvcDocTransferStatus
_BillingBlockReason _BillingBlockReason
_ActivityCategory _ActivityCategory
_ServiceDocumentPriority _ServiceDocumentPriority
_TransactionCurrency _TransactionCurrency
_PaymentTerms _PaymentTerms
_PaymentMethod _PaymentMethod
_SrvcSEPAMandateRelevance _SrvcSEPAMandateRelevance
_FixedPrice _FixedPrice
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit _SalesOfficeOrgUnit
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit _SalesGroupOrgUnit
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2
_ServiceOrganizationOrgUnit _ServiceOrganizationOrgUnit
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2
_RespSrvcOrganizationOrgUnit _RespSrvcOrganizationOrgUnit
_RespSrvcOrganizationOrgUnit_2 _RespSrvcOrganizationOrgUnit_2
_SalesOrganization _SalesOrganization
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_DistributionChannel _DistributionChannel
_Division _Division
_EnterpriseServiceOrg _EnterpriseServiceOrg
_Region _Region
_SrvcDocumentRejectionReason _SrvcDocumentRejectionReason
_ServiceRisk _ServiceRisk
_ServiceDocProblemCategory _ServiceDocProblemCategory
_SrvcDocCreditStatus _SrvcDocCreditStatus
_SrvcDocBslnCostPostgStatus _SrvcDocBslnCostPostgStatus
_SrvcDocContinuousCostStatus _SrvcDocContinuousCostStatus
_SrvcDocIsQuotation _SrvcDocIsQuotation
_SrvcDocExecutionStatus _SrvcDocExecutionStatus
@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


}