I_ProdAndSrvcMargAnlysCube

DDL: I_PRODANDSRVCMARGANLYSCUBE Type: view_entity COMPOSITE Package: FINS_COPA_REPORTING

Product and Service Margins - Cube

I_ProdAndSrvcMargAnlysCube (Composite)

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

Accounting and Financial Close

I_ProdAndSrvcMargAnlysCube 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 (P_ProdAndSrvcMargMultiCrcy) and exposes 146 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. It has 3 associations to related views. Part of development package FINS_COPA_REPORTING.

SAP Help Documentation

CategoryCDS Views for Sales Accounting
Data CategoryCube
Purpose
This CDS view is designed to provide a comprehensive analytical cube for analyzing product and service margins. It aggregates financial and operational data related to products and services, allowing for detailed margin analysis across various dimensions such as company code, fiscal year, and GL account hierarchy. This CDS view provides the data to answer the following business questions: What are the recognized and billed revenues for products and services in different currencies? How do sales deductions and revenue adjustments impact overall revenue? What are the recognized and recognizable costs of goods sold (COGS) for products and services? How do COGS adjustments affect the overall cost structure? What is the recognized margin amount in display currency for products and services? How do accrued and deferred revenues and COGS contribute to financial performance? What are the amounts reserved for imminent losses and sales deductions? How do projected and sales order stock amounts influence financial outcomes? What is the impact of manual contract accruals on profit and loss items? How do down payments affect the financial position in display currency? How do various organizational and transactional dimensions, such as profit centers, sales orders, and service contracts, influence product and service margins? 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 .

Prerequisites
Authorizations Users who want to use this CDS view must have a role with the following restriction types set to read access: Restriction Type ID Restriction Type A_B_ANLKL Asset Postings: Company Code/Asset Class BEGRU_BKPF_BEK Authorization Group for Supplier-Related Journal Entries BEGRU_BKPF_BED Authorization Group for Customer Related Journal Entries SEGMENT_GLRRCTY Segment for Segmental Reporting/Record Type BUKRS_GLRLDNR_GLRRCTY_GLRVERS Company Code/Ledger/Record Type/Version BUKRS_PRCTR_KSTAR Company Code/ Profit Center / Cost Element SALES_AREA_OFFICE_GROUP Sales Area / Sales Office / Sales Group BEGRU_BKPF_BLA Authorization Groups for Journal Entry Document Type KOART Account Type COMPANYCODE_HIERARCHY Company Code Hierarchies BWKEY Valuation Area AUART Sales Document Type DATE Due Date for Authority Check KOSTL_KSTAR Cost Center/Cost Element FKBER Functional Area F_BKPF_ORD Order Category / Order Type for Journal Entries BUKRS Company Code SALES_AREA Sales Area You can use the Display Restriction Types app to find out in which business catalogs these restriction types are included.

Structure
Parameters The parameters of the CDS view are as follows: Parameter Name Label P_GLAccountHierarchy FSV Important Fields Important fields in this view include the following: Field Name Label Ledger Ledger SourceLedger Source Ledger CompanyCode Company Code FiscalYear Fiscal Year AccountingDocument Journal Entry LedgerGLLineItem Journal Entry Item GLAccountHierarchy FSV SemanticTag Semantic Tag ValidityStartDate Valid From ValidityEndDate Valid To CurrencyField Currency Role Field FiscalYearVariant Fiscal Year Variant LedgerFiscalYear Fiscal Year of Ledger FiscalPeriod Fiscal Period FiscalYearPeriod Fiscal Year Period ServiceContract Service Contract ServiceContractItem Srv Contract Item BusinessSolutionOrder Solution Order BusinessSolutionOrderItem Solution Order Item ProviderContract Provider Contract ProviderContractItem Provider Contract Item ServiceContractType Serv. Contract Type AccountAssignmentType Account Assignment Type ProjectExternalID Project Definition ProfitCenter Profit Center ServiceDocumentType Service Doc. Type ServiceDocument Service Document

View on SAP Help Portal →

SAP API Hub

