C_COGSSplitRelevantGLItems

DDL: C_COGSSPLITRELEVANTGLITEMS SQL: CCOGSSPLRELGLI Type: view CONSUMPTION

Relevant Items from COGS Split and Original Document

C_COGSSplitRelevantGLItems is a Consumption CDS View that provides data about "Relevant Items from COGS Split and Original Document" in SAP S/4HANA. It reads from 4 data sources (I_GLAccountLineItem, I_GLAccountLineItem, I_COGSSplitSourceAccount, I_Ledger) and exposes 76 fields with key fields Ledger, CompanyCode, FiscalYear, JournalEntry, JournalEntryItem. It has 3 associations to related views.

Data Sources (4)

SourceAliasJoin Type
I_GLAccountLineItem A from
I_GLAccountLineItem A union_all
I_COGSSplitSourceAccount COGS_Accounts inner
I_Ledger I_Ledger inner

Associations (3)

CardinalityTargetAliasCondition
[1..*] I_COGSSplitGLItemRole _ITEMROLE _ITEMROLE.DomainValue is not null
[0..*] I_GLAccountTextRawData _GLAccountText $projection.ChartOfAccounts = _GLAccountText.ChartOfAccounts and $projection.GLAccount = _GLAccountText.GLAccount
[1..1] C_COGSSplitAndOriginalItem _OriginalItem $projection.Ledger = _OriginalItem.Ledger and $projection.CompanyCode = _OriginalItem.CompanyCode and $projection.FiscalYear = _OriginalItem.FiscalYear and $projection.JournalEntry = _OriginalItem.JournalEntry and $projection.JournalEntryItem = _OriginalItem.JournalEntryItem and $projection.GLBusinessTransactionType = _OriginalItem.BusinessTransactionType and $projection.ReferenceDocument = _OriginalItem.ReferenceDocument and $projection.ReferenceDocumentItem = _OriginalItem.ReferenceDocumentItem and $projection.ReferenceDocumentType = _OriginalItem.ReferenceDocumentType and $projection.SourceReferenceDocument = _OriginalItem.SourceReferenceDocument and $projection.SourceReferenceDocumentItem = _OriginalItem.SourceReferenceDocumentItem and $projection.SourceReferenceDocumentType = _OriginalItem.SourceReferenceDocumentType and $projection.PostingDate = _OriginalItem.PostingDate -- Implemented in implementing class or $projection.AccountingDocumentCategory <> 'P' )

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName CCOGSSPLRELGLI view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.allowExtensions true view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
VDM.viewType #CONSUMPTION view
EndUserText.label Relevant Items from COGS Split and Original Document view
UI.headerInfo.description.value COGSSplitGLItemRoleName view
UI.headerInfo.title.type STANDARD view
UI.headerInfo.title.value JournalEntry view

Fields (76)

