P_GR_CADocJournalItem
GR Doc Journal
P_GR_CADocJournalItem is a Consumption CDS View that provides data about "GR Doc Journal" in SAP S/4HANA. It reads from 1 data source (P_GR_CADocJournalBasic) and exposes 27 fields with key fields CompanyCode, CADocumentNumber, FiscalYear, PostingDate, FiscalPeriod. It has 3 associations to related views. Part of development package FKK_ID_GR_REP.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_GR_CADocJournalBasic | P_GR_CADocJournalBasic | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_ToPostingDate | fis_budat_to | |
| P_GR_JournalFromDate | fis_gr_docjrnl_budat_frm | |
| P_CompanyCode | fis_bukrs |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_GLAccountInCompanyCode | _AlternateGLAcctInCompany | $projection.GLAccount = _AlternateGLAcctInCompany.GLAccount and $projection.CompanyCode = _AlternateGLAcctInCompany.CompanyCode |
| [0..1] | I_GLAccountText | _GLAcctCOAText | $projection.ChartOfAccounts = _GLAcctCOAText.ChartOfAccounts and $projection.GLAccount = _GLAcctCOAText.GLAccount and _GLAcctCOAText.Language = 'E' |
| [1..1] | I_CADocumentTypeText | _DocTypeTxt | $projection.CADocumentType = _DocTypeTxt.CADocumentType and $projection.CAApplicationArea = _DocTypeTxt.CAApplicationArea and _DocTypeTxt.Language = 'E' |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| VDM.private | true | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (27)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | CompanyCode | Receiver Company Code | |
| KEY | CADocumentNumber | CADocumentNumber | Document Number | |
| KEY | FiscalYear | FiscalYear | G/L Fiscal Year | |
| KEY | PostingDate | PostingDate | Posting Date for GR | |
| KEY | FiscalPeriod | FiscalPeriod | Tax period | |
| KEY | FiscalYearVariant | FiscalYearVariant | FY Variant | |
| KEY | DocumentDate | DocumentDate | Journal Entry Date | |
| KEY | BusinessPartner | BusinessPartner | Issuing Authority | |
| KEY | CAReferenceDocument | CAReferenceDocument | Reference | |
| KEY | GLAccount | GLAccount | General Ledger | |
| KEY | CAMainTransaction | CAMainTransaction | Main Trans. | |
| KEY | CASubTransaction | CASubTransaction | Subtransaction | |
| KEY | CompanyCodeCurrency | CompanyCodeCurrency | Local Currency | |
| KEY | TransactionCurrency | TransactionCurrency | Transaction Currency | |
| KEY | DebitCreditCode | DebitCreditCode | Single-Character Flag | |
| ChartOfAccounts | ChartOfAccounts | Node Class | ||
| CADocumentType | CADocumentType | Document Type | ||
| CAApplicationArea | CAApplicationArea | ApplicationArea | ||
| BusinessPartnerName | _BusinessPartner | BusinessPartnerName | Extracted Customer Name | |
| CASubTransactionName | ||||
| AmountInCompanyCodeCurrency | AmountInCompanyCodeCurrency | Local Crcy Amt | ||
| CAAmountInTransactionCurrency | CAAmountInTransactionCurrency | Amount | ||
| CarryFwdBalAmtInCCCrcy | ||||
| CarryFwdBalanceAmtInTransCrcy | ||||
| _AlternateGLAcctInCompany | _AlternateGLAcctInCompany | |||
| _GLAcctCOAText | _GLAcctCOAText | |||
| _DocTypeTxt | _DocTypeTxt |
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_GR_CADocJournalItem.
-- 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.
-- Parameters: P_ToPostingDate : fis_budat_to, P_GR_JournalFromDate : fis_gr_docjrnl_budat_frm, P_CompanyCode : fis_bukrs
CREATE VIEW P_GR_CADocJournalItem AS
SELECT
CompanyCode,
CADocumentNumber,
FiscalYear,
PostingDate,
FiscalPeriod,
FiscalYearVariant,
DocumentDate,
BusinessPartner,
CAReferenceDocument,
GLAccount,
CAMainTransaction,
CASubTransaction,
CompanyCodeCurrency,
TransactionCurrency,
DebitCreditCode,
ChartOfAccounts,
CADocumentType,
CAApplicationArea,
_BusinessPartner.BusinessPartnerName AS BusinessPartnerName,
cast(_CASubTransaction._Text[1: Language = $session.system_language ].CASubTransactionName as txt30) AS CASubTransactionName,
AmountInCompanyCodeCurrency,
CAAmountInTransactionCurrency,
cast( '0' as glo_cfwd_bal_hsl) AS CarryFwdBalAmtInCCCrcy,
cast( '0' as glo_cfwd_bal_wsl ) AS CarryFwdBalanceAmtInTransCrcy
FROM P_GR_CADocJournalBasic
LEFT OUTER JOIN I_GLAccountInCompanyCode AS _AlternateGLAcctInCompany ON GLAccount = _AlternateGLAcctInCompany.GLAccount AND CompanyCode = _AlternateGLAcctInCompany.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_GLAccountText AS _GLAcctCOAText ON ChartOfAccounts = _GLAcctCOAText.ChartOfAccounts AND GLAccount = _GLAcctCOAText.GLAccount AND _GLAcctCOAText.Language = 'E' -- association [0..1]
LEFT OUTER JOIN I_CADocumentTypeText AS _DocTypeTxt ON CADocumentType = _DocTypeTxt.CADocumentType AND CAApplicationArea = _DocTypeTxt.CAApplicationArea AND _DocTypeTxt.Language = 'E' -- association [1..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA