P_GrInvQtyInd

DDL: P_GRINVQTYIND SQL: PGRINVQTYIND Type: view CONSUMPTION

P_GrInvQtyInd is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrderHistory) and exposes 10 fields with key fields PurchaseOrder, PurchaseOrderItem, PurchaseOrderTransactionType, MaterialDocument, MaterialDocumentYear.

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrderHistory PDHistory from

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PGRINVQTYIND 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 (10)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrderHistory PurchaseOrder Purchasing Document
KEY PurchaseOrderItem I_PurchaseOrderHistory PurchaseOrderItem Purchasing Document Item
KEY PurchaseOrderTransactionType I_PurchaseOrderHistory PurchaseOrderTransactionType Transact. Type
KEY MaterialDocument I_PurchaseOrderHistory MaterialDocument Material Doc.
KEY MaterialDocumentYear I_PurchaseOrderHistory MaterialDocumentYear Material Document Year
KEY MaterialDocumentItem I_PurchaseOrderHistory MaterialDocumentItem Material Document Item
KEY AccountAssignmentNumber I_PurchaseOrderHistory AccountAssignmentNumber Account Assgmt No.
GdsRcptBlkdStkQtyInOrdQtyUnit I_PurchaseOrderHistory GdsRcptBlkdStkQtyInOrdQtyUnit GR Bl.St. OUn
Quantityendelse0endasGoodsReceiptQty
quan133endasInvoiceReceiptQty

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_GrInvQtyInd.
-- 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: PGRINVQTYIND

CREATE VIEW P_GrInvQtyInd AS
SELECT
  PDHistory.PurchaseOrder AS PurchaseOrder,
  PDHistory.PurchaseOrderItem AS PurchaseOrderItem,
  PDHistory.PurchaseOrderTransactionType AS PurchaseOrderTransactionType,
  PDHistory.MaterialDocument AS MaterialDocument,
  PDHistory.MaterialDocumentYear AS MaterialDocumentYear,
  PDHistory.MaterialDocumentItem AS MaterialDocumentItem,
  PDHistory.AccountAssignmentNumber AS AccountAssignmentNumber,
  PDHistory.GdsRcptBlkdStkQtyInOrdQtyUnit AS GdsRcptBlkdStkQtyInOrdQtyUnit,
  case PurchaseOrderTransactionType when '1' then case PDHistory.DebitCreditCode when 'S' then PDHistory.Quantity else (-1 * PDHistory.Quantity) end else 0 end as GoodsReceiptQty AS Quantityendelse0endasGoodsReceiptQty,
  case when PurchaseOrderTransactionType = '2' then case when DebitCreditCode = 'S' then Quantity else (-1 * Quantity) end else cast(0 as abap.quan(13, 3)) end as InvoiceReceiptQty AS quan133endasInvoiceReceiptQty
FROM I_PurchaseOrderHistory AS PDHistory
;