I_ServiceMarginCube

DDL: I_SERVICEMARGINCUBE Type: view_entity COMPOSITE

Service Margin - Cube

I_ServiceMarginCube is a Composite CDS View (Cube) that provides data about "Service Margin - Cube" in SAP S/4HANA. It reads from 1 data source (I_GLAcctLineItemSemTagGLAcct) and exposes 105 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. It has 9 associations to related views.

SAP Help Documentation

CategoryCDS Views for Sales Accounting
StatusReleased
Purpose
This CDS view provides a comprehensive analytical cube for evaluating service margins. It integrates various financial and service-related data to enable detailed analysis of service profitability across different dimensions such as company codes, fiscal years, service documents, and customer information. This CDS view provides the data to answer the following business questions: What is the service margin for different service contracts and documents? How do service margins vary across different fiscal periods and years? What are the service margins by customer, customer group, or industry? How do service margins differ by sales organization, distribution channel, or sales district? What is the impact of different account assignment types on service margins? How do service margins correlate with specific products or sold product groups? What are the service margins by profit centre or cost centre? How do service margins vary by geographical regions, such as customer supplier country? What are the service margins associated with specific projects or orders? How do service margins relate to specific accounting documents or ledger entries? To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .

Structure
Measures and Attributes Some important measures and attributes are: Recognized Margin Recognized Revenue Billed Revenue Revenue Adjustment Recognized Cost Actual Cost COS Adjustment Deferred COS Deferred Revenue Accrued Revenue Accrued COS Reserves Fields Used for Filtering The main filters are as follows: <Field> : This field is used to ... Important Fields Important fields in this view include the following: Field Name Description Measure or Attribute Comment

Data Extraction
Data Extraction Type

View on SAP Help Portal →

Data Sources (1)

SourceAliasJoin Type
I_GLAcctLineItemSemTagGLAcct I_GLAcctLineItemSemTagGLAcct from

Associations (9)

CardinalityTargetAliasCondition
[0..1] I_MargAnlysProdAndSrvcObjType _ObjectType $projection.AccountAssignmentType = _ObjectType.MarginAnalysisObjectType
[0..1] I_ServiceDocument _SolutionOrder $projection.BusinessSolutionOrder = _SolutionOrder.ServiceDocument and _SolutionOrder.ServiceObjectType = 'BUS2000172'
[0..1] I_AcctgServiceDocumentType _ServiceDocumentTypeNew $projection.ServiceDocumentType = _ServiceDocumentTypeNew.ServiceDocumentType
[0..1] I_AccountingServiceDocument _ServiceDocumentNew $projection.ServiceDocumentType = _ServiceDocumentNew.ServiceDocumentType and $projection.ServiceDocument = _ServiceDocumentNew.ServiceDocument
[0..1] I_AcctgSrvcDocumentItemBasic _ServiceDocumentItemNew $projection.ServiceDocumentType = _ServiceDocumentItemNew.ServiceDocumentType and $projection.ServiceDocument = _ServiceDocumentItemNew.ServiceDocument and $projection.ServiceDocumentItem = _ServiceDocumentItemNew.ServiceDocumentItem
[0..1] I_AcctgServiceDocumentType _ServiceContractTypeNew $projection.ServiceContractType = _ServiceContractTypeNew.ServiceDocumentType
[0..1] I_AccountingServiceDocument _ServiceContractNew $projection.ServiceContractType = _ServiceContractNew.ServiceDocumentType and $projection.ServiceContract = _ServiceContractNew.ServiceDocument
[0..1] I_AcctgSrvcDocumentItemBasic _ServiceContractItemNew $projection.ServiceContractType = _ServiceContractItemNew.ServiceDocumentType and $projection.ServiceContract = _ServiceContractItemNew.ServiceDocument and $projection.ServiceContractItem = _ServiceContractItemNew.ServiceDocumentItem
[1..1] E_JournalEntryItem _Extension_acdoca $projection.SourceLedger = _Extension_acdoca.SourceLedger and $projection.CompanyCode = _Extension_acdoca.CompanyCode and $projection.FiscalYear = _Extension_acdoca.FiscalYear and $projection.AccountingDocument = _Extension_acdoca.AccountingDocument and $projection.LedgerGLLineItem = _Extension_acdoca.LedgerGLLineItem

Annotations (12)

NameValueLevelField
Analytics.internalName #LOCAL view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #MANDATORY view
Analytics.dataCategory #CUBE view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.modelingPattern #ANALYTICAL_CUBE view
AccessControl.personalData.blocking #REQUIRED view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label Service Margin - Cube view

Fields (105)