CategoryComposite
StateC1
Line of BusinessAccounting and Financial Close
Application ComponentCO-FIO-PA-2CL
CapabilitiesData Provider for Analytical Queries,Data Source in SQL Select,Data Source for Defining CDS Entities
Extensible (Key User)Yes
Extensible (Developer)No
Release State (Key User)Released
Release State (Developer)Not Released
PackageAccounting and Financial Close for SAP S/4HANA Cloud Public Edition
Description <p>This CDS view is designed to provide a comprehensive analytical cube for analyzing product and service margins. It aggregates financial and operational data related to products and services, allowing for detailed margin analysis across various dimensions such as company code, fiscal year, and GL account hierarchy. </p> <p>This CDS view provides the data to answer the following business questions:</p> <ul> <li><p>What are the recognized and billed revenues for products and services in different currencies?</p></li> <li><p>How do sales deductions and revenue adjustments impact overall revenue?</p></li> <li><p>What are the recognized and recognizable costs of goods sold (COGS) for products and services?</p></li> <li><p>How do COGS adjustments affect the overall cost structure?</p></li> <li><p>What is the recognized margin amount in display currency for products and services?</p></li> <li><p>How do accrued and deferred revenues and COGS contribute to financial performance?</p></li> <li><p>What are the amounts reserved for imminent losses and sales deductions?</p></li> <li><p>How do projected and sales order stock amounts influence financial outcomes?</p></li> <li><p>What is the impact of manual contract accruals on profit and loss items?</p></li> <li><p>How do down payments affect the financial position in display currency?</p></li> <li><p>How do various organizational and transactional dimensions, such as profit centers, sales orders, and service contracts, influence product and service margins?</p></li> </ul> <p>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.</p>

Documentation

Data Sources (1)

SourceAliasJoin Type
P_ProdAndSrvcMargMultiCrcy ProdAndSrvcMargMultiCrcy from

Parameters (1)

