I_CompanyMarginCube

DDL: I_COMPANYMARGINCUBE Type: view_entity COMPOSITE Package: FCOPA_REP_COMPANY_MARGIN

Company Margin - Cube

I_CompanyMarginCube (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_CompanyMarginCube is a Composite CDS View (Cube) that provides data about "Company Margin - Cube" in SAP S/4HANA. It reads from 1 data source (I_GLAcctLineItemSemTagGLAcct) and exposes 131 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. It has 6 associations to related views. Part of development package FCOPA_REP_COMPANY_MARGIN.

SAP Help Documentation

CategoryCDS Views for Sales Accounting
Data CategoryCube
Purpose
This CDS view is designed to provide a comprehensive analytical cube for evaluating company margins. It aggregates financial data from general ledger account line items and associates it with various business dimensions such as currency fields, product and service object types, solution orders, customer industries, and organizational divisions. The view is structured to support complex analytical queries and facilitate decision-making processes related to financial performance and margin analysis. This CDS view provides the data to answer the following business questions: What is the company's margin across different fiscal years and periods? How do margins vary by business solution orders and their items? What is the impact of different account assignment types on company margins? How do margins differ across various customer industries and divisions? What are the financial results associated with specific semantic tags like revenue, cost of goods sold, and overhead costs? How do margins correlate with sales orders, contracts, and service documents? What is the distribution of margins across different profit centers and organizational units? How do currency fluctuations affect the company's financial performance? What are the key drivers of variable and fixed amounts in company code currency? 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 the following authorization objects assigned: 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

Structure
Fields Used for Filtering The main filters are as follows: Field Name Label CurrencyField Currency Role Field The main filters are as follows: 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 FiscalYearVariant Fiscal Year Variant FiscalPeriod Fiscal Period FiscalYearPeriod Fiscal Year Period FiscalQuarter Fiscal Quarter FiscalYearQuarter Fiscal Year Quarter BusinessSolutionOrder Solution Order BusinessSolutionOrderItem Solution Order Item ProviderContract Provider Contract ProviderContractItem Provider Contract Item SoldProduct Product Sold Product Product AccountAssignmentType Account Assignment Type ProjectExternalID Project Definition ProfitCenter Profit Center ServiceDocumentType Service Doc. Type ServiceDocument Service Document ServiceDocumentItem Service Doc. Item BillToParty Bill-to Party BusinessTransactionType Business Transaction Type Customer Customer CustomerGroup Customer Group GLAccount G/L Account CustomerSuppl

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 evaluating company margins. It aggregates financial data from general ledger account line items and associates it with various business dimensions such as currency fields, product and service object types, solution orders, customer industries, and organizational divisions. The view is structured to support complex analytical queries and facilitate decision-making processes related to financial performance and margin analysis.</p> <p>This CDS view provides the data to answer the following business questions:</p> <ul> <li><p>What is the company's margin across different fiscal years and periods?</p></li> <li><p>How do margins vary by business solution orders and their items?</p></li> <li><p>What is the impact of different account assignment types on company margins?</p></li> <li><p>How do margins differ across various customer industries and divisions?</p></li> <li><p>What are the financial results associated with specific semantic tags like revenue, cost of goods sold, and overhead costs?</p></li> <li><p>How do margins correlate with sales orders, contracts, and service documents?</p></li> <li><p>What is the distribution of margins across different profit centers and organizational units?</p></li> <li><p>How do currency fluctuations affect the company's financial performance?</p></li> <li><p>What are the key drivers of variable and fixed amounts in company code currency?</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
I_GLAcctLineItemSemTagGLAcct I_GLAcctLineItemSemTagGLAcct from

Associations (6)

CardinalityTargetAliasCondition
[0..1] I_CompanyMarginCurrencyField _CurrencyField $projection.CurrencyField = _CurrencyField.CurrencyField
[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_CustomerSupplierIndustry _CustomerSupplierIndustry $projection.CustomerSupplierIndustry = _CustomerSupplierIndustry.Industry
[0..1] I_Division _Division $projection.OrganizationDivision = _Division.Division
[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 (15)

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
Consumption.cacheSettings.usage #MANDATORY view
Consumption.cacheSettings.useNonTransactional true view
EndUserText.label Company Margin - Cube view
Analytics.intentBasedNavigation.filterMapper CL_FCO_COMP_RB_CUBE_EXIT view

Fields (131)

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
FiscalYearVariant FiscalYearVariant Fiscal Year Variant
FiscalPeriod FiscalPeriod Fiscal Period
FiscalYearPeriod FiscalYearPeriod Fiscal Year Period
FiscalQuarter FiscalQuarter Fiscal Quarter
FiscalYearQuarter FiscalYearQuarter Fiscal Year + Fiscal Quarter
BusinessSolutionOrder BusinessSolutionOrder Solution Order
BusinessSolutionOrderItem BusinessSolutionOrderItem Solution Order Item
ProviderContract ProviderContract Provider Contract
ProviderContractItem ProviderContractItem Provider Contract Item
SoldProduct SoldProduct Product Sold
Product Product Product Sold
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
SoldProductGroup SoldProductGroup Product Sold Group
SalesOrder SalesOrder SD Document
SalesOrderItem SalesOrderItem Sales Order Item
SalesDocument SalesDocument Sales Document
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
PartnerCostCtrActivityType PartnerCostCtrActivityType Partner Cost Center Activity Type
PartnerCompany PartnerCompany Company ID of Trading Partner
PartnerCompanyCode PartnerCompanyCode Partner Company Code
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
ServicesRenderedDate ServicesRenderedDate Date on which services are rendered
TimeSheetOvertimeCategory TimeSheetOvertimeCategory Overtime Category
SalesDistrict SalesDistrict Sales District
Segment Segment Segment for Segmental Reporting
LedgerFiscalYear LedgerFiscalYear Fiscal Year of Ledger
FinancialAccountType FinancialAccountType Fin. Account Type
CostCenter CostCenter Cost Center
OrderID OrderID Order ID
AccountingDocumentType AccountingDocumentType Journal Entry Type
Supplier Supplier Supplier
PostingDate PostingDate Posting Date for GR
ValuationArea ValuationArea Valuation Area
AssetClass AssetClass Asset Class
AccountingDocCreatedByUser AccountingDocCreatedByUser User which created overhead document
SubLedgerAcctLineItemType SubLedgerAcctLineItemType Subledger-Specific Line Item Type
CurrencyField _CurrencyField CurrencyField Currency Role Field
CompanyCodeCurrency CompanyCodeCurrency Company Code Currency
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency Amount in Company Code Currency
VariableAmountInCoCodeCrcy Inverted Amount in Company Code Currency
InvertedAmtInCoCodeCurrency Inverted Amount in Company Code Currency
InvertedFixedAmtInCoCodeCrcy Fixed Amount in Company Currency
InvertedVarblAmtInCoCodeCrcy Inverted Amount in Company Code Currency
_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
_ProviderContract _ProviderContract
_ProviderContractItem _ProviderContractItem
_Customer _Customer
_CustomerGroup _CustomerGroup
_CustomerSupplierIndustry _CustomerSupplierIndustry
_ShipToParty _ShipToParty
_SoldProduct _SoldProduct
_SoldProductGroup _SoldProductGroup
_ProfitCenter _ProfitCenter
_SolutionOrder _SolutionOrder
_SalesOrganization _SalesOrganization
_BillToParty _BillToParty
_BusinessTransactionType _BusinessTransactionType
_ChartOfAccounts _ChartOfAccounts
_ControllingArea _ControllingArea
_DistributionChannel _DistributionChannel
_Division _Division
_Equipment _Equipment
_FunctionalArea _FunctionalArea
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_FiscalYearVariant _FiscalYearVariant
_PartnerCostCtrActivityType _PartnerCostCtrActivityType
_Plant _Plant
_SalesDistrict _SalesDistrict
_TimeSheetOvertimeCat _TimeSheetOvertimeCat
_Product _Product
_WBSElementExternalID _WBSElementExternalID
_CostCenter _CostCenter
_FinancialAccountType _FinancialAccountType
_ServiceDocument _ServiceDocument
_ServiceDocumentType _ServiceDocumentType
_ServiceDocumentItem _ServiceDocumentItem
_Order _Order
_CurrentCostCenter _CurrentCostCenter
_AccountingDocumentType _AccountingDocumentType
_Supplier _Supplier
_CurrencyField _CurrencyField

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_CompanyMarginCube.
-- 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_CompanyMarginCube AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  FiscalYearVariant,
  FiscalPeriod,
  FiscalYearPeriod,
  FiscalQuarter,
  FiscalYearQuarter,
  BusinessSolutionOrder,
  BusinessSolutionOrderItem,
  ProviderContract,
  ProviderContractItem,
  SoldProduct,
  Product,
  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,
  PartnerCompany,
  PartnerCompanyCode,
  PersonnelNumber,
  Plant,
  CustomerSupplierCountry,
  cast( WBSElement as fis_wbs_no_conv preserving type ) AS WBSElement,
  WBSElementExternalID,
  ServicesRenderedDate,
  TimeSheetOvertimeCategory,
  SalesDistrict,
  Segment,
  LedgerFiscalYear,
  FinancialAccountType,
  CostCenter,
  OrderID,
  AccountingDocumentType,
  Supplier,
  PostingDate,
  ValuationArea,
  AssetClass,
  AccountingDocCreatedByUser,
  SubLedgerAcctLineItemType,
  _CurrencyField.CurrencyField AS CurrencyField,
  CompanyCodeCurrency,
  AmountInCompanyCodeCurrency,
  cast( amountincompanycodecurrency - FixedAmountInCoCodeCrcy as fis_hsl_inverted ) AS VariableAmountInCoCodeCrcy,
  cast(( AmountInCompanyCodeCurrency * -1 ) as fis_hsl_inverted) AS InvertedAmtInCoCodeCurrency,
  cast( ( FixedAmountInCoCodeCrcy * -1 ) as fis_hfsl ) AS InvertedFixedAmtInCoCodeCrcy,
  cast( ( VariableAmountInCoCodeCrcy * -1 ) as fis_hsl_inverted ) AS InvertedVarblAmtInCoCodeCrcy
FROM I_GLAcctLineItemSemTagGLAcct
LEFT OUTER JOIN I_CompanyMarginCurrencyField AS _CurrencyField ON CurrencyField = _CurrencyField.CurrencyField  -- association [0..1]
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_CustomerSupplierIndustry AS _CustomerSupplierIndustry ON CustomerSupplierIndustry = _CustomerSupplierIndustry.Industry  -- association [0..1]
LEFT OUTER JOIN I_Division AS _Division ON OrganizationDivision = _Division.Division  -- 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]
;