I_CompanyMarginCube_2

DDL: I_COMPANYMARGINCUBE_2 Type: view_entity COMPOSITE Package: FCOPA_REP_COMPANY_MARGIN

Company Margin - Cube

I_CompanyMarginCube_2 (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_2 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 140 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. It has 7 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 by integrating various financial and operational data. It aggregates and presents data related to general ledger accounts, sales, services, and cost elements, allowing for detailed margin analysis across different dimensions such as products, services, customers, and organizational units. This CDS view provides the data to answer the following business questions: What is the overall company margin across different fiscal periods and organizational units? How do specific account assignment types (e.g., service orders, sales documents) contribute to the company margin? What are the financial impacts of different semantic tags such as billing revenue, cost of goods sold, and overhead costs on the company margin? How do different currencies (company code currency, global currency, functional currency) affect the financial results? What is the margin contribution from specific products, services, and customer groups? How do sales and service orders impact the financial performance and margin? What are the effects of various cost elements like travel costs, HR costs, and service costs on the overall margin? How does the margin vary across different sales organizations, distribution channels, and divisions? What is the impact of specific projects, contracts, and orders on the company margin? How do different fiscal year variants and periods influence the financial outcomes and margin analysis? 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
Important Fields Important fields in this view include the following: Field Name Label Measure or Attribute Ledger Ledger Attribute SourceLedger Source Ledger Attribute CompanyCode Company Code Attribute FiscalYear Fiscal Year Attribute AccountingDocument Journal Entry Attribute LedgerGLLineItem Journal Entry Item Attribute GLAccountHierarchy FSV Attribute SemanticTag Semantic Tag Attribute ValidityStartDate Valid From Attribute ValidityEndDate Valid To Attribute CurrencyField Currency Role Field Attribute FiscalYearVariant Fiscal Year Variant Attribute FiscalPeriod Fiscal Period Attribute FiscalYearPeriod Fiscal Year Period Attribute FiscalQuarter Fiscal Quarter Attribute FiscalYearQuarter Fiscal Year Quarter Attribute BusinessSolutionOrder Solution Order Attribute BusinessSolutionOrderItem Solution Order Item Attribute ProviderContract Provider Contract Attribute ProviderContractItem Pro

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 by integrating various financial and operational data. It aggregates and presents data related to general ledger accounts, sales, services, and cost elements, allowing for detailed margin analysis across different dimensions such as products, services, customers, and organizational units.</p> <p>This CDS view provides the data to answer the following business questions:</p> <ul> <li><p>What is the overall company margin across different fiscal periods and organizational units?</p></li> <li><p>How do specific account assignment types (e.g., service orders, sales documents) contribute to the company margin?</p></li> <li><p>What are the financial impacts of different semantic tags such as billing revenue, cost of goods sold, and overhead costs on the company margin?</p></li> <li><p>How do different currencies (company code currency, global currency, functional currency) affect the financial results?</p></li> <li><p>What is the margin contribution from specific products, services, and customer groups?</p></li> <li><p>How do sales and service orders impact the financial performance and margin?</p></li> <li><p>What are the effects of various cost elements like travel costs, HR costs, and service costs on the overall margin?</p></li> <li><p>How does the margin vary across different sales organizations, distribution channels, and divisions?</p></li> <li><p>What is the impact of specific projects, contracts, and orders on the company margin?</p></li> <li><p>How do different fiscal year variants and periods influence the financial outcomes and margin analysis?</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 (7)

CardinalityTargetAliasCondition
[0..1] I_CompanyMarginCurrencyField _CurrencyField _CurrencyField.CurrencyField = $projection.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
[0..1] I_CompanyMarginCubeDSt _DocumentStore _DocumentStore.tra_ledger = $projection.Ledger and _DocumentStore.tra_sourceledger = $projection.SourceLedger and _DocumentStore.tra_companycode = $projection.CompanyCode and _DocumentStore.tra_currencyfield = $projection.CurrencyField

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 (140)

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 CurrencyField Currency Role Field
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
ReferenceDocumentType ReferenceDocumentType Reference Document 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
CostSourceUnit CostSourceUnit Cost Source Unit
ValuationQuantity ValuationQuantity Valuation 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
CompanyCodeCurrency CompanyCodeCurrency Company Code Currency
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency Amount in Company Code Currency
GlobalCurrency GlobalCurrency GM Billing Element: Global Currency
AmountInGlobalCurrency AmountInGlobalCurrency Amount in Global Currency
FunctionalCurrency FunctionalCurrency Functional Currency
AmountInFunctionalCurrency AmountInFunctionalCurrency Amount in Functional Currency
InvertedAmountInDisplayCrcy Inverted Amount in Company Code Currency
InvertedFixedAmtInDspCrcy Inverted Amount in Company Code Currency
InvertedVarblAmountInDspCrcy Inverted Amount in Company Code Currency
_ProjectExternalID _ProjectExternalID
_SourceLedger _SourceLedger
_JournalEntry _JournalEntry
_CompanyCodeCurrency _CompanyCodeCurrency
_BaseUnit _BaseUnit
_CostSourceUnit _CostSourceUnit
_SemanticTag _SemanticTag
_CurrencyField _CurrencyField
_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
_ReferenceDocumentType _ReferenceDocumentType
_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
_DocumentStore _DocumentStore

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_2.
-- 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_2 AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  _CurrencyField.CurrencyField AS CurrencyField,
  FiscalYearVariant,
  FiscalPeriod,
  FiscalYearPeriod,
  FiscalQuarter,
  FiscalYearQuarter,
  BusinessSolutionOrder,
  BusinessSolutionOrderItem,
  ProviderContract,
  ProviderContractItem,
  SoldProduct,
  Product,
  AccountAssignmentType,
  ProjectExternalID,
  ProfitCenter,
  ServiceDocumentType,
  ServiceDocument,
  ServiceDocumentItem,
  BillToParty,
  BusinessTransactionType,
  ReferenceDocumentType,
  Customer,
  CustomerGroup,
  GLAccount,
  CustomerSupplierIndustry,
  SoldProductGroup,
  SalesOrder,
  SalesOrderItem,
  SalesDocument,
  SalesOrganization,
  ShipToParty,
  ChartOfAccounts,
  ControllingArea,
  BaseUnit,
  Quantity,
  CostSourceUnit,
  ValuationQuantity,
  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,
  CompanyCodeCurrency,
  AmountInCompanyCodeCurrency,
  GlobalCurrency,
  AmountInGlobalCurrency,
  FunctionalCurrency,
  AmountInFunctionalCurrency,
  cast(( AmountInDisplayCurrency * -1 ) as fis_hsl_inverted) AS InvertedAmountInDisplayCrcy,
  cast( ( FixedAmountInDspCrcy * -1 ) as fis_hsl_inverted ) AS InvertedFixedAmtInDspCrcy,
  cast( ( ( AmountInDisplayCurrency - FixedAmountInDspCrcy ) * -1 ) as fis_hsl_inverted ) AS InvertedVarblAmountInDspCrcy
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]
LEFT OUTER JOIN I_CompanyMarginCubeDSt AS _DocumentStore ON _DocumentStore.tra_ledger = Ledger AND _DocumentStore.tra_sourceledger = SourceLedger AND _DocumentStore.tra_companycode = CompanyCode AND _DocumentStore.tra_currencyfield = CurrencyField  -- association [0..1]
;