FIS_COGS

DDL: FIS_COGS SQL: FICOGSCLNT Type: view

Cost of Goods Sold

FIS_COGS is a CDS View that provides data about "Cost of Goods Sold" in SAP S/4HANA. It reads from 3 data sources (I_GLAccountLineItemRawData, I_Ledger, I_SemTagGLAccount) and exposes 16 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 1 association to related views.

Data Sources (3)

SourceAliasJoin Type
I_GLAccountLineItemRawData I_GLAccountLineItemRawData from
I_Ledger I_Ledger inner
I_SemTagGLAccount I_SemTagGLAccount inner

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_GLAccountLineItemRawData _auth I_GLAccountLineItemRawData.SourceLedger = _auth.SourceLedger and I_GLAccountLineItemRawData.CompanyCode = _auth.CompanyCode and I_GLAccountLineItemRawData.FiscalYear = _auth.FiscalYear and I_GLAccountLineItemRawData.AccountingDocument = _auth.AccountingDocument and I_GLAccountLineItemRawData.LedgerGLLineItem = _auth.LedgerGLLineItem

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName FICOGSCLNT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking TRANSACTIONAL_DATA view
EndUserText.label Cost of Goods Sold view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.type #CLIENT_DEPENDENT view
ClientHandling.algorithm #AUTOMATED view

Fields (16)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_GLAccountLineItemRawData SourceLedger
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItemRawData LedgerGLLineItem
Plant I_GLAccountLineItemRawData Plant
Product I_GLAccountLineItemRawData Product
PostingDate I_GLAccountLineItemRawData PostingDate
LedgerFiscalYear I_GLAccountLineItemRawData LedgerFiscalYear
FiscalYearPeriod I_GLAccountLineItemRawData FiscalYearPeriod
FiscalPeriod I_GLAccountLineItemRawData FiscalPeriod
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency
AmountInCompanyCodeCurrency I_GLAccountLineItemRawData AmountInCompanyCodeCurrency
GlobalCurrency I_GLAccountLineItemRawData GlobalCurrency
AmountInGlobalCurrency I_GLAccountLineItemRawData AmountInGlobalCurrency
_auth _auth
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AbapCatalog.sqlViewName: 'FICOGSCLNT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: 'TRANSACTIONAL_DATA'
@EndUserText.label: 'Cost of Goods Sold'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #D,
  sizeCategory: #XXL,
  dataClass: #MIXED
}
@ClientHandling.type: #CLIENT_DEPENDENT
@ClientHandling.algorithm: #AUTOMATED

define view  FIS_COGS as select from I_GLAccountLineItemRawData
    inner join   I_Ledger on  I_Ledger.Ledger       = I_GLAccountLineItemRawData.SourceLedger
                          and I_Ledger.IsLeadingLedger = 'X'   
    left outer to one join I_ControllingArea on I_GLAccountLineItemRawData.ControllingArea = I_ControllingArea.ControllingArea
                                 
    inner join   I_SemTagGLAccount on  I_SemTagGLAccount.GLAccount       = I_GLAccountLineItemRawData.GLAccount
                                   and I_SemTagGLAccount.ChartOfAccounts = I_GLAccountLineItemRawData.ChartOfAccounts
                                   and I_SemTagGLAccount.GLAccountHierarchy = I_ControllingArea.CtrlgStdFinStatementVersion



association [1..1] to I_GLAccountLineItemRawData as _auth
on  I_GLAccountLineItemRawData.SourceLedger = _auth.SourceLedger 
and I_GLAccountLineItemRawData.CompanyCode = _auth.CompanyCode
and I_GLAccountLineItemRawData.FiscalYear = _auth.FiscalYear
and I_GLAccountLineItemRawData.AccountingDocument = _auth.AccountingDocument
and I_GLAccountLineItemRawData.LedgerGLLineItem = _auth.LedgerGLLineItem
{
//  P_GLAccountLineItemSemTagGLACC.mandt,

key I_GLAccountLineItemRawData.SourceLedger, 
key I_GLAccountLineItemRawData.CompanyCode,
key I_GLAccountLineItemRawData.FiscalYear,
key I_GLAccountLineItemRawData.AccountingDocument,
key I_GLAccountLineItemRawData.LedgerGLLineItem,

  I_GLAccountLineItemRawData.Plant,
  I_GLAccountLineItemRawData.Product,
  I_GLAccountLineItemRawData.PostingDate,
  I_GLAccountLineItemRawData.LedgerFiscalYear,
  I_GLAccountLineItemRawData.FiscalYearPeriod,
  I_GLAccountLineItemRawData.FiscalPeriod,
  I_GLAccountLineItemRawData.CompanyCodeCurrency,
  @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
  I_GLAccountLineItemRawData.AmountInCompanyCodeCurrency,
  I_GLAccountLineItemRawData.GlobalCurrency,
  @Semantics.amount.currencyCode: 'GlobalCurrency'
  I_GLAccountLineItemRawData.AmountInGlobalCurrency,
  
  @Consumption.hidden: true  
  _auth
}
where I_SemTagGLAccount.SemanticTag = 'RECO_COS'
and I_GLAccountLineItemRawData.Plant is not initial
and I_GLAccountLineItemRawData.Product is not initial
and I_SemTagGLAccount.ValidityStartDate <= $session.system_date
and I_SemTagGLAccount.ValidityEndDate   >= $session.system_date
  
//

//group by 

//  P_GLAccountLineItemSemTagGLACC.Plant,

//  P_GLAccountLineItemSemTagGLACC.Product,

//  P_GLAccountLineItemSemTagGLACC.PostingDate,

//  P_GLAccountLineItemSemTagGLACC.CompanyCodeCurrency,

//  P_GLAccountLineItemSemTagGLACC.GlobalCurrency

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CONTROLLINGAREA",
"I_GLACCOUNTLINEITEMRAWDATA",
"I_LEDGER",
"I_SEMTAGGLACCOUNT"
],
"ASSOCIATED":
[
"I_GLACCOUNTLINEITEMRAWDATA"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/