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
KEY PurchaseOrderItem I_PurchasingDocumentItem PurchasingDocumentItem
GoodsReceiptQty
InvoiceReceiptQuantity
PurchaseOrderAmount
@AbapCatalog.sqlViewName: 'PGRINVTOTALQTY'
@VDM.private: true
@VDM.viewType: #CONSUMPTION

@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@ClientHandling.algorithm: #SESSION_VARIABLE

@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL

define view P_TotalGrInvQty
  as select from I_PurchasingDocumentItem as PurchasingDocumentItem
  association [1..*] to P_GrInvQtyInd as _CalcGRIR on  $projection.PurchaseOrder     = _CalcGRIR.PurchaseOrder
                                                    and $projection.PurchaseOrderItem = _CalcGRIR.PurchaseOrderItem

{
  key PurchasingDocumentItem.PurchasingDocument                       as PurchaseOrder,
  key PurchasingDocumentItem.PurchasingDocumentItem                   as PurchaseOrderItem,

      //Total Goods Receipt Quantity

      cast(sum(_CalcGRIR.GoodsReceiptQty) as abap.quan(13,3))        as GoodsReceiptQty,
      //Total Invo ice Receipt Quantity

      cast(sum(_CalcGRIR.InvoiceReceiptQuantity) as abap.quan(13,3)) as InvoiceReceiptQuantity,

      cast(sum(_CalcGRIR.PurchaseOrderAmount) as abap.curr(15,3))        as PurchaseOrderAmount


}
where PurchasingDocumentItem.PurchasingDocumentCategory = 'F' or PurchasingDocumentItem.PurchasingDocumentCategory = 'L'
      and PurchasingDocumentItem.PurchasingDocumentItemCategory <> '9'  //3074796

group by
  PurchasingDocumentItem.PurchasingDocument,
  PurchasingDocumentItem.PurchasingDocumentItem










/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASINGDOCUMENTITEM",
"P_GRINVQTYIND"
],
"ASSOCIATED":
[
"P_GRINVQTYIND"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/