P_GLItemPurchasingByCostCenter
GL line items including reference to Purchasing Document
P_GLItemPurchasingByCostCenter is a Composite CDS View that provides data about "GL line items including reference to Purchasing Document" in SAP S/4HANA. It reads from 1 data source (P_CommitmentKey) and exposes 22 fields with key fields ControllingArea, CompanyCode, FiscalYear, FiscalYearVariant, FiscalPeriod. It has 2 associations to related views. Part of development package ODATA_COMMITMENT_REPORTING.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_CommitmentKey | P_CommitmentKey | from |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StartDate | fis_period_date_from | |
| P_EndDate | fis_period_date_to |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_GLCmtmtLineItemByCostCenter | _GLItemByCostCenter | _GLItemByCostCenter.CompanyCode = $projection.CompanyCode and _GLItemByCostCenter.LedgerGLLineItem = $projection.LedgerGLLineItem and _GLItemByCostCenter.Ledger = $projection.Ledger and _GLItemByCostCenter.SourceLedger = $projection.SourceLedger and _GLItemByCostCenter.AccountingDocument = $projection.AccountingDocument and _GLItemByCostCenter.FiscalYear = $projection.FiscalYear and _GLItemByCostCenter.FiscalYearVariant = $projection.FiscalYearVariant and _GLItemByCostCenter.FiscalPeriod = $projection.FiscalPeriod and _GLItemByCostCenter.CostCenter = $projection.CostCenter and _GLItemByCostCenter.GLAccount = $projection.CostElement and _GLItemByCostCenter.ControllingArea = $projection.ControllingArea and _GLItemByCostCenter.PostingDate >= $projection.ValidityStartDate and _GLItemByCostCenter.PostingDate <= $projection.ValidityEndDate and _GLItemByCostCenter.PostingDate >= $parameters.P_StartDate and _GLItemByCostCenter.PostingDate <= $parameters.P_EndDate and ( _GLItemByCostCenter.PurchaseOrderStatus = '01' or _GLItemByCostCenter.PurchaseOrderStatus = '02' or _GLItemByCostCenter.PurchaseOrderStatus = '03' or _GLItemByCostCenter.PurchaseOrderStatus = '04' or _GLItemByCostCenter.PurchaseOrderStatus = '05' or _GLItemByCostCenter.PurchaseOrderStatus = '37' or _GLItemByCostCenter.PurchaseOrderStatus = 'NA' ) |
| [1] | I_CompanyCode | _CompanyCode | _CompanyCode.CompanyCode = $projection.CompanyCode |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PGLITMPURCC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (22)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | ControllingArea | _CommitmentKey | ControllingArea | Controlling Area |
| KEY | CompanyCode | _CommitmentKey | CompanyCode | Receiver Company Code |
| KEY | FiscalYear | _CommitmentKey | FiscalYear | G/L Fiscal Year |
| KEY | FiscalYearVariant | _CommitmentKey | FiscalYearVariant | FY Variant |
| KEY | FiscalPeriod | _CommitmentKey | FiscalPeriod | Tax period |
| KEY | CostCenter | _CommitmentKey | CostCenter | Cost Center |
| KEY | CostElement | _CommitmentKey | CostElement | G/L Account |
| KEY | ValidityEndDate | _CommitmentKey | ValidityEndDate | ValidTo |
| KEY | ValidityStartDate | _CommitmentKey | ValidityStartDate | Validity Start Date |
| KEY | LedgerGLLineItem | _CommitmentKey | LedgerGLLineItem | Journal Entry Item |
| KEY | SourceLedger | _CommitmentKey | SourceLedger | Source Ledger |
| KEY | AccountingDocument | _CommitmentKey | AccountingDocument | Journal Entry |
| KEY | Ledger | _CommitmentKey | Ledger | Ledger |
| KEY | PurchasingDocument | _GLItemByCostCenter | PurchasingDocument | Purchasing Document |
| PostingDate | _GLItemByCostCenter | PostingDate | Posting Date for GR | |
| IsCommitment | _GLItemByCostCenter | IsCommitment | ||
| CmtmtAmtInCompanyCodeCurrency | ||||
| ActAmtInCompanyCodeCurrency | ||||
| CompanyCodeCurrency | _CompanyCode | Currency | Valuation Crcy | |
| StartDate | ||||
| EndDate | ||||
| _GLItemByCostCenter | _GLItemByCostCenter |
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_GLItemPurchasingByCostCenter.
-- 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.
-- SQL view name: PGLITMPURCC
-- Parameters: P_StartDate : fis_period_date_from, P_EndDate : fis_period_date_to
CREATE VIEW P_GLItemPurchasingByCostCenter AS
SELECT
_CommitmentKey.ControllingArea AS ControllingArea,
_CommitmentKey.CompanyCode AS CompanyCode,
_CommitmentKey.FiscalYear AS FiscalYear,
_CommitmentKey.FiscalYearVariant AS FiscalYearVariant,
_CommitmentKey.FiscalPeriod AS FiscalPeriod,
_CommitmentKey.CostCenter AS CostCenter,
_CommitmentKey.CostElement AS CostElement,
_CommitmentKey.ValidityEndDate AS ValidityEndDate,
_CommitmentKey.ValidityStartDate AS ValidityStartDate,
_CommitmentKey.LedgerGLLineItem AS LedgerGLLineItem,
_CommitmentKey.SourceLedger AS SourceLedger,
_CommitmentKey.AccountingDocument AS AccountingDocument,
_CommitmentKey.Ledger AS Ledger,
_GLItemByCostCenter.PurchasingDocument AS PurchasingDocument,
_GLItemByCostCenter.PostingDate AS PostingDate,
_GLItemByCostCenter.IsCommitment AS IsCommitment,
sum(_GLItemByCostCenter.CmtmtAmtInCompanyCodeCurrency) AS CmtmtAmtInCompanyCodeCurrency,
sum(_GLItemByCostCenter.ActualAmountInCompanyCodeCrcy) AS ActAmtInCompanyCodeCurrency,
_CompanyCode.Currency AS CompanyCodeCurrency,
:P_StartDate AS StartDate,
:P_EndDate AS EndDate
FROM P_CommitmentKey
LEFT OUTER JOIN I_GLCmtmtLineItemByCostCenter AS _GLItemByCostCenter ON _GLItemByCostCenter.CompanyCode = CompanyCode AND _GLItemByCostCenter.LedgerGLLineItem = LedgerGLLineItem AND _GLItemByCostCenter.Ledger = Ledger AND _GLItemByCostCenter.SourceLedger = SourceLedger AND _GLItemByCostCenter.AccountingDocument = AccountingDocument AND _GLItemByCostCenter.FiscalYear = FiscalYear AND _GLItemByCostCenter.FiscalYearVariant = FiscalYearVariant AND _GLItemByCostCenter.FiscalPeriod = FiscalPeriod AND _GLItemByCostCenter.CostCenter = CostCenter AND _GLItemByCostCenter.GLAccount = CostElement AND _GLItemByCostCenter.ControllingArea = ControllingArea AND _GLItemByCostCenter.PostingDate >= ValidityStartDate AND _GLItemByCostCenter.PostingDate <= ValidityEndDate AND _GLItemByCostCenter.PostingDate >= $parameters.P_StartDate AND _GLItemByCostCenter.PostingDate <= $parameters.P_EndDate AND ( _GLItemByCostCenter.PurchaseOrderStatus = '01' OR _GLItemByCostCenter.PurchaseOrderStatus = '02' OR _GLItemByCostCenter.PurchaseOrderStatus = '03' OR _GLItemByCostCenter.PurchaseOrderStatus = '04' OR _GLItemByCostCenter.PurchaseOrderStatus = '05' OR _GLItemByCostCenter.PurchaseOrderStatus = '37' OR _GLItemByCostCenter.PurchaseOrderStatus = 'NA' ) -- association [0..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON _CompanyCode.CompanyCode = CompanyCode -- association [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