KeyFieldSource TableSource FieldDescription
KEY Ledger I_GLAccountLineItem Ledger
KEY CompanyCode I_GLAccountLineItem CompanyCode
KEY FiscalYear I_GLAccountLineItem FiscalYear
KEY JournalEntry I_GLAccountLineItem AccountingDocument
KEY JournalEntryItem
PostingDate I_GLAccountLineItem PostingDate
FiscalPeriod I_GLAccountLineItem FiscalPeriod
Product I_GLAccountLineItem Product
Plant I_GLAccountLineItem Plant
CompanyCodeHierarchy
CompanyCodeHierarchyNode
GLAccountHierarchy
GLAccountHierarchyNode
GLAccountName
GLAccount I_GLAccountLineItem GLAccount
AmountInCompanyCodeCurrency I_GLAccountLineItem AmountInCompanyCodeCurrency
BaseUnit I_GLAccountLineItem BaseUnit
CompanyCodeCurrency I_GLAccountLineItem CompanyCodeCurrency
AmountInGlobalCurrency I_GLAccountLineItem AmountInGlobalCurrency
GlobalCurrency I_GLAccountLineItem GlobalCurrency
Quantity I_GLAccountLineItem Quantity
ReferenceDocument I_GLAccountLineItem ReferenceDocument
ReferenceDocumentItem I_GLAccountLineItem ReferenceDocumentItem
ReferenceDocumentType I_GLAccountLineItem ReferenceDocumentType
SourceReferenceDocument I_GLAccountLineItem SourceReferenceDocument
SourceReferenceDocumentItem I_GLAccountLineItem SourceReferenceDocumentItem
SourceReferenceDocumentType I_GLAccountLineItem SourceReferenceDocumentType
AccountingDocumentCategory I_GLAccountLineItem AccountingDocumentCategory
BusinessTransactionType I_GLAccountLineItem BusinessTransactionType
GLBusinessTransactionType I_GLAccountLineItem GLBusinessTransactionType
SubLedgerAcctLineItemType I_GLAccountLineItem SubLedgerAcctLineItemType
_SubLedgerAccLineItemType I_GLAccountLineItem _SubLedgerAccLineItemType
SalesOrder I_GLAccountLineItem SalesOrder
SalesOrderItem I_GLAccountLineItem SalesOrderItem
_OriginalItem _OriginalItem
ChartOfAccounts I_GLAccountLineItem ChartOfAccounts
OrganizationDivision I_GLAccountLineItem OrganizationDivision
_ServiceDocument I_GLAccountLineItem _ServiceDocument
SalesOrganization I_GLAccountLineItem SalesOrganization
_CurrentCostCenter I_GLAccountLineItem _CurrentCostCenter
DistributionChannel I_GLAccountLineItem DistributionChannel
FinancialAccountType I_GLAccountLineItem FinancialAccountType
CostCenter I_GLAccountLineItem CostCenter
ControllingArea I_GLAccountLineItem ControllingArea
_CurrentProfitCenter I_GLAccountLineItem _CurrentProfitCenter
BusinessArea I_GLAccountLineItem BusinessArea
FunctionalArea I_GLAccountLineItem FunctionalArea
Segment I_GLAccountLineItem Segment
ValuationArea I_GLAccountLineItem ValuationArea
AssetClass I_GLAccountLineItem AssetClass
_Order I_GLAccountLineItem _Order
OrderID I_GLAccountLineItem OrderID
_SalesDocument I_GLAccountLineItem _SalesDocument
SalesDocument I_GLAccountLineItem SalesDocument
SalesDocumentItem I_GLAccountLineItem SalesDocumentItem
ServiceDocumentType I_GLAccountLineItem ServiceDocumentType
_AccountingDocumentType I_GLAccountLineItem _AccountingDocumentType
AccountingDocumentType I_GLAccountLineItem AccountingDocumentType
ProfitCenter I_GLAccountLineItem ProfitCenter
_GLAccountInCompanyCode I_GLAccountLineItem _GLAccountInCompanyCode
_Supplier I_GLAccountLineItem _Supplier
Supplier I_GLAccountLineItem Supplier
_Customer I_GLAccountLineItem _Customer
Customer I_GLAccountLineItem Customer
ServiceDocument I_GLAccountLineItem ServiceDocument
CompanyCodeName
PlantName
BusinessTransactionTypeName
AccountingDocumentCategoryP
purposeSTANDARD
typeFIELDGROUP_REFERENCE
labelCOGSSplitBasis
position10
CompanyCode
position10
ProductName
@AbapCatalog.sqlViewName: 'CCOGSSPLRELGLI'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel: {usageType: { sizeCategory: #M,
                             dataClass:  #MIXED,
                             serviceQuality: #C } }
 //@ObjectModel.query.implementedBy: 'ABAP:CL_FCO_COGS_EXPLAIN_QRY'

@VDM.viewType: #CONSUMPTION
@EndUserText.label: 'Relevant Items from COGS Split and Original Document'

@UI.headerInfo.description.value: 'COGSSplitGLItemRoleName'
@UI.headerInfo.title.type: 'STANDARD'
//@UI.headerInfo.title.label: 'picked up from '

@UI.headerInfo.title.value: 'JournalEntry' 
//@UI.presentationVariant: [{

//qualifier: 'GroupBy',

//id: 'test',

//text: 'tgdtd',

//

//     groupBy:  ['ReferenceDocument'] }]

//fcoc_cogs_sa original items

define view C_COGSSplitRelevantGLItems
  as select from I_GLAccountLineItem           as A    
    inner join   I_COGSSplitSourceAccount as COGS_Accounts      on COGS_Accounts.COGSSplitSourceAccount = A.GLAccount
    inner join   I_Ledger                                       on A.Ledger = I_Ledger.Ledger
                                                                and I_Ledger.ReferenceLedger = ' '    
    
    association [1..*] to  I_COGSSplitGLItemRole   as _ITEMROLE on _ITEMROLE.DomainValue is not null
//   "association [1..*] to  I_COGSSplitGLItemRoleText   as _ITEMROLETEXT on $projection.COGSSplitGLItemRole = _ITEMROLETEXT.DomainValue                 


    association [0..*] to I_GLAccountTextRawData as _GLAccountText on       $projection.ChartOfAccounts =   _GLAccountText.ChartOfAccounts
                                                                   and       $projection.GLAccount =      _GLAccountText.GLAccount         

  
  association [1..1] to C_COGSSplitAndOriginalItem as _OriginalItem on  $projection.Ledger                      = _OriginalItem.Ledger
                                                                    and $projection.CompanyCode                 = _OriginalItem.CompanyCode
                                                                    and $projection.FiscalYear                  = _OriginalItem.FiscalYear
                                                                    and $projection.JournalEntry                = _OriginalItem.JournalEntry
                                                                    and $projection.JournalEntryItem            = _OriginalItem.JournalEntryItem
                                                                    and $projection.GLBusinessTransactionType   = _OriginalItem.BusinessTransactionType
                                                                    and $projection.ReferenceDocument           = _OriginalItem.ReferenceDocument
                                                                    and $projection.ReferenceDocumentItem       = _OriginalItem.ReferenceDocumentItem
                                                                    and $projection.ReferenceDocumentType       = _OriginalItem.ReferenceDocumentType
                                                                    and $projection.SourceReferenceDocument     = _OriginalItem.SourceReferenceDocument
                                                                    and $projection.SourceReferenceDocumentItem = _OriginalItem.SourceReferenceDocumentItem
                                                                    and $projection.SourceReferenceDocumentType = _OriginalItem.SourceReferenceDocumentType
                                                                    and $projection.PostingDate                 = _OriginalItem.PostingDate
                                                                          -- Implemented in implementing class or $projection.AccountingDocumentCategory <> 'P' )
{
       @UI.facet                   :
            [{ id                  : 'SplitBasis',
               purpose             :  #STANDARD,
               type                :  #FIELDGROUP_REFERENCE,
               label               :  'Split Basis',
               position            :  10,
               targetQualifier     :  'SplitBasis' }]
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_Ledger' , element: 'Ledger' }, 
                                     additionalBinding: [{ element: 'ReferenceLedger', localConstant: ' ', usage:#FILTER}]                                      
                                  }] 
  key  A.Ledger,
  
  @ObjectModel.text.element: ['CompanyCodeName']
  key  A.CompanyCode,
       @UI.fieldGroup              : [ { qualifier: 'SplitBasis' , position: 10 ,importance: #HIGH    } ]
       @Consumption.valueHelpDefinition: [{ entity: { name: 'I_FiscalYearForVariant' , element: 'FiscalYear' }                                     
                                  }]
  key  A.FiscalYear,
  key  A.AccountingDocument           as JournalEntry,
  key  cast( A.LedgerGLLineItem as fis_jeitm )            as JournalEntryItem,
       //       case when A.BusinessTransactionType <> 'TBCS' then A.AccountingDocument else  B.AccountingDocument  end                                      as COGSSplitOriginalJournalEntry,

       //       case when A.BusinessTransactionType <> 'TBCS' then  A.LedgerGLLineItem  else  B.LedgerGLLineItem  end                                      as COGSSplitOriginalJrnlEntryItem,

       //       case when B.AccountingDocument is not null then B.AccountingDocument when A.BusinessTransactionType = 'TBCS' then A.AccountingDocument end as COGSSplitJournalEntry,

       @Consumption.filter.selectionType:#INTERVAL
       A.PostingDate, //@UI.hidden

       A.FiscalPeriod,
       @ObjectModel.text.element: ['ProductName']
       A.Product,
       @ObjectModel.text.element: ['PlantName']
       A.Plant,
 // Hierarchies

      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_CompanyCodeHierarchyVH', element: 'CompanyCodeHierarchy' } }]
      @Consumption.filter.selectionType: #SINGLE
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_hryid_ccode_42)  as CompanyCodeHierarchy,
      @Consumption.filter.hidden: true
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_hrynid_ccode_50) as CompanyCodeHierarchyNode,
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_GLAccountHierarchyStdVH', element: 'GLAccountHierarchy' } }]
      @Consumption.filter.selectionType: #SINGLE
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_glaccthier)  as GLAccountHierarchy,
      @Consumption.filter.hidden: true
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_glacct_hrynid_50) as GLAccountHierarchyNode,
       _GLAccountText[1:Language = $session.system_language ].GLAccountName                 as GLAccountName,
       @ObjectModel.text.element: ['GLAccountName']
       A.GLAccount,
       //A.GLAccountName,

       @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       A.AmountInCompanyCodeCurrency,
       //@Semantics.unitOfMeasure:true

       A.BaseUnit,
       @Semantics.currencyCode: true
       A.CompanyCodeCurrency,
       @Semantics.amount.currencyCode: 'GlobalCurrency'
       A.AmountInGlobalCurrency,
       @Semantics.currencyCode: true
       A.GlobalCurrency,                 
       A.Quantity,
       A.ReferenceDocument,
       A.ReferenceDocumentItem,
       A.ReferenceDocumentType,
       A.SourceReferenceDocument,
       A.SourceReferenceDocumentItem,
       A.SourceReferenceDocumentType,  
       A.AccountingDocumentCategory,          
       @ObjectModel.text.element: ['BusinessTransactionTypeName']
       A.BusinessTransactionType,
       A.GLBusinessTransactionType,
       @ObjectModel.foreignKey.association: '_SubLedgerAccLineItemType'
       A.SubLedgerAcctLineItemType,
       A._SubLedgerAccLineItemType,
       A.SalesOrder,        
       A.SalesOrderItem,
       case when A.GLBusinessTransactionType <> 'TBCS' then _ITEMROLE[1: DomainValue = 'ORIGINAL']._Text[1:Language = $session.system_language ].COGSSplitGLItemRoleName else 
       _ITEMROLE[1: DomainValue = 'SPLIT' ]._Text[1:Language = $session.system_language ].COGSSplitGLItemRoleName end as COGSSplitGLItemRoleName,
       @ObjectModel.text.element: ['COGSSplitGLItemRoleName']
       case when A.GLBusinessTransactionType <> 'TBCS' then _ITEMROLE[1: DomainValue = 'ORIGINAL'].COGSSplitGLItemRole else 
       _ITEMROLE[1: DomainValue = 'SPLIT' ].COGSSplitGLItemRole end as COGSSplitGLItemRole,
       @Consumption.filter.hidden: true
       @ObjectModel.filter.enabled: false
       @ObjectModel.sort.enabled: false
       _OriginalItem,
       @UI.hidden: true
       A.ChartOfAccounts,
       //       _SplitBasis,

       //       _Calculation,

       //       _Messages,

       //       to_ValueHelp