NameTypeDefault
P_GLAccountHierarchy fins_sem_tag_hryid

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_PrjMargAnlysRptCrcyFld _CurrencyField $projection.CurrencyField = _CurrencyField.CurrencyField
[0..1] I_ProdSrvcMargRepCrcyFld _CurrencyField1 $projection.CurrencyField = _CurrencyField1.CurrencyField
[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 (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 Product and Service Margins - Cube view

Fields (146)

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
KEY CurrencyField CurrencyField Currency Role Field
FiscalYearVariant FiscalYearVariant Fiscal Year Variant
LedgerFiscalYear LedgerFiscalYear Fiscal Year of Ledger
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
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 Sold
PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
PersonnelNumber PersonnelNumber Personnel Number
Plant Plant Valuation Area
CustomerSupplierCountry CustomerSupplierCountry Customer or Supplier Country/Region
WBSElement 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
Supplier Supplier Supplier
AccountingDocumentType AccountingDocumentType Journal Entry Type
CostCenter CostCenter Cost Center
FinancialAccountType FinancialAccountType Fin. Account Type
Segment Segment Segment for Segmental Reporting
ValuationArea ValuationArea Valuation Area
AssetClass AssetClass Asset Class
PostingDate PostingDate Posting Date for GR
Currency Currency Valuation Crcy
Quantity Quantity Quantity
RecognizedRevnAmtInDspCrcy RecognizedRevnAmtInDspCrcy Recognized Revenue
BilledRevenueAmtInDspCrcy BilledRevenueAmtInDspCrcy Actual Revenue
SalesDeductionAmountInDspCrcy SalesDeductionAmountInDspCrcy Sales Deduction
RevenueAdjustmentAmtInDspCrcy RevenueAdjustmentAmtInDspCrcy Revenue Adjustment
RecognizedCOGSAmtInDspCrcy RecognizedCOGSAmtInDspCrcy Recognized COS
RecognizableCostAmtInDspCrcy RecognizableCostAmtInDspCrcy Actual Cost
COGSAdjustmentAmtInDspCrcy COGSAdjustmentAmtInDspCrcy COS Adjustment
RecognizedMargAmtInDisplayCrcy RecognizedMargAmtInDisplayCrcy Recognized Margin
AccruedRevenueAmtInDspCrcy AccruedRevenueAmtInDspCrcy Accrued Revenue
DeferredRevenueAmtInDspCrcy DeferredRevenueAmtInDspCrcy Deferred Revenue
AccruedCOGSAmtInDspCrcy AccruedCOGSAmtInDspCrcy Accrued COS
DeferredCOGSAmtInDspCrcy DeferredCOGSAmtInDspCrcy Deferred COS
ImminentLossRsrvAmtInDspCrcy ImminentLossRsrvAmtInDspCrcy Imminent Loss Reserve
SalesDeductReserveAmtInDspCrcy SalesDeductReserveAmtInDspCrcy Reserves for Anticipated Sales Deductions
UnrlzdCostsReserveAmtInDspCrcy UnrlzdCostsReserveAmtInDspCrcy Reserves for Unrealized Costs
ProjAndSlsOrdStkAmtInDspCrcy ProjAndSlsOrdStkAmtInDspCrcy Project/Sales Order Stock
MnlContrAccrPnLItmAmtInDspCrcy MnlContrAccrPnLItmAmtInDspCrcy Manual Contract Accruals Income Statement in Display Crcy
DownPaymentAmountInDspCrcy DownPaymentAmountInDspCrcy Open Down Payment Amount in Display Currency
_Ledger _Ledger
_SourceLedger _SourceLedger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_JournalEntry _JournalEntry
_GLAccountHierarchy _GLAccountHierarchy
_SemanticTag _SemanticTag
_ServiceContractNew _ServiceContractNew
_ServiceContractItemNew _ServiceContractItemNew
_SolutionOrder _SolutionOrder
_ProviderContract _ProviderContract
_ProviderContractItem _ProviderContractItem
_ServiceContractTypeNew _ServiceContractTypeNew
_ObjectType _ObjectType
_ProjectExternalID _ProjectExternalID
_ProfitCenter _ProfitCenter
_ServiceDocumentTypeNew _ServiceDocumentTypeNew
_ServiceDocumentNew _ServiceDocumentNew
_ServiceDocumentItemNew _ServiceDocumentItemNew
_BillToParty _BillToParty
_BusinessTransactionType _BusinessTransactionType
_Customer _Customer
_CustomerGroup _CustomerGroup
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_CustomerSupplierIndustry _CustomerSupplierIndustry
_SoldProduct _SoldProduct
_SoldProductGroup _SoldProductGroup
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_SalesDocument _SalesDocument
_SalesDocumentItem _SalesDocumentItem
_SalesOrganization _SalesOrganization
_ShipToParty _ShipToParty
_ChartOfAccounts _ChartOfAccounts
_ControllingArea _ControllingArea
_BaseUnit _BaseUnit
_DistributionChannel _DistributionChannel
_Division _Division
_Equipment _Equipment
_FunctionalArea _FunctionalArea
_Product _Product
_PartnerCostCtrActivityType _PartnerCostCtrActivityType
_Plant _Plant
_CustomerSupplierCountry _CustomerSupplierCountry
_WBSElementExternalID _WBSElementExternalID
_SalesDistrict _SalesDistrict
_Order _Order
_Supplier _Supplier
_AccountingDocumentType _AccountingDocumentType
_CostCenter _CostCenter
_FinancialAccountType _FinancialAccountType
_Segment _Segment
_CurrentProfitCenter _CurrentProfitCenter
_CurrentCostCenter _CurrentCostCenter
_ServiceDocument _ServiceDocument
_CurrencyField _CurrencyField
_CurrencyField1 _CurrencyField1

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

CREATE VIEW I_ProdAndSrvcMargAnlysCube AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  CurrencyField,
  FiscalYearVariant,
  LedgerFiscalYear,
  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,
  BillableControl,
  DistributionChannel,
  OrganizationDivision,
  Equipment,
  FunctionalArea,
  Material,
  Product,
  PartnerCostCtrActivityType,
  PersonnelNumber,
  Plant,
  CustomerSupplierCountry,
  WBSElement,
  WBSElementExternalID,
  SalesDistrict,
  ServicesRenderedDate,
  OrderID,
  Supplier,
  AccountingDocumentType,
  CostCenter,
  FinancialAccountType,
  Segment,
  ValuationArea,
  AssetClass,
  PostingDate,
  Currency,
  Quantity,
  RecognizedRevnAmtInDspCrcy,
  BilledRevenueAmtInDspCrcy,
  SalesDeductionAmountInDspCrcy,
  RevenueAdjustmentAmtInDspCrcy,
  RecognizedCOGSAmtInDspCrcy,
  RecognizableCostAmtInDspCrcy,
  COGSAdjustmentAmtInDspCrcy,
  RecognizedMargAmtInDisplayCrcy,
  AccruedRevenueAmtInDspCrcy,
  DeferredRevenueAmtInDspCrcy,
  AccruedCOGSAmtInDspCrcy,
  DeferredCOGSAmtInDspCrcy,
  ImminentLossRsrvAmtInDspCrcy,
  SalesDeductReserveAmtInDspCrcy,
  UnrlzdCostsReserveAmtInDspCrcy,
  ProjAndSlsOrdStkAmtInDspCrcy,
  MnlContrAccrPnLItmAmtInDspCrcy,
  DownPaymentAmountInDspCrcy
FROM P_ProdAndSrvcMargMultiCrcy AS ProdAndSrvcMargMultiCrcy
LEFT OUTER JOIN I_PrjMargAnlysRptCrcyFld AS _CurrencyField ON CurrencyField = _CurrencyField.CurrencyField  -- association [0..1]
LEFT OUTER JOIN I_ProdSrvcMargRepCrcyFld AS _CurrencyField1 ON CurrencyField = _CurrencyField1.CurrencyField  -- 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]
;