P_GLAcctBalWithComprnPeriod

DDL: P_GLACCTBALWITHCOMPRNPERIOD SQL: PGLACCTBALPERD Type: view COMPOSITE

P_GLAcctBalWithComprnPeriod is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (P_GLAcctBalance02, P_GLAcctBalance02, P_GLAcctBalance02) and exposes 152 fields with key fields Ledger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 17 associations to related views.

Data Sources (3)

SourceAliasJoin Type
P_GLAcctBalance02 P_GLAcctBalance02 from
P_GLAcctBalance02 P_GLAcctBalance02 union_all
P_GLAcctBalance02 P_GLAcctBalance02 union_all

Parameters (9)

NameTypeDefault
P_Ledger fis_rldnr
P_StartPostingDate fis_budat
P_EndPostingDate fis_budat
P_ComprnFromPostingDate fis_budat
P_ComprnToPostingDate fis_budat
P_ComparisonFromPostingDate2 fis_budat
P_ComparisonToPostingDate2 fis_budat
P_CurrencyRole fis_curtp
P_AlternativeGLAccountIsUsed char1

Associations (17)

CardinalityTargetAliasCondition
[0..1] I_FinancialStatementLeafItem _FinancialStatementLeafItem $projection.FinancialStatementLeafItem = _FinancialStatementLeafItem.FinancialStatementLeafItem
[1..1] I_Ledger _Ledger $projection.Ledger = _Ledger.Ledger
[1..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_FiscalYearForCompanyCode _FiscalYear $projection.FiscalYear = _FiscalYear.FiscalYear and $projection.CompanyCode = _FiscalYear.CompanyCode
[0..1] I_FiscalYearForCompanyCode _LedgerFiscalYear $projection.LedgerFiscalYear = _LedgerFiscalYear.FiscalYear and $projection.CompanyCode = _LedgerFiscalYear.CompanyCode
[0..1] I_ChartOfAccounts _ChartOfAccounts $projection.ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts
[0..1] I_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts $projection.ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts and $projection.GLAccount = _GLAccountInChartOfAccounts.GLAccount
[0..1] I_AccountingDocumentType _AccountingDocumentType $projection.AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType
[0..1] I_GLAccountInCompanyCode _GLAccountInCompanyCode $projection.CompanyCode = _GLAccountInCompanyCode.CompanyCode and $projection.GLAccount = _GLAccountInCompanyCode.GLAccount
[0..1] I_GLAccountInChartOfAccounts _GLAccountExternal $projection.ChartOfAccounts = _GLAccountExternal.ChartOfAccounts and $projection.GLAccountExternal = _GLAccountExternal.GLAccount
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea
[0..1] I_Segment _Segment $projection.Segment = _Segment.Segment
[0..*] I_ProfitCenter _ProfitCenter $projection.ControllingArea = _ProfitCenter.ControllingArea and $projection.ProfitCenter = _ProfitCenter.ProfitCenter
[0..1] I_FinancialTransactionType _FinancialTransactionType $projection.FinancialTransactionType = _FinancialTransactionType.FinancialTransactionType
[0..*] I_CostCenter _CostCenter $projection.ControllingArea = _CostCenter.ControllingArea and $projection.CostCenter = _CostCenter.CostCenter
[0..1] I_BusinessArea _BusinessArea $projection.BusinessArea = _BusinessArea.BusinessArea
[0..1] I_FunctionalArea _FunctionalArea $projection.FunctionalArea = _FunctionalArea.FunctionalArea

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PGLACCTBALPERD view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.compiler.compareFilter true view

Fields (152)

KeyFieldSource TableSource FieldDescription
KEY Ledger Ledger 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
FinancialStatementLeafItem
LedgerFiscalYear LedgerFiscalYear
ChartOfAccounts ChartOfAccounts Node Class
AccountingDocumentType AccountingDocumentType Journal Entry Type
GLAccount GLAccount General Ledger
CountryChartOfAccounts CountryChartOfAccounts Chart of Accts
AlternativeGLAccount AlternativeGLAccount Group Account
ControllingArea ControllingArea Controlling Area
CostCenter CostCenter Cost Center
ProfitCenter ProfitCenter Profit Center
FinancialTransactionType FinancialTransactionType Transact. Type
FunctionalArea FunctionalArea Sendr Fctl Area
BusinessArea BusinessArea Business Area
Segment Segment Segment number
DebitCreditCode DebitCreditCode Single-Character Flag
PostingDate PostingDate Posting Date for GR
FiscalPeriod FiscalPeriod Tax period
PartnerCompany PartnerCompany Trading Partner
WBSElement WBSElement WBS Internal ID
GLAccountType GLAccountType G/L Account Type
ReportingPeriod
PeriodFlag PeriodFlag
Currency Currency Valuation Crcy
DebitPeriodBalAmtInDspCrcy DebitPeriodBalAmtInDspCrcy
CreditPeriodBalAmtInDspCrcy CreditPeriodBalAmtInDspCrcy
PeriodBalAmtInDspCrcy
YearOpeningBalAmtInDspCrcy
OpeningPeriodBalAmtInDspCrcy
EndingPeriodBalAmtInDspCrcy
_FinancialStatementLeafItem _FinancialStatementLeafItem
_Ledger _Ledger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_LedgerFiscalYear _LedgerFiscalYear
_ChartOfAccounts _ChartOfAccounts
_AccountingDocumentType _AccountingDocumentType
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_GLAccountInCompanyCode _GLAccountInCompanyCode
_GLAccountExternal _GLAccountExternal
_ControllingArea _ControllingArea
_Segment _Segment
_ProfitCenter _ProfitCenter
_FinancialTransactionType _FinancialTransactionType
_CostCenter _CostCenter
_BusinessArea _BusinessArea
P_EndPostingDateP_ComprnToPostingDate
FunctionalAreakeyLedger
KEY CompanyCode CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocument AccountingDocument Journal Entry
KEY LedgerGLLineItem LedgerGLLineItem Journal Entry Item
FinancialStatementLeafItem
LedgerFiscalYear LedgerFiscalYear
ChartOfAccounts ChartOfAccounts Node Class
AccountingDocumentType AccountingDocumentType Journal Entry Type
GLAccount GLAccount General Ledger
CountryChartOfAccounts CountryChartOfAccounts Chart of Accts
AlternativeGLAccount AlternativeGLAccount Group Account
ControllingArea ControllingArea Controlling Area
CostCenter CostCenter Cost Center
ProfitCenter ProfitCenter Profit Center
FinancialTransactionType FinancialTransactionType Transact. Type
FunctionalArea FunctionalArea Sendr Fctl Area
BusinessArea BusinessArea Business Area
Segment Segment Segment number
DebitCreditCode DebitCreditCode Single-Character Flag
PostingDate PostingDate Posting Date for GR
FiscalPeriod FiscalPeriod Tax period
PartnerCompany PartnerCompany Trading Partner
WBSElement WBSElement WBS Internal ID
GLAccountType GLAccountType G/L Account Type
ReportingPeriod
PeriodFlag PeriodFlag
Currency Currency Valuation Crcy
DebitPeriodBalAmtInDspCrcy DebitPeriodBalAmtInDspCrcy
CreditPeriodBalAmtInDspCrcy CreditPeriodBalAmtInDspCrcy
PeriodBalAmtInDspCrcy
YearOpeningBalAmtInDspCrcy
OpeningPeriodBalAmtInDspCrcy
EndingPeriodBalAmtInDspCrcy
_FinancialStatementLeafItem _FinancialStatementLeafItem
_Ledger _Ledger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_LedgerFiscalYear _LedgerFiscalYear
_ChartOfAccounts _ChartOfAccounts
_AccountingDocumentType _AccountingDocumentType
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_GLAccountInCompanyCode _GLAccountInCompanyCode
_GLAccountExternal _GLAccountExternal
_ControllingArea _ControllingArea
_Segment _Segment
_ProfitCenter _ProfitCenter
_FinancialTransactionType _FinancialTransactionType
_CostCenter _CostCenter
_BusinessArea _BusinessArea
FunctionalAreakeyLedger
KEY CompanyCode CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocument AccountingDocument Journal Entry
KEY LedgerGLLineItem LedgerGLLineItem Journal Entry Item
FinancialStatementLeafItem
LedgerFiscalYear LedgerFiscalYear
ChartOfAccounts ChartOfAccounts Node Class
AccountingDocumentType AccountingDocumentType Journal Entry Type
GLAccount GLAccount General Ledger
CountryChartOfAccounts CountryChartOfAccounts Chart of Accts
AlternativeGLAccount AlternativeGLAccount Group Account
ControllingArea ControllingArea Controlling Area
CostCenter CostCenter Cost Center
ProfitCenter ProfitCenter Profit Center
FinancialTransactionType FinancialTransactionType Transact. Type
FunctionalArea FunctionalArea Sendr Fctl Area
BusinessArea BusinessArea Business Area
Segment Segment Segment number
DebitCreditCode DebitCreditCode Single-Character Flag
PostingDate PostingDate Posting Date for GR
FiscalPeriod FiscalPeriod Tax period
PartnerCompany PartnerCompany Trading Partner
WBSElement WBSElement WBS Internal ID
GLAccountType GLAccountType G/L Account Type
ReportingPeriod
PeriodFlag PeriodFlag
Currency Currency Valuation Crcy
DebitPeriodBalAmtInDspCrcy DebitPeriodBalAmtInDspCrcy
CreditPeriodBalAmtInDspCrcy CreditPeriodBalAmtInDspCrcy
PeriodBalAmtInDspCrcy
YearOpeningBalAmtInDspCrcy
OpeningPeriodBalAmtInDspCrcy
EndingPeriodBalAmtInDspCrcy
_FinancialStatementLeafItem _FinancialStatementLeafItem
_Ledger _Ledger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_LedgerFiscalYear _LedgerFiscalYear
_ChartOfAccounts _ChartOfAccounts
_AccountingDocumentType _AccountingDocumentType
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_GLAccountInCompanyCode _GLAccountInCompanyCode
_GLAccountExternal _GLAccountExternal
_ControllingArea _ControllingArea
_Segment _Segment
_ProfitCenter _ProfitCenter
_FinancialTransactionType _FinancialTransactionType
_CostCenter _CostCenter
_BusinessArea _BusinessArea
_FunctionalArea _FunctionalArea

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_GLAcctBalWithComprnPeriod.
-- 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: PGLACCTBALPERD
-- Parameters: P_Ledger : fis_rldnr, P_StartPostingDate : fis_budat, P_EndPostingDate : fis_budat, P_ComprnFromPostingDate : fis_budat, P_ComprnToPostingDate : fis_budat, P_ComparisonFromPostingDate2 : fis_budat, P_ComparisonToPostingDate2 : fis_budat, P_CurrencyRole : fis_curtp, P_AlternativeGLAccountIsUsed : char1

CREATE VIEW P_GLAcctBalWithComprnPeriod AS
SELECT
  Ledger,
  CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  '' AS FinancialStatementLeafItem,
  LedgerFiscalYear,
  ChartOfAccounts,
  AccountingDocumentType,
  GLAccount,
  CountryChartOfAccounts,
  AlternativeGLAccount,
  ControllingArea,
  CostCenter,
  ProfitCenter,
  FinancialTransactionType,
  FunctionalArea,
  BusinessArea,
  Segment,
  DebitCreditCode,
  PostingDate,
  FiscalPeriod,
  PartnerCompany,
  WBSElement,
  GLAccountType,
  '0' AS ReportingPeriod,
  PeriodFlag,
  Currency,
  DebitPeriodBalAmtInDspCrcy,
  CreditPeriodBalAmtInDspCrcy,
  (DebitPeriodBalAmtInDspCrcy + CreditPeriodBalAmtInDspCrcy) AS PeriodBalAmtInDspCrcy,
  (DebitYearOpenBalAmtInDspCrcy + CreditYearOpenBalAmtInDspCrcy) AS YearOpeningBalAmtInDspCrcy,
  (DebitOpenPerdBalAmtInDspCrcy + CreditOpenPerdBalAmtInDspCrcy) AS OpeningPeriodBalAmtInDspCrcy,
  (DebitEndPerdBalAmtInDspCrcy + CreditEndPerdBalAmtInDspCrcy) AS EndingPeriodBalAmtInDspCrcy,
  P_EndPostingDate : :P_ComprnToPostingDate AS P_EndPostingDateP_ComprnToPostingDate
FROM P_GLAcctBalance02
LEFT OUTER JOIN I_FinancialStatementLeafItem AS _FinancialStatementLeafItem ON FinancialStatementLeafItem = _FinancialStatementLeafItem.FinancialStatementLeafItem  -- association [0..1]
LEFT OUTER JOIN I_Ledger AS _Ledger ON Ledger = _Ledger.Ledger  -- association [1..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [1..1]
LEFT OUTER JOIN I_FiscalYearForCompanyCode AS _FiscalYear ON FiscalYear = _FiscalYear.FiscalYear AND CompanyCode = _FiscalYear.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_FiscalYearForCompanyCode AS _LedgerFiscalYear ON LedgerFiscalYear = _LedgerFiscalYear.FiscalYear AND CompanyCode = _LedgerFiscalYear.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_ChartOfAccounts AS _ChartOfAccounts ON ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts  -- 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_AccountingDocumentType AS _AccountingDocumentType ON AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType  -- association [0..1]
LEFT OUTER JOIN I_GLAccountInCompanyCode AS _GLAccountInCompanyCode ON CompanyCode = _GLAccountInCompanyCode.CompanyCode AND GLAccount = _GLAccountInCompanyCode.GLAccount  -- association [0..1]
LEFT OUTER JOIN I_GLAccountInChartOfAccounts AS _GLAccountExternal ON ChartOfAccounts = _GLAccountExternal.ChartOfAccounts AND GLAccountExternal = _GLAccountExternal.GLAccount  -- association [0..1]
LEFT OUTER JOIN I_ControllingArea AS _ControllingArea ON ControllingArea = _ControllingArea.ControllingArea  -- association [0..1]
LEFT OUTER JOIN I_Segment AS _Segment ON Segment = _Segment.Segment  -- association [0..1]
LEFT OUTER JOIN I_ProfitCenter AS _ProfitCenter ON ControllingArea = _ProfitCenter.ControllingArea AND ProfitCenter = _ProfitCenter.ProfitCenter  -- association [0..*]
LEFT OUTER JOIN I_FinancialTransactionType AS _FinancialTransactionType ON FinancialTransactionType = _FinancialTransactionType.FinancialTransactionType  -- association [0..1]
LEFT OUTER JOIN I_CostCenter AS _CostCenter ON ControllingArea = _CostCenter.ControllingArea AND CostCenter = _CostCenter.CostCenter  -- association [0..*]
LEFT OUTER JOIN I_BusinessArea AS _BusinessArea ON BusinessArea = _BusinessArea.BusinessArea  -- association [0..1]
LEFT OUTER JOIN I_FunctionalArea AS _FunctionalArea ON FunctionalArea = _FunctionalArea.FunctionalArea  -- association [0..1]
-- UNION ALL with additional select branch(es): P_GLAcctBalance02
;