C_ServiceOrderEnhcd
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)
| Source | Alias | Join Type |
|---|---|---|
| I_ServiceDocumentEnhcd | I_ServiceDocumentEnhcd | from |
Associations (5)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | ServiceOrder | ServiceDocument | ||
| ServiceDocumentType | ServiceDocumentType | |||
| ServiceObjectType | ServiceObjectType | |||
| ServiceOrderDescription | ServiceDocumentDescription | |||
| SoldToParty | SoldToParty | |||
| ShipToParty | ShipToParty | |||
| BillToParty | BillToParty | |||
| ServiceOrderPriority | ServiceDocumentPriority | |||
| PostingDate | PostingDate | |||
| ServiceDocumentHasError | ServiceDocumentHasError | |||
| ServiceOrderStatus | ServiceDocumentStatus | |||
| Equipment | _ServiceDocRefObj | Equipment | ||
| EquipmentName | ||||
| FunctionalLocation | _ServiceDocRefObj | FunctionalLocation | ||
| FunctionalLocationName | ||||
| ReferenceProduct | ||||
| ProductID | _ServiceDocRefObj | ProductID | ||
| ProductName | ||||
| PaymentTerms | PaymentTerms | |||
| BusinessActivityCategory | BusinessActivityCategory | |||
| clientNULLasRequestedServiceStartDate | ||||
| clientNULLasRequestedServiceEndDate | ||||
| ResponsibleEmployee | ResponsibleEmployee | |||
| ServiceTeam | ServiceTeam | |||
| SoldToPartyCountry | SoldToPartyCountry | |||
| SoldToPartyRegion | SoldToPartyRegion | |||
| PurchaseOrderByCustomer | PurchaseOrderByCustomer | |||
| ServiceEmployee | ServiceEmployee | |||
| ContactPerson | ContactPerson | |||
| ServiceDocumentUUID | ServiceDocumentUUID | |||
| ServiceOrderUUID | ServiceDocumentCharUUID | |||
| ServiceDocumentIsQuotation | ServiceDocumentIsQuotation | |||
| ServiceDocumentIsReleased | ServiceDocumentIsReleased | |||
| ServiceDocumentIsOpen | ServiceDocumentIsOpen | |||
| ServiceDocBillingStatusName | ||||
| ServiceDocIsRelForBillCritlty | ||||
| ServiceDocOvrlBillgBlkStsName | ||||
| SrvcDocOvrlBillgBlkStsCritlty | ||||
| ServiceDocOvrlBillingStsName | ||||
| ServiceDocOvrlBillgBlkSts | ||||
| ServiceDocOvrlBillingStsCritl | ||||
| ServiceDocOvrlBillingSts | ||||
| PriceIsFixed | ||||
| OverallCompletionPercent | ||||
| SrvcConfGrossAmount | ||||
| ServiceDocDuration | ||||
| ActualDurationInHours | ||||
| SalesOrganization | SalesOrganization | |||
| DistributionChannel | DistributionChannel | |||
| Division | Division | |||
| SalesOffice | SalesOffice | |||
| SalesGroup | SalesGroup | |||
| 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 |
@AbapCatalog.sqlViewName: 'CSRVENHCD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl :{
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@EndUserText.label: 'Get all basic data for Service Order'
@Search.searchable: true
@VDM: {
viewType: #CONSUMPTION //#COMPOSITE
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel: {
representativeKey: 'ServiceOrder',
usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #XXL
}
}
define view C_ServiceOrderEnhcd
as select from I_ServiceDocumentEnhcd
//Use this association when Sold-to party field is used
association [0..1] to C_ServiceDocumentSoldToPartyVH as _SoldToParty on $projection.SoldToParty = _SoldToParty.BusinessPartner
//Use this association when CustomerName field is used
//association [0..1] to C_ServiceDocumentSoldToPartyVH as _SoldToParty on $projection.Customer = _SoldToParty.BusinessPartner
// association [1..*] to C_SrvcOrdItemListRptAndObjPg as _SrvcOrdItemListRptAndObjPg on $projection.ServiceOrder = _SrvcOrdItemListRptAndObjPg.ServiceOrder
association [1..*] to C_ServiceDocObjPgNotes as _ServiceDocumentNotes on $projection.ServiceObjectType = _ServiceDocumentNotes.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentNotes.ServiceDocument
association [1..*] to C_SrvcDocObjPgTransHistory as _ServiceDocumentTransHistory on $projection.ServiceObjectType = _ServiceDocumentTransHistory.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentTransHistory.ServiceDocument
association [1..*] to C_ServiceDocObjPgErrorLog as _ServiceDocumentErrorLog on $projection.ServiceObjectType = _ServiceDocumentErrorLog.ServiceObjectType
and $projection.ServiceOrder = _ServiceDocumentErrorLog.ServiceDocument
association [0..*] to C_ServiceDocumentPartner as _PartiesInvolved on $projection.ServiceObjectType = _PartiesInvolved.CustMgmtObjectType
and $projection.ServiceOrder = _PartiesInvolved.CustMgmtDocument
and _PartiesInvolved.CustMgmtDocumentItem = '000000'
//OLD
// association [0..1] to C_SrvcDocBusinessPartnerVH as _ServiceTeam on $projection.ServiceTeam = _ServiceTeam.BusinessPartner
// association [0..1] to C_SrvcDocBusinessPartnerVH as _RespEmployee on $projection.ResponsibleEmployee = _RespEmployee.BusinessPartner
// association [1..*] to C_ServiceDocumentItem as _ServiceDocumentItem on $projection.ServiceObjectType = _ServiceDocumentItem.ServiceObjectType
// and $projection.ServiceOrder = _ServiceDocumentItem.ServiceDocument
//Add At outer C_view association [1..*] to C_SrvcConfirmationItem as _SrvcConfItemSrvcOrder on $projection.ServiceOrder = _SrvcConfItemSrvcOrder.ServiceOrder
//Add At outer C_view association [0..1] to E_ServiceDocument as _ServiceDocumentExt on $projection.ServiceObjectType = _ServiceDocumentExt.ServiceCategory
//Add At outer C_view and $projection.ServiceOrder = _ServiceDocumentExt.ServiceOrder
//ENDOLD
{
key ServiceDocument as ServiceOrder,
ServiceDocumentType,
ServiceObjectType,
ServiceDocumentDescription as ServiceOrderDescription,
@Consumption.valueHelp:'_SoldToParty'
SoldToParty,
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.FirstName,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.LastName,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.GroupBusinessPartnerName1,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH,fuzzinessThreshold: 0.8 }
// _SoldToParty.GroupBusinessPartnerName2,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.OrganizationBPName1,
//
// @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
// _SoldToParty.OrganizationBPName2,
ShipToParty,
BillToParty,
ServiceDocumentPriority as ServiceOrderPriority,
PostingDate,
case ServiceDocumentHasError
when 'X' then 1
when ' ' then 3
else 3
end as ServiceOrdErrorStsCriticality,
ServiceDocumentHasError,
// @ObjectModel.readOnly: true
//
// case ServiceDocumentPriority
// when ' ' then 2
// when '3' then 2 // NEW: yellow colour
// when '5' then 0 // IN_PROGRESS: grey color
// when '9' then 0 // PAID: grey color
// when '1' then 1 // CANCELLED: red color
// else 0
// end as Priority,
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocGrossAmount,
//
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocNetAmount,
//
// @Semantics.amount.currencyCode: 'TransactionCurrency'
// ServiceDocTaxAmount,
//
// @Semantics.currencyCode: true
// TransactionCurrency,
// _ServiceDocumentNotes.ServiceDocNoteText as ServiceOrderNoteText,
ServiceDocumentStatus as ServiceOrderStatus,
case _ServiceDocRefObj.ServiceReferenceObjectType
when 'B' then 'EAMS_FL'
when 'C' then 'EAMS_EQUI'
end as TechObjIsEquipOrFuncnlLoc,
case _ServiceDocRefObj.ServiceReferenceObjectType
when 'B' then cast (_ServiceDocRefObj.FunctionalLocation as eams_tec_obj)
when 'C' then cast (_ServiceDocRefObj.Equipment as eams_tec_obj)
end as TechnicalObject,
@ObjectModel.text.element: ['EquipmentName']
_ServiceDocRefObj.Equipment,
// for equipment ID navigation
_ServiceDocRefObj._Equipment._EquipmentText[1: Language=$session.system_language].EquipmentName as EquipmentName,
@ObjectModel.text.element: ['FunctionalLocationName']
_ServiceDocRefObj.FunctionalLocation,
_ServiceDocRefObj._FunctionalLocation._FunctionalLocationText[1: Language=$session.system_language].FunctionalLocationName as FunctionalLocationName,
_ServiceDocRefObj._Equipment.Material as ReferenceProduct,
_ServiceDocRefObj.ProductID,
_ServiceDocRefObj._Product._Text[1: Language=$session.system_language].ProductName as ProductName,
@Consumption.filter.hidden: true
PaymentTerms,
BusinessActivityCategory,
tstmp_to_dats( RequestedServiceStartDateTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ) as RequestedServiceStartDate,
tstmp_to_dats( RequestedServiceEndDateTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ) as RequestedServiceEndDate,
@Consumption.valueHelp:'_RespEmployee'
ResponsibleEmployee,
@Consumption.valueHelp:'_ServiceTeam'
ServiceTeam,
SoldToPartyCountry,
SoldToPartyRegion,
PurchaseOrderByCustomer,
ServiceEmployee,
ContactPerson,
ServiceDocumentUUID,
ServiceDocumentCharUUID as ServiceOrderUUID,
ServiceDocumentIsQuotation,
ServiceDocumentIsReleased,
ServiceDocumentIsOpen,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocBillingStatusName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as ServiceDocIsRelForBillCritlty,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocOvrlBillgBlkStsName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as SrvcDocOvrlBillgBlkStsCritlty,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 40 )) as ServiceDocOvrlBillingStsName,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 1 )) as ServiceDocOvrlBillgBlkSts,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(3 as abap.int4) as ServiceDocOvrlBillingStsCritl,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as abap.char( 1 )) as ServiceDocOvrlBillingSts,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( '' as crmt_boolean ) as PriceIsFixed,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(0 as abap.int4) as OverallCompletionPercent,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast(0 as abap.curr(15,2)) as SrvcConfGrossAmount,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( 1 as abap.dec(13,3)) as ServiceDocDuration,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CRMS4_MANG_SRVHDR_CALC_EXIT'
cast( 1 as abap.dec(13,3)) as ActualDurationInHours,
@ObjectModel.foreignKey.association: '_SalesOrganization'
SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
DistributionChannel,
@ObjectModel.foreignKey.association: '_Division'
Division,
@ObjectModel.foreignKey.association: '_SalesOffice'
SalesOffice,
@ObjectModel.foreignKey.association: '_SalesGroup'
SalesGroup,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesOrganizationOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesOfficeOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
SalesGroupOrgUnitID,
@Consumption.filter.hidden: true
@UI.hidden: true
ServiceOrganization,
@Consumption.filter.hidden: true
@UI.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOrganizationOrgUnit_2'
_SalesOrganizationOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesOfficeOrgUnit_2'
_SalesOfficeOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SalesGroupOrgUnit_2'
_SalesGroupOrgUnit,
@Consumption.filter.hidden: true
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_ServiceOrganizationOrgUnit_2'
_ServiceOrganizationOrgUnit,
@Consumption.filter.hidden: true
_SalesOrganizationOrgUnit_2,
@Consumption.filter.hidden: true
_SalesOfficeOrgUnit_2,
@Consumption.filter.hidden: true
_SalesGroupOrgUnit_2,
@Consumption.filter.hidden: true
_ServiceOrganizationOrgUnit_2,
_PaymentTerms, //for payment terms
// Associations
_SoldToParty,
_RespEmployee,
_ServiceTeam,
_ServiceEmployee,
_ContactPerson,
_ServiceDocumentType,
_ServiceDocumentPriority,
@API.element.releaseState: #DEPRECATED
@API.element.successor: '_SrvcDocLifecycleStatus'
_ServiceDocumentStatus,
_SrvcDocLifecycleStatus,
_ServiceDocHasError,
_ActivityCategory,
_ServiceDocRefObj,
// _SrvcOrdItemListRptAndObjPg,
_ServiceDocumentTransHistory,
_ServiceDocumentErrorLog,
_SalesOrganization,
_SalesOffice,
_SalesGroup,
_Division,
_DistributionChannel,
_ServiceDocumentNotes,
_PartiesInvolved
}
where
ServiceObjectType = 'BUS2000116'
and ServiceDocumentIsQuotation != 'X'
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA