C_ServiceOrderEnhcd

DDL: C_SERVICEORDERENHCD SQL: CSRVENHCD Type: view CONSUMPTION

Get all basic data for Service Order

C_ServiceOrderEnhcd is a Consumption CDS View that provides data about "Get all basic data for Service Order" in SAP S/4HANA. It reads from 1 data source (I_ServiceDocumentEnhcd) and exposes 86 fields with key field ServiceOrder. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd from

Associations (5)

CardinalityTargetAliasCondition
[0..1] C_ServiceDocumentSoldToPartyVH _SoldToParty $projection.SoldToParty = _SoldToParty.BusinessPartner
[1..*] C_ServiceDocObjPgNotes _ServiceDocumentNotes $projection.ServiceObjectType = _ServiceDocumentNotes.ServiceObjectType and $projection.ServiceOrder = _ServiceDocumentNotes.ServiceDocument
[1..*] C_SrvcDocObjPgTransHistory _ServiceDocumentTransHistory $projection.ServiceObjectType = _ServiceDocumentTransHistory.ServiceObjectType and $projection.ServiceOrder = _ServiceDocumentTransHistory.ServiceDocument
[1..*] C_ServiceDocObjPgErrorLog _ServiceDocumentErrorLog $projection.ServiceObjectType = _ServiceDocumentErrorLog.ServiceObjectType and $projection.ServiceOrder = _ServiceDocumentErrorLog.ServiceDocument
[0..*] C_ServiceDocumentPartner _PartiesInvolved $projection.ServiceObjectType = _PartiesInvolved.CustMgmtObjectType and $projection.ServiceOrder = _PartiesInvolved.CustMgmtDocument and _PartiesInvolved.CustMgmtDocumentItem = '000000'

Annotations (12)

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

Fields (86)

KeyFieldSource TableSource FieldDescription
KEY ServiceOrder ServiceDocument Transaction ID
ServiceDocumentType ServiceDocumentType Transaction Type
ServiceObjectType ServiceObjectType Object Type
ServiceOrderDescription ServiceDocumentDescription
SoldToParty SoldToParty Sold-to Party
ShipToParty ShipToParty Ship-To Party (obsolete)
BillToParty BillToParty Inv. Recipient
ServiceOrderPriority ServiceDocumentPriority
PostingDate PostingDate Posting Date for GR
ServiceDocumentHasError ServiceDocumentHasError
ServiceOrderStatus ServiceDocumentStatus
Equipment _ServiceDocRefObj Equipment Equipment check
EquipmentName
FunctionalLocation _ServiceDocRefObj FunctionalLocation Object ID
FunctionalLocationName
ReferenceProduct
ProductID _ServiceDocRefObj ProductID Product ID
ProductName
PaymentTerms PaymentTerms Pyt Terms
BusinessActivityCategory BusinessActivityCategory
clientNULLasRequestedServiceStartDate
clientNULLasRequestedServiceEndDate
ResponsibleEmployee ResponsibleEmployee Employee Resp.
ServiceTeam ServiceTeam
SoldToPartyCountry SoldToPartyCountry
SoldToPartyRegion SoldToPartyRegion
PurchaseOrderByCustomer PurchaseOrderByCustomer Purchase Order Number
ServiceEmployee ServiceEmployee
ContactPerson ContactPerson Contact Person Key
ServiceDocumentUUID ServiceDocumentUUID Object GUID
ServiceOrderUUID ServiceDocumentCharUUID
ServiceDocumentIsQuotation ServiceDocumentIsQuotation
ServiceDocumentIsReleased ServiceDocumentIsReleased
ServiceDocumentIsOpen ServiceDocumentIsOpen
ServiceDocBillingStatusName
ServiceDocIsRelForBillCritlty
ServiceDocOvrlBillgBlkStsName
SrvcDocOvrlBillgBlkStsCritlty
ServiceDocOvrlBillingStsName
ServiceDocOvrlBillgBlkSts
ServiceDocOvrlBillingStsCritl
ServiceDocOvrlBillingSts
PriceIsFixed
OverallCompletionPercent
SrvcConfGrossAmount
ServiceDocDuration
ActualDurationInHours
SalesOrganization SalesOrganization Sales Organization
DistributionChannel DistributionChannel RefDistCh-Cust/Mat.
Division Division Internal Division ID
SalesOffice SalesOffice Sales Office
SalesGroup SalesGroup Sales Group
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID SalesOfficeOrgUnitID
SalesGroupOrgUnitID SalesGroupOrgUnitID
ServiceOrganization ServiceOrganization
_SalesOrganizationOrgUnit _SalesOrganizationOrgUnit
_SalesOfficeOrgUnit _SalesOfficeOrgUnit
_SalesGroupOrgUnit _SalesGroupOrgUnit
_ServiceOrganizationOrgUnit _ServiceOrganizationOrgUnit
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2
_PaymentTerms _PaymentTerms
_SoldToParty _SoldToParty
_RespEmployee _RespEmployee
_ServiceTeam _ServiceTeam
_ServiceEmployee _ServiceEmployee
_ContactPerson _ContactPerson
_ServiceDocumentType _ServiceDocumentType
_ServiceDocumentPriority _ServiceDocumentPriority
_ServiceDocumentStatus _ServiceDocumentStatus
_SrvcDocLifecycleStatus _SrvcDocLifecycleStatus
_ServiceDocHasError _ServiceDocHasError
_ActivityCategory _ActivityCategory
_ServiceDocRefObj _ServiceDocRefObj
_ServiceDocumentTransHistory _ServiceDocumentTransHistory
_ServiceDocumentErrorLog _ServiceDocumentErrorLog
_SalesOrganization _SalesOrganization
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_Division _Division
_DistributionChannel _DistributionChannel
_ServiceDocumentNotes _ServiceDocumentNotes
_PartiesInvolved _PartiesInvolved

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view C_ServiceOrderEnhcd.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: CSRVENHCD

