I_MargAnlysProdAndSrvcCube

DDL: I_MARGANLYSPRODANDSRVCCUBE SQL: IPROSRVMARGIN Type: view COMPOSITE

Product and Service Margins - Cube

I_MargAnlysProdAndSrvcCube (Composite)

Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.

Accounting and Financial Close

I_MargAnlysProdAndSrvcCube is a Composite CDS View (Cube) that provides data about "Product and Service Margins - Cube" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemSemTag) and exposes 135 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 analysis of product and service margins by aggregating financial and accounting data. It integrates various dimensions such as fiscal year, company code, service documents, and account assignments to offer insights into revenue, costs, and margins associated with products and services. This CDS view provides the data to answer the following business questions: What are the recognized revenues and costs for products and services within a specific fiscal year and company code? How do the margins for different products and services compare across various business solution orders and service contracts? What are the adjustments in revenue and cost of goods sold ( COGS ) for the company code currency? How much revenue and COGS are deferred or accrued, and what is the impact on the financial statements? What are the imminent loss reserves and sales deduction reserves for the company? How do different account assignment types (for examle., project, order, service) contribute to the overall financial performance? What is the impact of down payments and manual contract accruals on the profit and loss items? How do different organizational dimensions such as profit centres, sales organizations, and distribution channels affect the financial outcomes? 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
Main CDS Parameters and Filters The default financial statement version (FSV) is YPS2 . 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

View on SAP Help Portal →

SAP API Hub

StateC1
Line of BusinessAccounting and Financial Close
Application ComponentCO-FIO-PA
CapabilitiesData Provider for Analytical Queries, Data Source in SQL Select, Data Source for Defining CDS Entities
PackageAccounting and Financial Close for SAP S/4HANA Cloud Private Edition

Documentation

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItemSemTag I_GLAccountLineItemSemTag from

Parameters (1)

NameTypeDefault
P_GLAccountHierarchy fins_sem_tag_hryid

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 $projection.SourceLedger = _Extension.SourceLedger and $projection.CompanyCode = _Extension.CompanyCode and $projection.FiscalYear = _Extension.FiscalYear and $projection.AccountingDocument = _Extension.AccountingDocument and $projection.LedgerGLLineItem = _Extension.LedgerGLLineItem

Annotations (18)

NameValueLevelField
AbapCatalog.sqlViewName IPROSRVMARGIN view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
Metadata.allowExtensions true view
EndUserText.label Product and Service Margins - Cube view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #REQUIRED view
VDM.viewType #COMPOSITE view
Analytics.dataCategory #CUBE view
ObjectModel.representativeKey LedgerGLLineItem view
Analytics.internalName #LOCAL view
Search.searchable false view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.modelingPattern #ANALYTICAL_CUBE view

Fields (135)