KeyFieldSource TableSource FieldDescription
KEY Ledger Ledger Ledger
KEY SourceLedger SourceLedger Source Ledger
KEY CompanyCode CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocument AccountingDocument Journal Entry
KEY LedgerGLLineItem LedgerGLLineItem Journal Entry Item
KEY GLAccountHierarchy GLAccountHierarchy
KEY SemanticTag SemanticTag Semantic Tag
KEY ValidityStartDate ValidityStartDate Validity Start Date
KEY ValidityEndDate ValidityEndDate ValidTo
FiscalYearVariant FiscalYearVariant FY Variant
FiscalPeriod FiscalPeriod Tax period
FiscalYearPeriod FiscalYearPeriod Period/Year
ServiceContract ServiceContract Transaction ID
ServiceContractItem ServiceContractItem Item Number in Doc.
BusinessSolutionOrder BusinessSolutionOrder Solution Order
BusinessSolutionOrderItem BusinessSolutionOrderItem Solution Order Item
ProviderContract ProviderContract Contract
ProviderContractItem ProviderContractItem Contract Item
SoldProduct SoldProduct Product Sold
ServiceContractType ServiceContractType
AccountAssignmentType AccountAssignmentType Sndr AcctAssgmt Type
ProjectExternalID ProjectExternalID Project def.
ProfitCenter ProfitCenter Profit Center
ServiceDocumentType ServiceDocumentType Transaction Type
ServiceDocument ServiceDocument Transaction ID
ServiceDocumentItem ServiceDocumentItem Service Document
BillToParty BillToParty Inv. Recipient
BusinessTransactionType BusinessTransactionType Bus.transaction
Customer Customer Sold-to Party
CustomerGroup CustomerGroup Customer Group
GLAccount GLAccount General Ledger
CustomerSupplierIndustry CustomerSupplierIndustry Industry
SoldProductGroup SoldProductGroup Product Sold Group
SalesOrder SalesOrder SD Document
SalesOrderItem SalesOrderItem Sales Order Item
SalesDocument SalesDocument SD Document
SalesOrganization SalesOrganization Sales Organization
ShipToParty ShipToParty Ship-To Party (obsolete)
ChartOfAccounts ChartOfAccounts Node Class
ControllingArea ControllingArea Controlling Area
BaseUnit BaseUnit Unit of Measure
Quantity Quantity Value
BillableControl BillableControl Billable Control
DistributionChannel DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision OrganizationDivision Org. Division
Equipment Equipment Equipment check
FunctionalArea FunctionalArea Sendr Fctl Area
PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
PersonnelNumber PersonnelNumber Personnel No.
Plant Plant Valuation Area
CustomerSupplierCountry CustomerSupplierCountry Customer or Supplier Country/Region
WBSElement WBS Internal ID
SalesDistrict SalesDistrict Sales District
Segment Segment Segment number
GlobalCurrency GlobalCurrency GM Billing Element: Global Currency
AmountInGlobalCurrency AmountInGlobalCurrency Amount in Global Currency
CompanyCodeCurrency CompanyCodeCurrency Local Currency
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency Local Crcy Amt
InvertedAmtInCoCodeCurrency
LedgerFiscalYear LedgerFiscalYear
_ProjectExternalID _ProjectExternalID
_SourceLedger _SourceLedger
_JournalEntry _JournalEntry
_CompanyCodeCurrency _CompanyCodeCurrency
_BaseUnit _BaseUnit
_SemanticTag _SemanticTag
_CurrentProfitCenter _CurrentProfitCenter
_CustomerSupplierCountry _CustomerSupplierCountry
_GLAccountInCompanyCode _GLAccountInCompanyCode
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_Ledger _Ledger
_ObjectType _ObjectType
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_SalesDocument _SalesDocument
_ServiceContractNew _ServiceContractNew
_ServiceContractItemNew _ServiceContractItemNew
_ServiceContractTypeNew _ServiceContractTypeNew
_ProviderContract _ProviderContract
_ProviderContractItem _ProviderContractItem
_Customer _Customer
_CustomerGroup _CustomerGroup
_ShipToParty _ShipToParty
_SoldProduct _SoldProduct
_SoldProductGroup _SoldProductGroup
_ProfitCenter _ProfitCenter
_SolutionOrder _SolutionOrder
_ServiceDocumentTypeNew _ServiceDocumentTypeNew
_ServiceDocumentNew _ServiceDocumentNew
_ServiceDocumentItemNew _ServiceDocumentItemNew
_SalesOrganization _SalesOrganization
_BillToParty _BillToParty
_BusinessTransactionType _BusinessTransactionType
_ChartOfAccounts _ChartOfAccounts
_ControllingArea _ControllingArea
_DistributionChannel _DistributionChannel
_Equipment _Equipment
_FunctionalArea _FunctionalArea
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_FiscalYearVariant _FiscalYearVariant
_PartnerCostCtrActivityType _PartnerCostCtrActivityType
_Plant _Plant
_SalesDistrict _SalesDistrict

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 I_ServiceMarginCube.
-- 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.