//    @Consumption.hidden            

//    @Consumption.filter.hidden: true

//    @UI.hidden: true               

//       A._GLAccountTxt,

    @Consumption.hidden 
    A.OrganizationDivision, 
    @Consumption.hidden 
    A._ServiceDocument,
    @Consumption.hidden 
    A.SalesOrganization,
    @Consumption.hidden 
    A._CurrentCostCenter,
    @Consumption.hidden 
    A.DistributionChannel,
    @Consumption.hidden 
    A.FinancialAccountType, 
    @Consumption.hidden 
    A.CostCenter,
    @Consumption.hidden 
    A.ControllingArea, 
    @Consumption.hidden 
    A._CurrentProfitCenter, 
    @Consumption.hidden 
    A.BusinessArea,
    @Consumption.hidden 
    A.FunctionalArea,
    @Consumption.hidden 
    A.Segment,
    @Consumption.hidden 
    A.ValuationArea,
    @Consumption.hidden 
    A.AssetClass,
    @Consumption.hidden 
    A._Order,
    @Consumption.hidden 
    A.OrderID,    
    @Consumption.hidden 
    A._SalesDocument,
    @Consumption.hidden 
    A.SalesDocument,
    @Consumption.hidden
    A.SalesDocumentItem,
    @Consumption.hidden 
    A.ServiceDocumentType,
    @Consumption.hidden 
    A._AccountingDocumentType,
    @Consumption.hidden 
    A.AccountingDocumentType,
    @Consumption.hidden 
    A.ProfitCenter,
    @Consumption.hidden 
    A._GLAccountInCompanyCode,
    @Consumption.hidden 
    A._Supplier,
    @Consumption.hidden 
     A.Supplier,
    @Consumption.hidden 
    A._Customer,
    @Consumption.hidden 
    A.Customer,
    @Consumption.hidden 
    A.ServiceDocument,
    A._CompanyCode.CompanyCodeName,
    A._Plant.PlantName,
    A._BusinessTransactionType._Text[1:Language = $session.system_language ].BusinessTransactionTypeName,
    A._Product._Text[1:Language = $session.system_language ].ProductName 
}
where
  A.GLBusinessTransactionType <> 'TBCS' and
  A.JrnlEntryItemObsoleteReason = ' '
