P_TR_StRpElectronicLedgerHdr
P_TR_StRpElectronicLedgerHdr is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_StRpJournalEntryLog) and exposes 21 fields with key fields CompanyCode, AccountingDocument, FiscalYear, StatryRptCategory, StatryRptgEntity. It has 1 association to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_StRpJournalEntryLog | _ReportedItemsLog | inner |
Parameters (9)
| Name | Type | Default |
|---|---|---|
| P_CompanyCode | bukrs | |
| P_FromPostingDate | fis_budat_from | |
| P_ToPostingDate | fis_budat_to | |
| P_Ledger | fins_ledger | |
| P_Language | lang | |
| P_CountryChartOfAccounts | abap_boolean | |
| P_StatryRptgEntity | srf_reporting_entity | |
| P_StatryRptCategory | srf_rep_cat_id | |
| P_StatryRptRunID | srf_report_run_id |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Currency | _ReportingCurrency | $projection.CompanyCodeCurrency = _ReportingCurrency.Currency |
Annotations (13)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PTRELDGRHDR | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| AccessControl.blocking | #BLOCKED_DATA_INCLUDED | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | P_TR_StRpElectronicLedger | CompanyCode | |
| KEY | AccountingDocument | P_TR_StRpElectronicLedger | AccountingDocument | |
| KEY | FiscalYear | P_TR_StRpElectronicLedger | FiscalYear | |
| KEY | StatryRptCategory | I_StRpJournalEntryLog | StatryRptCategory | |
| KEY | StatryRptgEntity | I_StRpJournalEntryLog | StatryRptgEntity | |
| KEY | StatryRptRunID | I_StRpJournalEntryLog | StatryRptRunID | |
| PostingDateAsText | P_TR_StRpElectronicLedger | PostingDate | ||
| AmountInCompanyCodeCurrency | ||||
| TR_MonetaryAmtInCoCodeCrcy | ||||
| CompanyCodeCurrency | P_TR_StRpElectronicLedger | CompanyCodeCurrency | ||
| AccountingDocCreatedByUser | P_TR_StRpElectronicLedger | AccountingDocCreatedByUser | ||
| AccountingDocumentHeaderText | P_TR_StRpElectronicLedger | AccountingDocumentHeaderText | ||
| TR_EDocHeaderAndRefDocIDText | P_TR_StRpElectronicLedger | TR_EDocHeaderAndRefDocIDText | ||
| DocumentHeaderSeqNumber | P_TR_StRpElectronicLedger | DocumentHeaderSeqNumber | ||
| DocumentDateAsText | P_TR_StRpElectronicLedger | DocumentDate | ||
| DocumentReferenceID | P_TR_StRpElectronicLedger | DocumentReferenceID | ||
| TR_ElectronicLedgerDocType | P_TR_StRpElectronicLedger | TR_ElectronicLedgerDocType | ||
| TR_ElectronicLedgerExtDocName | P_TR_StRpElectronicLedger | TR_ElectronicLedgerExtDocName | ||
| AccountingDocumentType | P_TR_StRpElectronicLedger | AccountingDocumentType | ||
| PostingPeriod | P_TR_StRpElectronicLedger | PostingPeriod | ||
| _ReportingCurrency | _ReportingCurrency |
@AbapCatalog.sqlViewName: 'PTRELDGRHDR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #COMPOSITE
@VDM.private: true
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.blocking:#BLOCKED_DATA_INCLUDED
define view P_TR_StRpElectronicLedgerHdr
with parameters
P_CompanyCode : bukrs,
P_FromPostingDate : fis_budat_from,
P_ToPostingDate : fis_budat_to,
P_Ledger : fins_ledger,
P_Language : lang,
P_CountryChartOfAccounts : abap_boolean,
P_StatryRptgEntity : srf_reporting_entity,
P_StatryRptCategory : srf_rep_cat_id,
P_StatryRptRunID : srf_report_run_id
as select distinct from P_TR_StRpElectronicLedger( P_SAPClient:$session.client,
P_CompanyCode:$parameters.P_CompanyCode,
P_FromPostingDate:$parameters.P_FromPostingDate,
P_ToPostingDate: $parameters.P_ToPostingDate,
P_ledger:$parameters.P_Ledger,
P_Language:$parameters.P_Language,
P_CountryChartOfAccounts:$parameters.P_CountryChartOfAccounts )
inner join I_StRpJournalEntryLog as _ReportedItemsLog on _ReportedItemsLog.CompanyCode = P_TR_StRpElectronicLedger.CompanyCode
and _ReportedItemsLog.AccountingDocument = P_TR_StRpElectronicLedger.AccountingDocument
and _ReportedItemsLog.FiscalYear = P_TR_StRpElectronicLedger.FiscalYear
and _ReportedItemsLog.StatryRptCategory = $parameters.P_StatryRptCategory
and _ReportedItemsLog.StatryRptgEntity = $parameters.P_StatryRptgEntity
and _ReportedItemsLog.StatryRptRunID = $parameters.P_StatryRptRunID
association [0..1] to I_Currency as _ReportingCurrency on $projection.CompanyCodeCurrency = _ReportingCurrency.Currency
{
key P_TR_StRpElectronicLedger.CompanyCode,
key P_TR_StRpElectronicLedger.AccountingDocument,
key P_TR_StRpElectronicLedger.FiscalYear,
key _ReportedItemsLog.StatryRptCategory,
key _ReportedItemsLog.StatryRptgEntity,
key _ReportedItemsLog.StatryRptRunID,
P_TR_StRpElectronicLedger.PostingDate as PostingDateAsText,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
sum(P_TR_StRpElectronicLedger.AmountInCompanyCodeCurrency) as AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
sum(P_TR_StRpElectronicLedger.TR_MonetaryAmtInCoCodeCrcy) as TR_MonetaryAmtInCoCodeCrcy,
@Semantics.currencyCode: true
P_TR_StRpElectronicLedger.CompanyCodeCurrency,
P_TR_StRpElectronicLedger.AccountingDocCreatedByUser,
cast(case
when P_TR_StRpElectronicLedger.DebitCreditCode = 'S'
then 'D'
else 'C'
end as shkzg) as DebitCreditCode,
P_TR_StRpElectronicLedger.AccountingDocumentHeaderText,
P_TR_StRpElectronicLedger.TR_EDocHeaderAndRefDocIDText ,
P_TR_StRpElectronicLedger.DocumentHeaderSeqNumber,
P_TR_StRpElectronicLedger.DocumentDate as DocumentDateAsText,
P_TR_StRpElectronicLedger.DocumentReferenceID,
P_TR_StRpElectronicLedger.TR_ElectronicLedgerDocType,
P_TR_StRpElectronicLedger.TR_ElectronicLedgerExtDocName,
P_TR_StRpElectronicLedger.AccountingDocumentType,
P_TR_StRpElectronicLedger.PostingPeriod,
_ReportingCurrency as _ReportingCurrency
}
group by
P_TR_StRpElectronicLedger.CompanyCode,
P_TR_StRpElectronicLedger.AccountingDocument,
P_TR_StRpElectronicLedger.FiscalYear,
_ReportedItemsLog.StatryRptCategory,
_ReportedItemsLog.StatryRptgEntity,
_ReportedItemsLog.StatryRptRunID,
P_TR_StRpElectronicLedger.PostingDate,
P_TR_StRpElectronicLedger.DebitCreditCode,
P_TR_StRpElectronicLedger.CompanyCodeCurrency,
P_TR_StRpElectronicLedger.AccountingDocCreatedByUser,
P_TR_StRpElectronicLedger.AccountingDocumentHeaderText,
P_TR_StRpElectronicLedger.TR_EDocHeaderAndRefDocIDText ,
P_TR_StRpElectronicLedger.DocumentHeaderSeqNumber,
P_TR_StRpElectronicLedger.DocumentDate,
P_TR_StRpElectronicLedger.DocumentReferenceID,
P_TR_StRpElectronicLedger.TR_ElectronicLedgerDocType,
P_TR_StRpElectronicLedger.TR_ElectronicLedgerExtDocName,
P_TR_StRpElectronicLedger.AccountingDocumentType,
P_TR_StRpElectronicLedger.PostingPeriod;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"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