CREATE VIEW I_ServiceMarginCube AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  FiscalYearVariant,
  FiscalPeriod,
  FiscalYearPeriod,
  ServiceContract,
  ServiceContractItem,
  BusinessSolutionOrder,
  BusinessSolutionOrderItem,
  ProviderContract,
  ProviderContractItem,
  SoldProduct,
  ServiceContractType,
  AccountAssignmentType,
  ProjectExternalID,
  ProfitCenter,
  ServiceDocumentType,
  ServiceDocument,
  ServiceDocumentItem,
  BillToParty,
  BusinessTransactionType,
  Customer,
  CustomerGroup,
  GLAccount,
  CustomerSupplierIndustry,
  SoldProductGroup,
  SalesOrder,
  SalesOrderItem,
  SalesDocument,
  SalesOrganization,
  ShipToParty,
  ChartOfAccounts,
  ControllingArea,
  BaseUnit,
  Quantity,
  BillableControl,
  DistributionChannel,
  OrganizationDivision,
  Equipment,
  FunctionalArea,
  PartnerCostCtrActivityType,
  PersonnelNumber,
  Plant,
  CustomerSupplierCountry,
  cast( WBSElement as fis_wbs_no_conv preserving type ) AS WBSElement,
  SalesDistrict,
  Segment,
  GlobalCurrency,
  AmountInGlobalCurrency,
  CompanyCodeCurrency,
  AmountInCompanyCodeCurrency,
  cast(( AmountInCompanyCodeCurrency * -1 ) as fis_hsl_inverted) AS InvertedAmtInCoCodeCurrency,
  LedgerFiscalYear
FROM I_GLAcctLineItemSemTagGLAcct
LEFT OUTER JOIN I_MargAnlysProdAndSrvcObjType AS _ObjectType ON AccountAssignmentType = _ObjectType.MarginAnalysisObjectType  -- association [0..1]
LEFT OUTER JOIN I_ServiceDocument AS _SolutionOrder ON BusinessSolutionOrder = _SolutionOrder.ServiceDocument AND _SolutionOrder.ServiceObjectType = 'BUS2000172'  -- association [0..1]
LEFT OUTER JOIN I_AcctgServiceDocumentType AS _ServiceDocumentTypeNew ON ServiceDocumentType = _ServiceDocumentTypeNew.ServiceDocumentType  -- association [0..1]
LEFT OUTER JOIN I_AccountingServiceDocument AS _ServiceDocumentNew ON ServiceDocumentType = _ServiceDocumentNew.ServiceDocumentType AND ServiceDocument = _ServiceDocumentNew.ServiceDocument  -- association [0..1]
LEFT OUTER JOIN I_AcctgSrvcDocumentItemBasic AS _ServiceDocumentItemNew ON ServiceDocumentType = _ServiceDocumentItemNew.ServiceDocumentType AND ServiceDocument = _ServiceDocumentItemNew.ServiceDocument AND ServiceDocumentItem = _ServiceDocumentItemNew.ServiceDocumentItem  -- association [0..1]
LEFT OUTER JOIN I_AcctgServiceDocumentType AS _ServiceContractTypeNew ON ServiceContractType = _ServiceContractTypeNew.ServiceDocumentType  -- association [0..1]
LEFT OUTER JOIN I_AccountingServiceDocument AS _ServiceContractNew ON ServiceContractType = _ServiceContractNew.ServiceDocumentType AND ServiceContract = _ServiceContractNew.ServiceDocument  -- association [0..1]
LEFT OUTER JOIN I_AcctgSrvcDocumentItemBasic AS _ServiceContractItemNew ON ServiceContractType = _ServiceContractItemNew.ServiceDocumentType AND ServiceContract = _ServiceContractItemNew.ServiceDocument AND ServiceContractItem = _ServiceContractItemNew.ServiceDocumentItem  -- association [0..1]
LEFT OUTER JOIN E_JournalEntryItem AS _Extension_acdoca ON SourceLedger = _Extension_acdoca.SourceLedger AND CompanyCode = _Extension_acdoca.CompanyCode AND FiscalYear = _Extension_acdoca.FiscalYear AND AccountingDocument = _Extension_acdoca.AccountingDocument AND LedgerGLLineItem = _Extension_acdoca.LedgerGLLineItem  -- association [1..1]
;