//group by

//  A.Ledger,

//  A.CompanyCode,

//  A.FiscalYear,

//  A.AccountingDocument,

//  A.LedgerGLLineItem,

//  A.BusinessTransactionType,

//  //  B.AccountingDocument,

//  //  B.LedgerGLLineItem,

//  //  B.AccountingDocument,

//  A.PostingDate,

//  A.FiscalPeriod,

//  A.FiscalPeriod,

//  A.Product,

//  A.Plant,

//  A.GLAccount,

//  //A.GLAccountName,

//  A.AmountInCompanyCodeCurrency,

//  A.CompanyCodeCurrency,

//  A.AmountInGlobalCurrency,

//  A.GlobalCurrency,

//  A.ReferenceDocument,

//  A.ReferenceDocumentItem,

//  A.ReferenceDocumentType,

//  A.ReferenceDocumentType,

//  A.BusinessTransactionType,

//  A.SubLedgerAcctLineItemType

union all select from I_GLAccountLineItem as A
   association [1..*] to  I_COGSSplitGLItemRole   as _ITEMROLE on _ITEMROLE.DomainValue is not null
   association [0..*] to I_GLAccountTextRawData as _GLAccountText on       $projection.ChartOfAccounts =   _GLAccountText.ChartOfAccounts
                                                                  and       $projection.GLAccount =      _GLAccountText.GLAccount         
   
