P_GLAccountInCOAHierarchy

DDL: P_GLACCOUNTINCOAHIERARCHY Type: view_entity COMPOSITE Package: RAP_FI_GL_COA

GL Account in Chart of Accounts Hierarchy

P_GLAccountInCOAHierarchy is a Composite CDS View that provides data about "GL Account in Chart of Accounts Hierarchy" in SAP S/4HANA. It reads from 2 data sources (I_FinancialStatementHier, I_FinancialStatementHierNode) and exposes 34 fields with key fields FinancialStatementHierarchy, ChartOfAccounts, HierarchyNodeendasHierarchyNodeUniqueID, ValidityEndDate, HierarchyNode. It has 5 associations to related views. Part of development package RAP_FI_GL_COA.

Data Sources (2)

SourceAliasJoin Type
I_FinancialStatementHier h from
I_FinancialStatementHierNode n inner

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_FinancialStatementHierNode _FinancialStatementItem $projection.FinancialStatementHierarchy = _FinancialStatementItem.FinancialStatementHierarchy and $projection.HierarchyNode = _FinancialStatementItem.HierarchyNode and _FinancialStatementItem.ValidityEndDate = '99991231'
[0..1] I_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts $projection.ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts and $projection.GLAccount = _GLAccountInChartOfAccounts.GLAccount
[0..1] I_FunctionalArea _FunctionalArea $projection.FunctionalArea = _FunctionalArea.FunctionalArea
[0..1] I_ChartOfAccounts _ChartOfAccounts $projection.ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts
[0..1] I_FinancialStatementHier _FinancialStatementHier $projection.FinancialStatementHierarchy = _FinancialStatementHier.FinancialStatementHierarchy and _FinancialStatementHier.ValidityEndDate = '99991231'

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.usageType.sizeCategory #M view
VDM.private true view
VDM.viewType #COMPOSITE view
Metadata.ignorePropagatedAnnotations true view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY FinancialStatementHierarchy I_FinancialStatementHier FinancialStatementHierarchy Hierarchy ID
KEY ChartOfAccounts
KEY HierarchyNodeendasHierarchyNodeUniqueID
KEY ValidityEndDate I_FinancialStatementHier ValidityEndDate ValidTo
KEY HierarchyNode I_FinancialStatementHierNode HierarchyNode Node
KEY ParentNodeUniqueID I_FinancialStatementHierNode ParentNode Parent Node
FinancialStatementItem I_FinancialStatementHierNode HierarchyNode Node
FinStatementHierarchyLevelVal
GLAccountelseendasGLAccount
FinancialStatementNodeType I_FinancialStatementHierNode FinancialStatementNodeType
HierarchyNodeValendasHierarchyNodeVal
ValidityStartDate I_FinancialStatementHier ValidityStartDate Validity Start Date
CorporateGroupAccount c CorporateGroupAccount Group Account Number
CorporateGroupAccountName corp_gl_text GLAccountName Short Text
GLAccountType c GLAccountType G/L Account Type
GLAccountGroup c GLAccountGroup Account Group
GLAccountName gl_text GLAccountName Short Text
GLAccountLongName gl_text GLAccountLongName Long Text
AccountIsMarkedForDeletion c AccountIsMarkedForDeletion Deletion Flag
GLAccountExternal c GLAccountExternal G/L Acct External ID
GLAccountSubtype c GLAccountSubtype G/L Account Subtype
BankReconciliationAccount c BankReconciliationAccount Reconciliation Acct
ProfitLossAccountType c ProfitLossAccountType Profit Loss Account Type
NodeType I_FinancialStatementHierNode FinancialStatementNodeType
HierarchyLevel I_FinancialStatementHierNode HierarchyLevel Hierarchy Level
SiblingNode I_FinancialStatementHierNode HierarchyNodeSequence
DebitCreditCode I_FinancialStatementHierNode DebitCreditCode Single-Character Flag
GLAcctCOAImplementStatus
_HierText I_FinancialStatementHier _Text
_FinancialStatementItem _FinancialStatementItem
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_FunctionalArea _FunctionalArea
_ChartOfAccounts _ChartOfAccounts
_FinancialStatementHier _FinancialStatementHier

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 P_GLAccountInCOAHierarchy.
-- 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 P_GLAccountInCOAHierarchy AS
SELECT
  h.FinancialStatementHierarchy AS FinancialStatementHierarchy,
  cast(h.ChartOfAccounts as fis_ktopl) AS ChartOfAccounts,
  case n.FinancialStatementNodeType when 'G' then cast( concat( n.ParentNode, n.HierarchyNode ) as uhnid ) else n.HierarchyNode end as HierarchyNodeUniqueID AS HierarchyNodeendasHierarchyNodeUniqueID,
  h.ValidityEndDate AS ValidityEndDate,
  n.HierarchyNode AS HierarchyNode,
  n.ParentNode AS ParentNodeUniqueID,
  n.HierarchyNode AS FinancialStatementItem,
  cast(n.HierarchyLevel as abap.int8 ) AS FinStatementHierarchyLevelVal,
  case n.FinancialStatementNodeType when 'G' then c.GLAccount else '' end as GLAccount AS GLAccountelseendasGLAccount,
  n.FinancialStatementNodeType AS FinancialStatementNodeType,
  case n.HierarchyNodeVal when '0ASSETS' then case when h.FinancialStatementAssetsItem is not null then h.FinancialStatementAssetsItem else 'ASSETS' end when '0LIABILITS' then case when h.FinStatementLiabilitiesItem is not null then h.FinStatementLiabilitiesItem else 'LIABILITS' end when '0BSLOSS' then case when h.FinancialStatementNetLossItem is not null then h.FinancialStatementNetLossItem else 'BSLOSS' end when '0BSPROFIT' then case when h.FinStatementNetProfitItem is not null then h.FinStatementNetProfitItem else 'BSPROFIT' end when '0PLPROFIT' then case when h.FinStatementProfitAndLossItem is not null then h.FinStatementProfitAndLossItem else 'PLPROFIT' end when '0BSNOTES' then case when h.FinancialStatementNotesItem is not null then h.FinancialStatementNotesItem else 'BSNOTES' end when '0NOTASSGND' then case when h.FinancialStatementOrphansItem is not null then h.FinancialStatementOrphansItem else 'NOTASSGND' end else n.HierarchyNodeVal end as HierarchyNodeVal AS HierarchyNodeValendasHierarchyNodeVal,
  h.ValidityStartDate AS ValidityStartDate,
  c.CorporateGroupAccount AS CorporateGroupAccount,
  corp_gl_text.GLAccountName AS CorporateGroupAccountName,
  c.GLAccountType AS GLAccountType,
  c.GLAccountGroup AS GLAccountGroup,
  gl_text.GLAccountName AS GLAccountName,
  gl_text.GLAccountLongName AS GLAccountLongName,
  c.AccountIsMarkedForDeletion AS AccountIsMarkedForDeletion,
  c.GLAccountExternal AS GLAccountExternal,
  c.GLAccountSubtype AS GLAccountSubtype,
  c.BankReconciliationAccount AS BankReconciliationAccount,
  c.ProfitLossAccountType AS ProfitLossAccountType,
  n.FinancialStatementNodeType AS NodeType,
  n.HierarchyLevel AS HierarchyLevel,
  n.HierarchyNodeSequence AS SiblingNode,
  n.DebitCreditCode AS DebitCreditCode,
  c._GLAcctInChartOfAcctsStatus.GLAcctCOAImplementStatus AS GLAcctCOAImplementStatus,
  h._Text AS _HierText
FROM I_FinancialStatementHier AS h
INNER JOIN I_FinancialStatementHierNode AS n ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_FinancialStatementHierNode AS _FinancialStatementItem ON FinancialStatementHierarchy = _FinancialStatementItem.FinancialStatementHierarchy AND HierarchyNode = _FinancialStatementItem.HierarchyNode AND _FinancialStatementItem.ValidityEndDate = '99991231'  -- association [0..1]
LEFT OUTER JOIN I_GLAccountInChartOfAccounts AS _GLAccountInChartOfAccounts ON ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts AND GLAccount = _GLAccountInChartOfAccounts.GLAccount  -- association [0..1]
LEFT OUTER JOIN I_FunctionalArea AS _FunctionalArea ON FunctionalArea = _FunctionalArea.FunctionalArea  -- association [0..1]
LEFT OUTER JOIN I_ChartOfAccounts AS _ChartOfAccounts ON ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts  -- association [0..1]
LEFT OUTER JOIN I_FinancialStatementHier AS _FinancialStatementHier ON FinancialStatementHierarchy = _FinancialStatementHier.FinancialStatementHierarchy AND _FinancialStatementHier.ValidityEndDate = '99991231'  -- association [0..1]
;