P_MX_GLAcctWithJournalEntry
P_MX_GLAcctWithJournalEntry is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemRawData) and exposes 15 fields with key fields HierarchyNodeUniqueID, FinancialStatementVariant, ChartOfAccounts, CompanyCode, AccountingDocument. It has 3 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_GLAccountLineItemRawData | JournalEntryItem | inner |
Parameters (4)
| Name | Type | Default |
|---|---|---|
| P_FromPostingDate | fis_budat_from | |
| P_ToPostingDate | fis_budat_to | |
| P_AlternativeGLAccount | figlmx_prim | |
| P_FiscalYear | fis_gjahr |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_JournalEntry | _JournalEntry | $projection.CompanyCode = _JournalEntry.CompanyCode and $projection.FiscalYear = _JournalEntry.FiscalYear and $projection.AccountingDocument = _JournalEntry.AccountingDocument |
| [0..1] | I_FiscalYearForCompanyCode | _FiscalYear | $projection.FiscalYear = _FiscalYear.FiscalYear and $projection.CompanyCode = _FiscalYear.CompanyCode |
| [1..1] | I_Ledger | _Ledger | $projection.Ledger = _Ledger.Ledger |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMXGLACCTJRNL | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #P | view |
Fields (15)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | HierarchyNodeUniqueID | FSV | HierarchyNodeUniqueID | |
| KEY | FinancialStatementVariant | FSV | FinancialStatementVariant | |
| KEY | ChartOfAccounts | FSV | ChartOfAccounts | |
| KEY | CompanyCode | FSV | CompanyCode | |
| KEY | AccountingDocument | I_GLAccountLineItemRawData | AccountingDocument | |
| KEY | FiscalYear | |||
| KEY | Ledger | I_GLAccountLineItemRawData | SourceLedger | |
| KEY | GLAccount | FSV | GLAccount | |
| OperationalGLAccount | FSV | OperationalGLAccount | ||
| OperationalChartOfAccounts | FSV | OperationalChartOfAccounts | ||
| JrnlEntryItemMigrationSource | I_GLAccountLineItemRawData | JrnlEntryItemMigrationSource | ||
| _GLAccountInChartOfAccounts | FSV | _GLAccountInChartOfAccounts | ||
| _JournalEntry | _JournalEntry | |||
| _FiscalYear | _FiscalYear | |||
| _Ledger | _Ledger |
@AbapCatalog.sqlViewName: 'PMXGLACCTJRNL'
@VDM.viewType: #COMPOSITE
@VDM.private: true
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #P
define view P_MX_GLAcctWithJournalEntry
with parameters
@EndUserText.label: 'From Posting Date'
P_FromPostingDate : fis_budat_from,
@EndUserText.label: 'To Posting Date'
P_ToPostingDate : fis_budat_to,
@EndUserText.label: 'Alternative Account'
P_AlternativeGLAccount : figlmx_prim,
@EndUserText.label: 'Fiscal Year'
P_FiscalYear : fis_gjahr
as select distinct from P_MX_FinancialStmntStructure3( P_AlternativeGLAccount: $parameters.P_AlternativeGLAccount ) as FSV
inner join I_GLAccountLineItemRawData as JournalEntryItem on JournalEntryItem.CompanyCode = FSV.CompanyCode
and JournalEntryItem.ChartOfAccounts = FSV.ChartOfAccounts
and JournalEntryItem.GLAccount = FSV.OperationalGLAccount
and JournalEntryItem.PostingDate >= $parameters.P_FromPostingDate
and JournalEntryItem.PostingDate <= $parameters.P_ToPostingDate
and JournalEntryItem.AccountingDocumentCategory <> 'C'
association [1..1] to I_JournalEntry as _JournalEntry on $projection.CompanyCode = _JournalEntry.CompanyCode
and $projection.FiscalYear = _JournalEntry.FiscalYear
and $projection.AccountingDocument = _JournalEntry.AccountingDocument
association [0..1] to I_FiscalYearForCompanyCode as _FiscalYear on $projection.FiscalYear = _FiscalYear.FiscalYear
and $projection.CompanyCode = _FiscalYear.CompanyCode
association [1..1] to I_Ledger as _Ledger on $projection.Ledger = _Ledger.Ledger
{
key FSV.HierarchyNodeUniqueID as HierarchyNodeUniqueID,
key FSV.FinancialStatementVariant as FinancialStatementVariant,
key FSV.ChartOfAccounts as ChartOfAccounts,
key FSV.CompanyCode as CompanyCode,
key JournalEntryItem.AccountingDocument as AccountingDocument,
key cast( JournalEntryItem.FiscalYear as fis_gjahr_no_conv preserving type ) as FiscalYear,
key JournalEntryItem.SourceLedger as Ledger,
key FSV.GLAccount as GLAccount,
FSV.OperationalGLAccount as OperationalGLAccount,
FSV.OperationalChartOfAccounts as OperationalChartOfAccounts,
JournalEntryItem.JrnlEntryItemMigrationSource as JrnlEntryItemMigrationSource,
FSV._GLAccountInChartOfAccounts as _GLAccountInChartOfAccounts,
_JournalEntry,
_FiscalYear,
_Ledger
}
where
// take only GL accounts from FSV that are valid within the selected period
FSV.ValidityEndDate >= $parameters.P_FromPostingDate
and FSV.ValidityStartDate <= $parameters.P_ToPostingDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GLACCOUNTLINEITEMRAWDATA",
"P_MX_FINANCIALSTMNTSTRUCTURE3"
],
"ASSOCIATED":
[
"I_FISCALYEARFORCOMPANYCODE",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_JOURNALENTRY",
"I_LEDGER"
],
"BASE":
[
"P_MX_FINANCIALSTMNTSTRUCTURE3"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA