P_TotalGrInvQty

DDL: P_TOTALGRINVQTY SQL: PGRINVTOTALQTY Type: view CONSUMPTION

P_TotalGrInvQty is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_PurchasingDocumentItem) and exposes 5 fields with key fields PurchaseOrder, PurchaseOrderItem. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_PurchasingDocumentItem PurchasingDocumentItem from

Associations (1)

CardinalityTargetAliasCondition
[1..*] P_GrInvQtyInd _CalcGRIR $projection.PurchaseOrder = _CalcGRIR.PurchaseOrder and $projection.PurchaseOrderItem = _CalcGRIR.PurchaseOrderItem

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PGRINVTOTALQTY view
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchasingDocumentItem PurchasingDocument Purchasing Document
KEY PurchaseOrderItem I_PurchasingDocumentItem PurchasingDocumentItem Purchasing Doc. Item
GoodsReceiptQty
InvoiceReceiptQuantity
PurchaseOrderAmount

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_TotalGrInvQty.
-- 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: PGRINVTOTALQTY

CREATE VIEW P_TotalGrInvQty AS
SELECT
  PurchasingDocumentItem.PurchasingDocument AS PurchaseOrder,
  PurchasingDocumentItem.PurchasingDocumentItem AS PurchaseOrderItem,
  cast(sum(_CalcGRIR.GoodsReceiptQty) as abap.quan(13,3)) AS GoodsReceiptQty,
  cast(sum(_CalcGRIR.InvoiceReceiptQuantity) as abap.quan(13,3)) AS InvoiceReceiptQuantity,
  cast(sum(_CalcGRIR.PurchaseOrderAmount) as abap.curr(15,3)) AS PurchaseOrderAmount
FROM I_PurchasingDocumentItem AS PurchasingDocumentItem
LEFT OUTER JOIN P_GrInvQtyInd AS _CalcGRIR ON PurchaseOrder = _CalcGRIR.PurchaseOrder AND PurchaseOrderItem = _CalcGRIR.PurchaseOrderItem  -- association [1..*]
;