association [1..1] to C_COGSSplitAndOriginalItem as _OriginalItem on  $projection.Ledger                      = _OriginalItem.Ledger
                                                                  and $projection.CompanyCode                 = _OriginalItem.CompanyCode
                                                                  and $projection.FiscalYear                  = _OriginalItem.FiscalYear
                                                                  and $projection.JournalEntry                = _OriginalItem.JournalEntry
                                                                  and $projection.JournalEntryItem            = _OriginalItem.JournalEntryItem
                                                                  and $projection.GLBusinessTransactionType   = _OriginalItem.BusinessTransactionType
                                                                  and $projection.ReferenceDocument           = _OriginalItem.ReferenceDocument
                                                                  and $projection.ReferenceDocumentItem       = _OriginalItem.ReferenceDocumentItem
                                                                  and $projection.ReferenceDocumentType       = _OriginalItem.ReferenceDocumentType
                                                                  and $projection.SourceReferenceDocument     = _OriginalItem.SourceReferenceDocument
                                                                  and $projection.SourceReferenceDocumentItem = _OriginalItem.SourceReferenceDocumentItem
                                                                  and $projection.SourceReferenceDocumentType = _OriginalItem.SourceReferenceDocumentType
                                                                  and $projection.PostingDate                 = _OriginalItem.PostingDate
                                                                      -- Implemented in implementing class or $projection.AccountingDocumentCategory <> 'P' )  or $projection.AccountingDocumentCategory <> 'P' )
                                                                  
