C_GrossMarginKPI

DDL: C_GROSSMARGINKPI SQL: CGROSSMARGKPI Type: view CONSUMPTION Package: ODATA_GROSSMARGIN

Gross Margin KPI

C_GrossMarginKPI is a Consumption CDS View that provides data about "Gross Margin KPI" in SAP S/4HANA. It reads from 1 data source (I_GrossMargin) and exposes 122 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. Part of development package ODATA_GROSSMARGIN.

Data Sources (1)

SourceAliasJoin Type
I_GrossMargin I_GrossMargin from

Parameters (1)

NameTypeDefault
P_Ledger fins_ledger

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName CGROSSMARGKPI view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Gross Margin KPI view
ObjectModel.query.implementedBy ABAP:CL_GROSSMARGIN_QUERY view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #REQUIRED view
Metadata.ignorePropagatedAnnotations true view
Aggregation.allowPrecisionLoss true view

Fields (122)

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
KEY FinancialPlanningReqTransSqnc FinancialPlanningReqTransSqnc Request TSN
KEY FinancialPlanningDataPacket FinancialPlanningDataPacket Data packet number
KEY FinancialPlanningEntryItem FinancialPlanningEntryItem
DocumentDate DocumentDate Journal Entry Date
ProfitCenter ProfitCenter Profit Center
GLAccount GLAccount General Ledger
SalesOrder SalesOrder SD Document
SalesOrganization SalesOrganization Sales Organization
DistributionChannel DistributionChannel RefDistCh-Cust/Mat.
SoldProduct Product Sold
ProductGroup MaterialGroup Product Group
CustomerGroup CustomerGroup Customer Group
Customer Customer Sold-to Party
FiscalQuarter FiscalQuarter
FiscalPeriod FiscalPeriod Tax period
FiscalYearVariant FiscalYearVariant FY Variant
FiscalYearPeriod Fiscal Year Period
FiscalPeriodStartDate _FiscalPeriodForVariant FiscalPeriodStartDate
FiscalPeriodEndDate _FiscalPeriodForVariant FiscalPeriodEndDate
CompanyCodeCurrency CompanyCodeCurrency Local Currency
GlobalCurrency GlobalCurrency GM Billing Element: Global Currency
SalesDistrict SalesDistrict Sales District
Segment Segment Segment number
SalesOrderItem SalesOrderItem Sales Order Item
OrderType OrderType Order Type
Division Division Internal Division ID
BusinessTransactionType BusinessTransactionType Bus.transaction
BusinessArea BusinessArea Business Area
CostCenter CostCenter Cost Center
CustomerSupplierCountry CustomerSupplierCountry Customer or Supplier Country/Region
ControllingArea _GrossMargin ControllingArea Controlling Area
AccountingDocumentCategory AccountingDocumentCategory Journal Entry Category
PostingDate PostingDate Posting Date for GR
CreationDate CreationDate Time Stamp
ChartOfAccounts _GrossMargin ChartOfAccounts Node Class
LedgerFiscalYear LedgerFiscalYear
FinancialTransactionType FinancialTransactionType Transact. Type
TransactionCurrency TransactionCurrency Transaction Currency
DebitCreditCode DebitCreditCode Single-Character Flag
AssignmentReference AssignmentReference Assignment Reference
PostingKey PostingKey Posting Key
AccountingDocCreatedByUser AccountingDocCreatedByUser User which created overhead document
GLAccountType GLAccountType G/L Account Type
Plant Plant Valuation Area
FinancialAccountType FinancialAccountType Fin. Account Type
SpecialGLCode SpecialGLCode Special G/L Ind
ClearingDate ClearingDate Clearing Date
ClearingAccountingDocument ClearingAccountingDocument Clearing Journal Entry
BillingDocumentType BillingDocumentType Billing Type
CustomerSupplierIndustry CustomerSupplierIndustry Industry
BillToParty BillToParty Inv. Recipient
ShipToParty ShipToParty Ship-To Party (obsolete)
SourceReferenceDocumentType SourceReferenceDocumentType Ref. procedure
SourceReferenceDocument SourceReferenceDocument Reference Doc.
OperatingConcern OperatingConcern Operating concern
TransactionTypeDetermination TransactionTypeDetermination Transaction Key
ControllingDebitCreditCode ControllingDebitCreditCode Dr/Cr ind. CO
AccountingDocumentType AccountingDocumentType Journal Entry Type
ReferenceDocumentType ReferenceDocumentType Reference Document Type
JrnlEntryItemObsoleteReason JrnlEntryItemObsoleteReason
ActlRecognizedRevnAmtInCCCrcy ActlRecognizedRevnAmtInCCCrcy Actual Revenues in CoCode Currency
ActlRecgdRevenueAmtInGlobCrcy ActlRecgdRevenueAmtInGlobCrcy Actual Revenue
ActualCostAmtInCCCrcy ActualCostAmtInCCCrcy Actual COS in CoCode Currency
ActlCostOfGdsSoldAmtInGlobCrcy ActlCostOfGdsSoldAmtInGlobCrcy Actual Cost of Sales
ActlRecognizedMargAmtInCCCrcy ActlRecognizedMargAmtInCCCrcy Actual Margin in CoCode Currency
ActlRecgdMargAmtInGlobCrcy ActlRecgdMargAmtInGlobCrcy Actual Margin
ActlSlsDeductionAmtInGlobCrcy ActlSlsDeductionAmtInGlobCrcy Actual Sales Deductions
ActlSlsDeductionAmtInCCCrcy ActlSlsDeductionAmtInCCCrcy Actual Sales Deductions in CoCode Crcy
ActlBilledRevenueAmtInGlobCrcy ActlBilledRevenueAmtInGlobCrcy Actual Billed Revenue
ActlBilledRevenueAmtInCCCrcy ActlBilledRevenueAmtInCCCrcy Actual Billed Revenue in CoCode Currency
PrdtdRecognizedRevnAmtInCCCrcy PrdtdRecognizedRevnAmtInCCCrcy Predicted Revenues in CoCode Currency
PrdtdRecgdRevenueAmtInGlobCrcy PrdtdRecgdRevenueAmtInGlobCrcy Predicted Revenue
PrdtdCostAmtInCompanyCodeCrcy PrdtdCostAmtInCompanyCodeCrcy Predicted COS in CoCode Currency
PrdtdCostAmtInGlobCrcy PrdtdCostAmtInGlobCrcy Predicted Cost of Sales
PrdtdRecognizedMargAmtInCCCrcy PrdtdRecognizedMargAmtInCCCrcy Predicted Margin in CoCode Currency
PrdtdRecgdMargAmtInGlobCrcy PrdtdRecgdMargAmtInGlobCrcy Predicted Margin
PrdtdSlsDeductionAmtInGlobCrcy PrdtdSlsDeductionAmtInGlobCrcy Predicted Sales Deductions
PrdtdSlsDeductionAmtInCCCrcy PrdtdSlsDeductionAmtInCCCrcy Predicted Sales Deductions in CoCo Crcy
PrdtdBilledRevnAmtInGlobCrcy PrdtdBilledRevnAmtInGlobCrcy Predicted Billed Revenue
PrdtdBilledRevenueAmtInCCCrcy PrdtdBilledRevenueAmtInCCCrcy Predicted Billed Revenue in CoCode Crcy
RecognizedRevnAmtInCCCrcy RecognizedRevnAmtInCCCrcy Presumed Revenues in CoCode Currency
RecognizedRevnAmtInGlobCrcy RecognizedRevnAmtInGlobCrcy Presumed Revenues
CostAmountInCompanyCodeCrcy CostAmountInCompanyCodeCrcy Presumed COS in CoCode Currency
CostOfGoodsSoldAmtInGlobCrcy CostOfGoodsSoldAmtInGlobCrcy Presumed Cost of Sales
RecognizedMarginAmtInCCCrcy RecognizedMarginAmtInCCCrcy Presumed Margin in CoCode Currency
RecognizedMarginAmount RecognizedMarginAmount Presumed Margin
SalesDeductionAmountInGlobCrcy SalesDeductionAmountInGlobCrcy Presumed Sales Deductions
SalesDeductionAmtInCoCodeCrcy SalesDeductionAmtInCoCodeCrcy Presumed Sales Deductions in CoCo Crcy
BilledRevenueAmtInGlobCrcy BilledRevenueAmtInGlobCrcy Presumed Billed Revenue
BilledRevenueAmtInCoCodeCrcy BilledRevenueAmtInCoCodeCrcy Presumed Billed Revenue in CoCode Crcy
PlnRecognizedRevnAmtInCCCrcy PlnRecognizedRevnAmtInCCCrcy Plan Revenues in CoCode Currency
PlnRecgdRevenueAmtInGlobCrcy PlnRecgdRevenueAmtInGlobCrcy Plan Revenue
PlnCostAmtInCompanyCodeCrcy PlnCostAmtInCompanyCodeCrcy Plan COS in CoCode Currency
PlnCostOfGdsSoldAmtInGlobCrcy PlnCostOfGdsSoldAmtInGlobCrcy Plan Cost of Sales
PlnRecognizedMargAmtInCCCrcy PlnRecognizedMargAmtInCCCrcy Plan Margin in CoCode Currency
PlnRecognizedMargAmtInGlobCrcy PlnRecognizedMargAmtInGlobCrcy Plan Margin
PlnSlsDeductionAmtInGlobCrcy PlnSlsDeductionAmtInGlobCrcy Plan Sales Deductions
PlnSlsDeductionAmtInCCCrcy PlnSlsDeductionAmtInCCCrcy Plan Sales Deductions in CoCo Crcy
PlnBilledRevenueAmtInGlobCrcy PlnBilledRevenueAmtInGlobCrcy Plan Billed Revenue
PlnBilledRevenueAmtInCCCrcy PlnBilledRevenueAmtInCCCrcy Plan Billed Revenue in CoCode Crcy
PlanningCategory Plan Category
BaseUnit BaseUnit Unit of Measure
Quantity Quantity Value
AmountFulfillmentPercent Quantity Plan Fulfillment
UnitOfMeasure
IsSimulation IsSimulation
MktgKPIToleranceRangeLow
MktgKPIDeviationRangeLow
AuthorizationGroup AuthorizationGroup AuthorizGroup
_Customer _Customer
_GLAccountInCompanyCode _GLAccountInCompanyCode
_AccountingDocumentType _AccountingDocumentType

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 C_GrossMarginKPI.
-- 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: CGROSSMARGKPI
-- Parameters: P_Ledger : fins_ledger