KeyFieldSource TableSource FieldDescription
KEY Ledger Ledger Ledger in General Ledger Accounting
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 General Ledger Journal Entry Line Item
KEY GLAccountHierarchy GLAccountHierarchy Financial Statement Version
KEY SemanticTag SemanticTag Semantic Tag of a Hierarchy Node
KEY ValidityStartDate ValidityStartDate Validity Start Date
KEY ValidityEndDate ValidityEndDate Valid To Date
FiscalPeriod FiscalPeriod Fiscal Period
FiscalYearPeriod FiscalYearPeriod Fiscal Year Period
ServiceContract ServiceContract Service Contract ID
ServiceContractItem ServiceContractItem Service Contract Item ID
BusinessSolutionOrder BusinessSolutionOrder Solution Order
BusinessSolutionOrderItem BusinessSolutionOrderItem Solution Order Item
ProviderContract ProviderContract Provider Contract
ProviderContractItem ProviderContractItem Provider Contract Item
ServiceContractType ServiceContractType Service Contract Type
AccountAssignmentType AccountAssignmentType Account Assignment Type
ProjectExternalID ProjectExternalID Project Number (External) Edited
ProfitCenter ProfitCenter Profit Center
ServiceDocumentType ServiceDocumentType Service Document Type
ServiceDocument ServiceDocument Service Document ID
ServiceDocumentItem ServiceDocumentItem Service Document Item ID
BillToParty BillToParty Inv. Recipient
BusinessTransactionType BusinessTransactionType Business Transaction Type
Customer Customer Customer Number
CustomerGroup CustomerGroup Customer Group
GLAccount GLAccount General Ledger
CustomerSupplierIndustry CustomerSupplierIndustry Customer Supplier Industry
SoldProduct SoldProduct Product Sold
SoldProductGroup SoldProductGroup Product Sold Group
SalesOrder SalesOrder SD Document
SalesOrderItem SalesOrderItem Sales Order Item
SalesDocument SalesDocument Sales Document
SalesDocumentItem SalesDocumentItem Sales Document Item
SalesOrganization SalesOrganization Sales Organization
ShipToParty ShipToParty Ship-To Party (obsolete)
ChartOfAccounts ChartOfAccounts Chart of Accounts
ControllingArea ControllingArea Controlling Area
BaseUnit BaseUnit Base Unit of Measure
Quantity Quantity Quantity
BillableControl BillableControl Billable Control
DistributionChannel DistributionChannel Distribution Channel
OrganizationDivision OrganizationDivision Org. Division
Equipment Equipment Equipment Number
FunctionalArea FunctionalArea Sendr Fctl Area
Material Material Material Number
Product Product Product Number
PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
PersonnelNumber PersonnelNumber Personnel Number
Plant Plant Valuation Area
CustomerSupplierCountry CustomerSupplierCountry Customer or Supplier Country/Region
WBSElement WBS Internal ID
WBSElementExternalID WBSElementExternalID Work Breakdown Structure Element (WBS Element) Edited
SalesDistrict SalesDistrict Sales District
ServicesRenderedDate ServicesRenderedDate Date on which services are rendered
OrderID OrderID Order ID
CompanyCodeCurrency CompanyCodeCurrency Company Code Currency
BilledRevenueAmtInCoCodeCrcy BilledRevenueAmtInCoCodeCrcy Actual Revenue
RecognizableCostAmtInCCCrcy RecognizableCostAmtInCCCrcy Actual Cost
RecognizedRevnAmtInCCCrcy RecognizedRevnAmtInCCCrcy Recognized Revenue
RecognizedCOGSAmtInCCCrcy RecognizedCOGSAmtInCCCrcy Recognized COS
RecognizedMarginAmtInCCCrcy RecognizedMarginAmtInCCCrcy Recognized Margin
RevenueAdjustmentAmtInCCCrcy RevenueAdjustmentAmtInCCCrcy Revenue Adjustment
COGSAdjustmentAmtInCCCrcy COGSAdjustmentAmtInCCCrcy COS Adjustment
DeferredCOGSAmtInCCCrcy DeferredCOGSAmtInCCCrcy Deferred COS
DeferredRevenueAmtInCCCrcy DeferredRevenueAmtInCCCrcy Deferred Revenue
AccruedRevenueAmtInCCCrcy AccruedRevenueAmtInCCCrcy Accrued Revenue
AccruedCOGSAmtInCCCrcy AccruedCOGSAmtInCCCrcy Accrued COS
ImminentLossRsrvAmtInCCCrcy ImminentLossRsrvAmtInCCCrcy Reserves for Imminent Loss
SalesDeductReserveAmtInCCCrcy SalesDeductReserveAmtInCCCrcy Reserves for Anticipated Sales Deductions
UnrlzdCostsReserveAmtInCCCrcy UnrlzdCostsReserveAmtInCCCrcy Reserves for Unrealized Costs
ProjAndSlsOrdStkAmtInCCCrcy ProjAndSlsOrdStkAmtInCCCrcy Project/Sales Order Stock
MnlContrAccrPnLItmAmtInCCCrcy Manual Contract Accruals for Profit/Loss
DownPaymentAmtInCCCrcy DownPaymentAmtInCCCrcy Customer Down Payment
_Division _Division
_CustomerSupplierIndustry _CustomerSupplierIndustry
_ProjectExternalID _ProjectExternalID
_WBSElementExternalID _WBSElementExternalID
_SourceLedger _SourceLedger
_JournalEntry _JournalEntry
_CompanyCodeCurrency _CompanyCodeCurrency
_BaseUnit _BaseUnit
_Hierarchy _Hierarchy
_GLAccountHierarchy _GLAccountHierarchy
_SemanticTag _SemanticTag
_CurrentProfitCenter _CurrentProfitCenter
_CustomerSupplierCountry _CustomerSupplierCountry
_GLAccountInCompanyCode _GLAccountInCompanyCode
_ObjectType _ObjectType
_SolutionOrder _SolutionOrder
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_FiscalYearPeriod _FiscalYearPeriod
_Ledger _Ledger
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_SalesDocument _SalesDocument
_SalesDocumentItem _SalesDocumentItem
_ServiceContract _ServiceContract
_ServiceContractItem _ServiceContractItem
_ServiceContractNew _ServiceContractNew
_ServiceContractItemNew _ServiceContractItemNew
_Customer _Customer
_CustomerGroup _CustomerGroup
_ShipToParty _ShipToParty
_Product _Product
_SoldProduct _SoldProduct
_SoldProductGroup _SoldProductGroup
_ProfitCenter _ProfitCenter
_ServiceDocumentType _ServiceDocumentType
_ServiceDocument _ServiceDocument
_ServiceDocumentItem _ServiceDocumentItem
_ServiceDocumentTypeNew _ServiceDocumentTypeNew
_ServiceDocumentNew _ServiceDocumentNew
_ServiceDocumentItemNew _ServiceDocumentItemNew
_SalesOrganization _SalesOrganization
_BillToParty _BillToParty
_BusinessTransactionType _BusinessTransactionType
_ChartOfAccounts _ChartOfAccounts
_ControllingArea _ControllingArea
_DistributionChannel _DistributionChannel
_Equipment _Equipment
_FunctionalArea _FunctionalArea
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_PartnerCostCtrActivityType _PartnerCostCtrActivityType
_Plant _Plant
_ServiceContractType _ServiceContractType
_ServiceContractTypeNew _ServiceContractTypeNew
_Order _Order
_SalesDistrict _SalesDistrict
_ProviderContract _ProviderContract
_ProviderContractItem _ProviderContractItem

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_MargAnlysProdAndSrvcCube.
-- 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: IPROSRVMARGIN
-- Parameters: P_GLAccountHierarchy : fins_sem_tag_hryid