{
       @UI.facet                   :
            [{ id                  : 'SplitBasis',
               purpose             :  #STANDARD,
               type                :  #FIELDGROUP_REFERENCE,
               label               :  'COGS Split Basis',
               position            :  10,
               targetQualifier     :  'SplitBasis' }]
  key  A.Ledger,
  @ObjectModel.text.element: ['CompanyCodeName']
  key  A.CompanyCode,
       @UI.fieldGroup              : [ { qualifier: 'SplitBasis' , position: 10 ,importance: #HIGH    } ]
       @Consumption.valueHelpDefinition: [{ entity: { name: 'I_FiscalYear' , element: 'FiscalYear' }                                     
                                  }]      
  key  A.FiscalYear,
  key  A.AccountingDocument           as JournalEntry,
  key  cast( A.LedgerGLLineItem as fis_jeitm )             as JournalEntryItem,
       //       case when A.BusinessTransactionType <> 'TBCS' then A.AccountingDocument else  B.AccountingDocument  end                                      as COGSSplitOriginalJournalEntry,

       //       case when A.BusinessTransactionType <> 'TBCS' then  A.LedgerGLLineItem  else  B.LedgerGLLineItem  end                                      as COGSSplitOriginalJrnlEntryItem,

       //       case when B.AccountingDocument is not null then B.AccountingDocument when A.BusinessTransactionType = 'TBCS' then A.AccountingDocument end as COGSSplitJournalEntry,

       A.PostingDate, //@UI.hidden

       A.FiscalPeriod,
       @ObjectModel.text.element: ['ProductName']
       A.Product,
       @ObjectModel.text.element: ['PlantName']
       A.Plant,
// Hierarchies

      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_CompanyCodeHierarchyVH', element: 'CompanyCodeHierarchy' } }]
      @Consumption.filter.selectionType: #SINGLE
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_hryid_ccode_42)  as CompanyCodeHierarchy,
      @Consumption.filter.hidden: true
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_hrynid_ccode_50) as CompanyCodeHierarchyNode,
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_GLAccountHierarchyStdVH', element: 'GLAccountHierarchy' } }]
      @Consumption.filter.selectionType: #SINGLE
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_glaccthier)  as GLAccountHierarchy,
      @Consumption.filter.hidden: true
      @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
      cast('' as fis_glacct_hrynid_50) as GLAccountHierarchyNode,
       _GLAccountText[1:Language = $session.system_language ].GLAccountName                as GLAccountName,
       @ObjectModel.text.element: ['GLAccountName']
       A.GLAccount,
       @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       A.AmountInCompanyCodeCurrency,
       //@Semantics.unitOfMeasure:true

       A.BaseUnit,
       @Semantics.currencyCode: true
       A.CompanyCodeCurrency,
       @Semantics.amount.currencyCode: 'GlobalCurrency'
       A.AmountInGlobalCurrency,
       @Semantics.currencyCode: true
       A.GlobalCurrency,
       A.Quantity,
       A.ReferenceDocument,
       A.ReferenceDocumentItem,
       A.ReferenceDocumentType,
       A.SourceReferenceDocument,
       A.SourceReferenceDocumentItem,
       A.SourceReferenceDocumentType,  
       A.AccountingDocumentCategory,     
       @ObjectModel.text.element: ['BusinessTransactionTypeName']
       A.BusinessTransactionType,
       A.GLBusinessTransactionType,
       @ObjectModel.foreignKey.association: '_SubLedgerAccLineItemType'
       A.SubLedgerAcctLineItemType,
       A._SubLedgerAccLineItemType,
       A.SalesOrder,        
       A.SalesOrderItem,
       case when A.GLBusinessTransactionType <> 'TBCS' then _ITEMROLE[1: DomainValue = 'ORIGINAL']._Text[1:Language = $session.system_language ].COGSSplitGLItemRoleName else 
       _ITEMROLE[1: DomainValue = 'SPLIT' ]._Text[1:Language = $session.system_language ].COGSSplitGLItemRoleName end as COGSSplitGLItemRoleName,
       @ObjectModel.text.element: ['COGSSplitGLItemRoleName']
       case when A.GLBusinessTransactionType <> 'TBCS' then _ITEMROLE[1: DomainValue = 'ORIGINAL'].COGSSplitGLItemRole else 
       _ITEMROLE[1: DomainValue = 'SPLIT' ].COGSSplitGLItemRole end as COGSSplitGLItemRole,
       @Consumption.filter.hidden: true
       @ObjectModel.filter.enabled: false
       @ObjectModel.sort.enabled: false       
       _OriginalItem,
       @UI.hidden: true
       A.ChartOfAccounts,
//       @Consumption.hidden

//       @Consumption.filter.hidden: true

//       @UI.hidden: true