CREATE VIEW C_GrossMarginKPI AS
SELECT
  Ledger,
  SourceLedger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  GLAccountHierarchy,
  SemanticTag,
  ValidityStartDate,
  ValidityEndDate,
  FinancialPlanningReqTransSqnc,
  FinancialPlanningDataPacket,
  FinancialPlanningEntryItem,
  DocumentDate,
  ProfitCenter,
  GLAccount,
  SalesOrder,
  SalesOrganization,
  DistributionChannel,
  cast (SoldMaterial as fins_matnr_pa preserving type) AS SoldProduct,
  MaterialGroup AS ProductGroup,
  CustomerGroup,
  Customer,
  FiscalQuarter,
  FiscalPeriod,
  FiscalYearVariant,
  cast(FiscalYearPeriod as abap.char( 7 )) AS FiscalYearPeriod,
  _FiscalPeriodForVariant.FiscalPeriodStartDate AS FiscalPeriodStartDate,
  _FiscalPeriodForVariant.FiscalPeriodEndDate AS FiscalPeriodEndDate,
  CompanyCodeCurrency,
  GlobalCurrency,
  SalesDistrict,
  Segment,
  SalesOrderItem,
  OrderType,
  Division,
  BusinessTransactionType,
  BusinessArea,
  CostCenter,
  CustomerSupplierCountry,
  _GrossMargin.ControllingArea AS ControllingArea,
  AccountingDocumentCategory,
  PostingDate,
  CreationDate,
  _GrossMargin.ChartOfAccounts AS ChartOfAccounts,
  LedgerFiscalYear,
  FinancialTransactionType,
  TransactionCurrency,
  DebitCreditCode,
  AssignmentReference,
  PostingKey,
  AccountingDocCreatedByUser,
  GLAccountType,
  Plant,
  FinancialAccountType,
  SpecialGLCode,
  ClearingDate,
  ClearingAccountingDocument,
  BillingDocumentType,
  CustomerSupplierIndustry,
  BillToParty,
  ShipToParty,
  SourceReferenceDocumentType,
  SourceReferenceDocument,
  OperatingConcern,
  TransactionTypeDetermination,
  ControllingDebitCreditCode,
  AccountingDocumentType,
  ReferenceDocumentType,
  JrnlEntryItemObsoleteReason,
  ActlRecognizedRevnAmtInCCCrcy,
  ActlRecgdRevenueAmtInGlobCrcy,
  ActualCostAmtInCCCrcy,
  ActlCostOfGdsSoldAmtInGlobCrcy,
  ActlRecognizedMargAmtInCCCrcy,
  ActlRecgdMargAmtInGlobCrcy,
  ActlSlsDeductionAmtInGlobCrcy,
  ActlSlsDeductionAmtInCCCrcy,
  ActlBilledRevenueAmtInGlobCrcy,
  ActlBilledRevenueAmtInCCCrcy,
  PrdtdRecognizedRevnAmtInCCCrcy,
  PrdtdRecgdRevenueAmtInGlobCrcy,
  PrdtdCostAmtInCompanyCodeCrcy,
  PrdtdCostAmtInGlobCrcy,
  PrdtdRecognizedMargAmtInCCCrcy,
  PrdtdRecgdMargAmtInGlobCrcy,
  PrdtdSlsDeductionAmtInGlobCrcy,
  PrdtdSlsDeductionAmtInCCCrcy,
  PrdtdBilledRevnAmtInGlobCrcy,
  PrdtdBilledRevenueAmtInCCCrcy,
  RecognizedRevnAmtInCCCrcy,
  RecognizedRevnAmtInGlobCrcy,
  CostAmountInCompanyCodeCrcy,
  CostOfGoodsSoldAmtInGlobCrcy,
  RecognizedMarginAmtInCCCrcy,
  RecognizedMarginAmount,
  SalesDeductionAmountInGlobCrcy,
  SalesDeductionAmtInCoCodeCrcy,
  BilledRevenueAmtInGlobCrcy,
  BilledRevenueAmtInCoCodeCrcy,
  PlnRecognizedRevnAmtInCCCrcy,
  PlnRecgdRevenueAmtInGlobCrcy,
  PlnCostAmtInCompanyCodeCrcy,
  PlnCostOfGdsSoldAmtInGlobCrcy,
  PlnRecognizedMargAmtInCCCrcy,
  PlnRecognizedMargAmtInGlobCrcy,
  PlnSlsDeductionAmtInGlobCrcy,
  PlnSlsDeductionAmtInCCCrcy,
  PlnBilledRevenueAmtInGlobCrcy,
  PlnBilledRevenueAmtInCCCrcy,
  cast(PlanningCategory as fac_revvar_pln_category) AS PlanningCategory,
  BaseUnit,
  Quantity,
  Quantity AS AmountFulfillmentPercent,
  cast('%' as msehi) AS UnitOfMeasure,
  IsSimulation,
  cast(100 as abap.int1) AS MktgKPIToleranceRangeLow,
  cast(100 as abap.int1) AS MktgKPIDeviationRangeLow,
  AuthorizationGroup
FROM I_GrossMargin
;