CREATE VIEW C_ServiceOrderEnhcd AS
SELECT
  ServiceDocument AS ServiceOrder,
  ServiceDocumentType,
  ServiceObjectType,
  ServiceDocumentDescription AS ServiceOrderDescription,
  SoldToParty,
  ShipToParty,
  BillToParty,
  ServiceDocumentPriority AS ServiceOrderPriority,
  PostingDate,
  ServiceDocumentHasError,
  ServiceDocumentStatus AS ServiceOrderStatus,
  _ServiceDocRefObj.Equipment AS Equipment,
  _ServiceDocRefObj._Equipment._EquipmentText[1: Language=$session.system_language].EquipmentName AS EquipmentName,
  _ServiceDocRefObj.FunctionalLocation AS FunctionalLocation,
  _ServiceDocRefObj._FunctionalLocation._FunctionalLocationText[1: Language=$session.system_language].FunctionalLocationName AS FunctionalLocationName,
  _ServiceDocRefObj._Equipment.Material AS ReferenceProduct,
  _ServiceDocRefObj.ProductID AS ProductID,
  _ServiceDocRefObj._Product._Text[1: Language=$session.system_language].ProductName AS ProductName,
  PaymentTerms,
  BusinessActivityCategory,
  tstmp_to_dats( RequestedServiceStartDateTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as RequestedServiceStartDate AS clientNULLasRequestedServiceStartDate,
  tstmp_to_dats( RequestedServiceEndDateTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as RequestedServiceEndDate AS clientNULLasRequestedServiceEndDate,
  ResponsibleEmployee,
  ServiceTeam,
  SoldToPartyCountry,
  SoldToPartyRegion,
  PurchaseOrderByCustomer,
  ServiceEmployee,
  ContactPerson,
  ServiceDocumentUUID,
  ServiceDocumentCharUUID AS ServiceOrderUUID,
  ServiceDocumentIsQuotation,
  ServiceDocumentIsReleased,
  ServiceDocumentIsOpen,
  cast( '' as abap.char( 40 )) AS ServiceDocBillingStatusName,
  cast(3 as abap.int4) AS ServiceDocIsRelForBillCritlty,
  cast( '' as abap.char( 40 )) AS ServiceDocOvrlBillgBlkStsName,
  cast(3 as abap.int4) AS SrvcDocOvrlBillgBlkStsCritlty,
  cast( '' as abap.char( 40 )) AS ServiceDocOvrlBillingStsName,
  cast( '' as abap.char( 1 )) AS ServiceDocOvrlBillgBlkSts,
  cast(3 as abap.int4) AS ServiceDocOvrlBillingStsCritl,
  cast( '' as abap.char( 1 )) AS ServiceDocOvrlBillingSts,
  cast( '' as crmt_boolean ) AS PriceIsFixed,
  cast(0 as abap.int4) AS OverallCompletionPercent,
  cast(0 as abap.curr(15,2)) AS SrvcConfGrossAmount,
  cast( 1 as abap.dec(13,3)) AS ServiceDocDuration,
  cast( 1 as abap.dec(13,3)) AS ActualDurationInHours,
  SalesOrganization,
  DistributionChannel,
  Division,
  SalesOffice,
  SalesGroup,
  SalesOrganizationOrgUnitID,
  SalesOfficeOrgUnitID,
  SalesGroupOrgUnitID,
  ServiceOrganization
FROM I_ServiceDocumentEnhcd
LEFT OUTER JOIN C_ServiceDocumentSoldToPartyVH AS _SoldToParty ON SoldToParty = _SoldToParty.BusinessPartner  -- association [0..1]
LEFT OUTER JOIN C_ServiceDocObjPgNotes AS _ServiceDocumentNotes ON ServiceObjectType = _ServiceDocumentNotes.ServiceObjectType AND ServiceOrder = _ServiceDocumentNotes.ServiceDocument  -- association [1..*]
LEFT OUTER JOIN C_SrvcDocObjPgTransHistory AS _ServiceDocumentTransHistory ON ServiceObjectType = _ServiceDocumentTransHistory.ServiceObjectType AND ServiceOrder = _ServiceDocumentTransHistory.ServiceDocument  -- association [1..*]
LEFT OUTER JOIN C_ServiceDocObjPgErrorLog AS _ServiceDocumentErrorLog ON ServiceObjectType = _ServiceDocumentErrorLog.ServiceObjectType AND ServiceOrder = _ServiceDocumentErrorLog.ServiceDocument  -- association [1..*]
LEFT OUTER JOIN C_ServiceDocumentPartner AS _PartiesInvolved ON ServiceObjectType = _PartiesInvolved.CustMgmtObjectType AND ServiceOrder = _PartiesInvolved.CustMgmtDocument AND _PartiesInvolved.CustMgmtDocumentItem = '000000'  -- association [0..*]
;