//       A._GLAccountTxt,

       //       _SplitBasis,

       //       _Calculation,

       //       _Messages,

       //       _ValueHelp

       @Consumption.hidden 
    A.OrganizationDivision, 
    @Consumption.hidden 
    A._ServiceDocument,
    @Consumption.hidden 
    A.SalesOrganization,
    @Consumption.hidden 
    A._CurrentCostCenter,
    @Consumption.hidden 
    A.DistributionChannel,
    @Consumption.hidden 
    A.FinancialAccountType, 
    @Consumption.hidden 
    A.CostCenter,
    @Consumption.hidden 
    A.ControllingArea, 
    @Consumption.hidden 
    A._CurrentProfitCenter, 
    @Consumption.hidden 
    A.BusinessArea,
    @Consumption.hidden 
    A.FunctionalArea,
    @Consumption.hidden 
    A.Segment,
    @Consumption.hidden 
    A.ValuationArea,
    @Consumption.hidden 
    A.AssetClass,
    @Consumption.hidden 
    A._Order,
    @Consumption.hidden 
    A.OrderID,    
    @Consumption.hidden 
    A._SalesDocument,
    @Consumption.hidden 
    A.SalesDocument,
    @Consumption.hidden
    A.SalesDocumentItem,
    @Consumption.hidden 
    ServiceDocumentType,
    @Consumption.hidden 
    A._AccountingDocumentType,
    @Consumption.hidden 
    A.AccountingDocumentType,
    @Consumption.hidden 
    ProfitCenter,
    @Consumption.hidden 
    A._GLAccountInCompanyCode,
    @Consumption.hidden 
    A._Supplier,
    @Consumption.hidden 
    A.Supplier,
    @Consumption.hidden 
    A._Customer,
    @Consumption.hidden 
    A.Customer,
    @Consumption.hidden 
    A.ServiceDocument,
    //A.WBSElement

    A._CompanyCode.CompanyCodeName,
    A._Plant.PlantName,
    A._BusinessTransactionType._Text[1:Language = $session.system_language ].BusinessTransactionTypeName,
    A._Product._Text[1:Language = $session.system_language ].ProductName
  }
where
  A.GLBusinessTransactionType = 'TBCS' and
  A.JrnlEntryItemObsoleteReason = ' '
//group by

//  A.Ledger,

//  A.CompanyCode,

//  A.FiscalYear,

//  A.AccountingDocument,

//  A.LedgerGLLineItem,

//  A.BusinessTransactionType,

//  //  B.AccountingDocument,

//  //  B.LedgerGLLineItem,

//  //  B.AccountingDocument,

//  A.PostingDate,

//  A.FiscalPeriod,

//  A.Product,

//  A.Plant,

//  A.GLAccount,

//  //A.GLAccountName,

//  A.AmountInCompanyCodeCurrency,

//  A.CompanyCodeCurrency,

//  A.AmountInGlobalCurrency,

//  A.GlobalCurrency,

//  A.ReferenceDocument,

//  A.ReferenceDocumentItem,

//  A.ReferenceDocumentType,

//  A.BusinessTransactionType,

//  A.SubLedgerAcctLineItemType,

//  Original_Doc_Label.domvalue_l,

//  Split_Doc_Label.domvalue_l

//A.COGSSplitGLItemRole

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BUSINESSTRANSACTIONTYPE",
"I_BUSTRANSACTIONTYPETEXT",
"I_COGSSPLITGLITEMROLE",
"I_COGSSPLITGLITEMROLETEXT",
"I_COGSSPLITSOURCEACCOUNT",
"I_COMPANYCODE",
"I_GLACCOUNTLINEITEM",
"I_GLACCOUNTTEXTRAWDATA",
"I_LEDGER",
"I_PLANT",
"I_PRODUCT",
"I_PRODUCTTEXT"
],
"ASSOCIATED":
[
"C_COGSSPLITANDORIGINALITEM",
"I_ACCOUNTINGDOCUMENTTYPE",
"I_COGSSPLITGLITEMROLE",
"I_COSTCENTER",
"I_CUSTOMER",
"I_GLACCOUNTINCOMPANYCODE",
"I_GLACCOUNTTEXTRAWDATA",
"I_ORDER",
"I_PROFITCENTER",
"I_SALESDOCUMENT",
"I_SRVCDOCBYDOCUMENTTYPE",
"I_SUBLEDGERACCLINEITEMTYPE",
"I_SUPPLIER"
],
"BASE":
[
"I_GLACCOUNTLINEITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/