CREATE VIEW I_MargAnlysProdAndSrvcCube AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  FiscalPeriod,
  FiscalYearPeriod,
  ServiceContract,
  ServiceContractItem,
  BusinessSolutionOrder,
  BusinessSolutionOrderItem,
  ProviderContract,
  ProviderContractItem,
  ServiceContractType,
  AccountAssignmentType,
  ProjectExternalID,
  ProfitCenter,
  ServiceDocumentType,
  ServiceDocument,
  ServiceDocumentItem,
  BillToParty,
  BusinessTransactionType,
  Customer,
  CustomerGroup,
  GLAccount,
  CustomerSupplierIndustry,
  SoldProduct,
  SoldProductGroup,
  SalesOrder,
  SalesOrderItem,
  SalesDocument,
  SalesDocumentItem,
  SalesOrganization,
  ShipToParty,
  ChartOfAccounts,
  ControllingArea,
  BaseUnit,
  Quantity,
  BillableControl,
  DistributionChannel,
  OrganizationDivision,
  Equipment,
  FunctionalArea,
  Material,
  Product,
  PartnerCostCtrActivityType,
  PersonnelNumber,
  Plant,
  CustomerSupplierCountry,
  cast( WBSElement as fis_wbs_no_conv preserving type ) AS WBSElement,
  WBSElementExternalID,
  SalesDistrict,
  ServicesRenderedDate,
  OrderID,
  CompanyCodeCurrency,
  BilledRevenueAmtInCoCodeCrcy,
  RecognizableCostAmtInCCCrcy,
  RecognizedRevnAmtInCCCrcy,
  RecognizedCOGSAmtInCCCrcy,
  RecognizedMarginAmtInCCCrcy,
  RevenueAdjustmentAmtInCCCrcy,
  COGSAdjustmentAmtInCCCrcy,
  DeferredCOGSAmtInCCCrcy,
  DeferredRevenueAmtInCCCrcy,
  AccruedRevenueAmtInCCCrcy,
  AccruedCOGSAmtInCCCrcy,
  ImminentLossRsrvAmtInCCCrcy,
  SalesDeductReserveAmtInCCCrcy,
  UnrlzdCostsReserveAmtInCCCrcy,
  ProjAndSlsOrdStkAmtInCCCrcy,
  cast ( MnlContrAccrPnLItmAmtInCCCrcy as fins_mnlcontraccr ) AS MnlContrAccrPnLItmAmtInCCCrcy,
  DownPaymentAmtInCCCrcy
FROM I_GLAccountLineItemSemTag
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 ON SourceLedger = _Extension.SourceLedger AND CompanyCode = _Extension.CompanyCode AND FiscalYear = _Extension.FiscalYear AND AccountingDocument = _Extension.AccountingDocument AND LedgerGLLineItem = _Extension.LedgerGLLineItem  -- association [1..1]
;