P_GRItm
Goods Receipt document details
P_GRItm is a Consumption CDS View that provides data about "Goods Receipt document details" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrderHistoryBasic) and exposes 37 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)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrderHistoryBasic | I_PurchaseOrderHistoryBasic | from |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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 (12)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PGRITM | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view | |
| EndUserText.label | Goods Receipt document details | 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 |
Fields (37)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | MaterialDocument | PurchasingHistoryDocument | ||
| KEY | MaterialDocumentItem | PurchasingHistoryDocumentItem | ||
| KEY | MaterialDocumentYear | PurchasingHistoryDocumentYear | ||
| FormattedPurDoc | ||||
| 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 | |
| PurchasingDocumentTypeName | ||||
| GoodsMovementType | GoodsMovementType | Movement Type | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| ReferenceDocument | ReferenceDocument | Reference Document | ||
| DocumentReferenceID | DocumentReferenceID | Reference | ||
| Quantity | Quantity | Value | ||
| DebitCreditCode | DebitCreditCode | Single-Character Flag | ||
| PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | ||
| PurchaseOrder | PurchaseOrder | Purchasing Document | ||
| CreatedByUser | CreatedByUser | User Name | ||
| PurchasingHistoryDocumentType | PurchasingHistoryDocumentType | |||
| PurchasingHistoryCategory | PurchasingHistoryCategory | |||
| SupplyingPlant | ||||
| DeliveryDate | ||||
| PurchasingDocument | PurchasingHistoryDocument | |||
| AccountAssignmentCategory | ||||
| PurchasingDocumentItemCategory | ||||
| _PurchaseOrderItem | _PurchaseOrderItem | |||
| _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_GRItm.
-- 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: PGRITM
CREATE VIEW P_GRItm AS
SELECT
PurchasingHistoryDocument AS MaterialDocument,
PurchasingHistoryDocumentItem AS MaterialDocumentItem,
PurchasingHistoryDocumentYear AS MaterialDocumentYear,
concat(concat(concat(concat(PurchasingHistoryDocument, '/'), PurchasingHistoryDocumentItem), '/' ), PurchasingHistoryDocumentYear) AS FormattedPurDoc,
_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._PurchaseOrderType._Text[1:Language = $session.system_language].PurchasingDocumentTypeName AS PurchasingDocumentTypeName,
GoodsMovementType,
DocumentDate,
PostingDate,
ReferenceDocument,
DocumentReferenceID,
Quantity,
DebitCreditCode,
PurchaseOrderItem,
PurchaseOrder,
CreatedByUser,
PurchasingHistoryDocumentType,
PurchasingHistoryCategory,
'' 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]
;
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