C_PT_SAFTGenLedgerHeaderC
General Ledger Document Header - Cube
C_PT_SAFTGenLedgerHeaderC is a Consumption CDS View (Cube) that provides data about "General Ledger Document Header - Cube" in SAP S/4HANA. It reads from 3 data sources (I_JournalEntry, I_PT_SAFTGenericSettings, P_SAFTJournalEntryLedger) and exposes 15 fields with key fields CompanyCode, FiscalYear, AccountingDocument, Ledger.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_JournalEntry | Doc | from |
| I_PT_SAFTGenericSettings | GenSet | inner |
| P_SAFTJournalEntryLedger | Val | inner |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #CONSUMPTION | view | |
| Analytics.internalName | #LOCAL | view | |
| Metadata.allowExtensions | true | view | |
| Analytics.dataCategory | #CUBE | view | |
| EndUserText.label | General Ledger Document Header - Cube | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (15)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_JournalEntry | CompanyCode | |
| KEY | FiscalYear | I_JournalEntry | FiscalYear | |
| KEY | AccountingDocument | I_JournalEntry | AccountingDocument | |
| KEY | Ledger | |||
| JournalEntry | ||||
| char70asDocumentTransaction | ||||
| TransactionDate | I_JournalEntry | DocumentDate | ||
| AccountingDocumentType | I_JournalEntry | AccountingDocumentType | ||
| PostingDate | I_JournalEntry | PostingDate | ||
| FiscalPeriod | ||||
| AccountingDocCreatedByUser | I_JournalEntry | AccountingDocCreatedByUser | ||
| char3asFinancialTransactionType | ||||
| _CompanyCode | I_JournalEntry | _CompanyCode | ||
| _FiscalYear | I_JournalEntry | _FiscalYear | ||
| _AccountingDocumentType | I_JournalEntry | _AccountingDocumentType |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #CONSUMPTION
@Analytics.internalName:#LOCAL
@Metadata.allowExtensions:true
@Analytics: { dataCategory: #CUBE }
@EndUserText.label: 'General Ledger Document Header - Cube'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity C_PT_SAFTGenLedgerHeaderC
as select from I_JournalEntry as Doc
inner join I_PT_SAFTGenericSettings as GenSet on GenSet.CompanyCode = Doc.CompanyCode
and GenSet.FiscalYearFrom <= Doc.FiscalYear
and GenSet.FiscalYearTo >= Doc.FiscalYear
inner join P_SAFTJournalEntryLedger as Val on Val.CompanyCode = Doc.CompanyCode
and Val.FiscalYear = Doc.FiscalYear
and Val.AccountingDocument = Doc.AccountingDocument
and Val.DebitAmountInCoCodeCrcy <> 0
and Val.CreditAmountInCoCodeCrcy <> 0
and Val.Ledger = GenSet.SourceLedger
left outer to one join I_PT_SAFTTransactionType as TranType on TranType.CompanyCode = Doc.CompanyCode
and TranType.AccountingDocumentType = Doc.AccountingDocumentType
{
@ObjectModel.foreignKey.association: '_CompanyCode'
key Doc.CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key Doc.FiscalYear,
key Doc.AccountingDocument,
key Doc._JournalEntryItem[1: LedgerGLLineItem = '000001']._Ledger.Ledger,
//<DocArchivalNumber>
cast(Doc.AccountingDocument as abap.char( 10 )) as JournalEntry,
cast(concat_with_space(concat(substring(Doc.DocumentDate,1,4),
concat('-',
concat(substring(Doc.DocumentDate,5,2),
concat('-', substring(Doc.DocumentDate,7,2))))),
concat_with_space(Doc.AccountingDocumentType, Doc.AccountingDocument, 1), 1) as abap.char(70)) as DocumentTransaction,
Doc.DocumentDate as TransactionDate,
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
Doc.AccountingDocumentType,
Doc.PostingDate,
Doc._JournalEntryItem[1: LedgerGLLineItem = '000001'].FiscalPeriod,
Doc.AccountingDocCreatedByUser,
cast(case when Doc.JrnlEntryCntrySpecificRef1 is not initial
then Doc.JrnlEntryCntrySpecificRef1
else
case
when TranType.FinancialTransactionType is not null
and TranType.FinancialTransactionType is not initial
then TranType.FinancialTransactionType
when Doc.AccountingDocumentCategory = 'J'
then 'A'
else 'N'
end
end as abap.char(3)) as FinancialTransactionType,
Doc._CompanyCode,
Doc._FiscalYear,
Doc._AccountingDocumentType
}
where
(
Doc.AccountingDocumentCategory = ''
or Doc.AccountingDocumentCategory = 'J'
or Doc.AccountingDocumentCategory = 'U'
or Doc.AccountingDocumentCategory = 'L'
)
and Doc.FiscalPeriod != '000'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY",
"I_JOURNALENTRYITEM",
"I_LEDGER",
"I_PT_SAFTGENERICSETTINGS",
"I_PT_SAFTTRANSACTIONTYPE",
"P_SAFTJOURNALENTRYLEDGER"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTTYPE",
"I_COMPANYCODE",
"I_FISCALYEARFORCOMPANYCODE"
],
"BASE":
[
"I_JOURNALENTRY"
],
"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