P_GRItmOverview

DDL: P_GRITMOVERVIEW SQL: PGRITEMOVW Type: view CONSUMPTION Package: ODATA_MM_PUR_MYPURGDOCITEMS

GR Item Overview

P_GRItmOverview is a Consumption CDS View that provides data about "GR Item Overview" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrderHistoryBasic) and exposes 23 fields with key fields MaterialDocument, MaterialDocumentItem, MaterialDocumentYear. It has 1 association to related views. Part of development package ODATA_MM_PUR_MYPURGDOCITEMS.

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrderHistoryBasic I_PurchaseOrderHistoryBasic from

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_MaterialDocumentRecord _MatDocRec $projection.MaterialDocument = _MatDocRec.MaterialDocument and $projection.MaterialDocumentItem = _MatDocRec.MaterialDocumentItem and $projection.MaterialDocumentYear = _MatDocRec.MaterialDocumentYear and _MatDocRec.MaterialDocumentRecordType = 'MDOC' and _MatDocRec.IsAutomaticallyCreated <> 'X'

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName PGRITEMOVW view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label GR Item Overview view

Fields (23)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocument PurchasingHistoryDocument
KEY MaterialDocumentItem PurchasingHistoryDocumentItem
KEY MaterialDocumentYear PurchasingHistoryDocumentYear
Supplier _PurchaseOrder Supplier Supplier
SupplierName
MaterialGroup _PurchaseOrderItem MaterialGroup Product Group
PurchasingGroup _PurchaseOrder PurchasingGroup Purchasing Group
Plant Plant Valuation Area
char2endasStatus
Material Material Vehicle Model
PurchasingOrganization _PurchaseOrder PurchasingOrganization Purchasing Organization
ServicePerformer _PurchaseOrderItem ServicePerformer Service Performer
CostCenter
SalesOrder
WBSElementExternalID
PurchaseOrderType _PurchaseOrder PurchaseOrderType PO Type
PurchaseOrder PurchaseOrder Purchasing Document
SupplyingPlant
DeliveryDate
PurchasingDocument PurchasingHistoryDocument
AccountAssignmentCategory
PurchasingDocumentItemCategory
_MatDocRec _MatDocRec

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_GRItmOverview.
-- 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: PGRITEMOVW

CREATE VIEW P_GRItmOverview AS
SELECT
  PurchasingHistoryDocument AS MaterialDocument,
  PurchasingHistoryDocumentItem AS MaterialDocumentItem,
  PurchasingHistoryDocumentYear AS MaterialDocumentYear,
  _PurchaseOrder.Supplier AS Supplier,
  _PurchaseOrder._Supplier.SupplierName AS SupplierName,
  _PurchaseOrderItem.MaterialGroup AS MaterialGroup,
  _PurchaseOrder.PurchasingGroup AS PurchasingGroup,
  Plant,
  case GoodsMovementType when '101' then cast('22' as abap.char(2)) AS char2endasStatus,
  Material,
  _PurchaseOrder.PurchasingOrganization AS PurchasingOrganization,
  _PurchaseOrderItem.ServicePerformer AS ServicePerformer,
  '' AS CostCenter,
  '' AS SalesOrder,
  '' AS WBSElementExternalID,
  _PurchaseOrder.PurchaseOrderType AS PurchaseOrderType,
  PurchaseOrder,
  '' AS SupplyingPlant,
  cast ('00000000' as mm_a_delivery_date) AS DeliveryDate,
  PurchasingHistoryDocument AS PurchasingDocument,
  '' AS AccountAssignmentCategory,
  '_' AS PurchasingDocumentItemCategory
FROM I_PurchaseOrderHistoryBasic
LEFT OUTER JOIN I_MaterialDocumentRecord AS _MatDocRec ON MaterialDocument = _MatDocRec.MaterialDocument AND MaterialDocumentItem = _MatDocRec.MaterialDocumentItem AND MaterialDocumentYear = _MatDocRec.MaterialDocumentYear AND _MatDocRec.MaterialDocumentRecordType = 'MDOC' AND _MatDocRec.IsAutomaticallyCreated <> 'X'  -- association [1..1]
;