P_CL_JournalEntryItemDocAmount
P_CL_JournalEntryItemDocAmount is a Consumption CDS View in SAP S/4HANA. It reads from 3 data sources (I_JournalEntry, I_JournalEntryItem, I_StRpJournalEntryLog) and exposes 13 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem, Ledger. It has 1 association to related views.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntry | I_JournalEntry | from |
| I_JournalEntryItem | I_JournalEntryItem | inner |
| I_StRpJournalEntryLog | I_StRpJournalEntryLog | inner |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_ReportingCurrency | glo_reporting_currency |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Currency | _ReportingCurrency | Currency = ReportingCurrency |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PCLJEITMDOCAMT | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.private | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (13)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_JournalEntry | CompanyCode | |
| KEY | FiscalYear | I_JournalEntry | FiscalYear | |
| KEY | AccountingDocument | I_JournalEntry | AccountingDocument | |
| KEY | LedgerGLLineItem | LedgerGLLineItem | ||
| KEY | Ledger | I_JournalEntryItem | Ledger | |
| KEY | StatryRptgEntity | StatryRptgEntity | ||
| KEY | StatryRptCategory | StatryRptCategory | ||
| KEY | StatryRptRunID | StatryRptRunID | ||
| CL_ReportingDocumentType | CL_ReportingDocumentType | |||
| PostingDate | I_JournalEntry | PostingDate | ||
| AccountingDocumentHeaderText | I_JournalEntry | AccountingDocumentHeaderText | ||
| ReportingCurrency | ||||
| _ReportingCurrency | _ReportingCurrency |
@AbapCatalog.sqlViewName: 'PCLJEITMDOCAMT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_CL_JournalEntryItemDocAmount
with parameters
P_ReportingCurrency : glo_reporting_currency
as select from I_JournalEntry
inner join I_JournalEntryItem on I_JournalEntry.CompanyCode = I_JournalEntryItem.CompanyCode
and I_JournalEntry.FiscalYear = I_JournalEntryItem.FiscalYear
and I_JournalEntry.AccountingDocument = I_JournalEntryItem.AccountingDocument
inner join I_StRpJournalEntryLog on I_JournalEntry.CompanyCode = I_StRpJournalEntryLog.CompanyCode
and I_JournalEntry.AccountingDocument = I_StRpJournalEntryLog.AccountingDocument
and I_JournalEntry.FiscalYear = I_StRpJournalEntryLog.FiscalYear
left outer to one join I_CL_DocTypeVchrTypeAssgmt on I_CL_DocTypeVchrTypeAssgmt.Country = 'CL'
and I_JournalEntry.CompanyCode = I_CL_DocTypeVchrTypeAssgmt.CompanyCode
and I_JournalEntry.AccountingDocumentType = I_CL_DocTypeVchrTypeAssgmt.AccountingDocumentType
association [0..1] to I_Currency as _ReportingCurrency on Currency = ReportingCurrency
{
key I_JournalEntry.CompanyCode,
key I_JournalEntry.FiscalYear,
key I_JournalEntry.AccountingDocument,
key LedgerGLLineItem,
key I_JournalEntryItem.Ledger,
key StatryRptgEntity,
key StatryRptCategory,
key StatryRptRunID,
CL_ReportingDocumentType,
I_JournalEntry.PostingDate,
I_JournalEntry.AccountingDocumentHeaderText,
@ObjectModel.foreignKey.association: '_ReportingCurrency'
@Semantics.currencyCode:true
cast( $parameters.P_ReportingCurrency as glo_reporting_currency preserving type ) as ReportingCurrency,
@DefaultAggregation: #SUM
@Semantics.amount.currencyCode: 'ReportingCurrency'
cast( case $parameters.P_ReportingCurrency
when I_JournalEntryItem.CompanyCodeCurrency
then DebitAmountInCoCodeCrcy
when I_JournalEntryItem.TransactionCurrency
then DebitAmountInTransCrcy
when GlobalCurrency
then DebitAmountInGlobalCrcy
when BalanceTransactionCurrency
then DebitAmountInBalanceTransCrcy
when FreeDefinedCurrency1
then DebitAmountInFreeDefinedCrcy1
when FreeDefinedCurrency2
then DebitAmountInFreeDefinedCrcy2
when FreeDefinedCurrency3
then DebitAmountInFreeDefinedCrcy3
when FreeDefinedCurrency4
then DebitAmountInFreeDefinedCrcy4
when FreeDefinedCurrency5
then DebitAmountInFreeDefinedCrcy5
when FreeDefinedCurrency6
then DebitAmountInFreeDefinedCrcy6
when FreeDefinedCurrency7
then DebitAmountInFreeDefinedCrcy7
when FreeDefinedCurrency8
then DebitAmountInFreeDefinedCrcy8
else
0
end
as glo_debit_amount_rptg_crcy preserving type ) as DebitAmountInReportingCurrency,
_ReportingCurrency
}
where I_JournalEntry.AccountingDocumentCategory = ' '
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CL_DOCTYPEVCHRTYPEASSGMT",
"I_JOURNALENTRY",
"I_JOURNALENTRYITEM",
"I_STRPJOURNALENTRYLOG"
],
"ASSOCIATED":
[
"I_CURRENCY"
],
"BASE":
[],
"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