P_GetLastPostingDate

DDL: P_GETLASTPOSTINGDATE Type: view_entity COMPOSITE Package: MM_IM_VDM_STOCK

Get last Posting Date of Material Documents

P_GetLastPostingDate is a Composite CDS View that provides data about "Get last Posting Date of Material Documents" in SAP S/4HANA. It reads from 2 data sources (I_MaterialDocumentRecord, I_PurchasingDocumentItem) and exposes 3 fields with key fields PurchaseOrder, PurchaseOrderItem. Part of development package MM_IM_VDM_STOCK.

Data Sources (2)

SourceAliasJoin Type
I_MaterialDocumentRecord _MaterialDocumentRecord inner
I_PurchasingDocumentItem _PurchasingDocumentItem from

Annotations (5)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #S view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_MaterialDocumentRecord PurchaseOrder
KEY PurchaseOrderItem I_MaterialDocumentRecord PurchaseOrderItem
LastPostingDateOfMaterialDoc
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #S
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_GetLastPostingDate as select from I_PurchasingDocumentItem as _PurchasingDocumentItem


 inner join I_MaterialDocumentRecord as _MaterialDocumentRecord
         on _PurchasingDocumentItem.PurchasingDocument     = _MaterialDocumentRecord.PurchaseOrder
        and _PurchasingDocumentItem.PurchasingDocumentItem = _MaterialDocumentRecord.PurchaseOrderItem 

{
        key _MaterialDocumentRecord.PurchaseOrder,
        key _MaterialDocumentRecord.PurchaseOrderItem,
        max(_MaterialDocumentRecord.PostingDate) as LastPostingDateOfMaterialDoc
}
      where _PurchasingDocumentItem.IsCompletelyDelivered = 'X'

   group by _MaterialDocumentRecord.PurchaseOrder, _MaterialDocumentRecord.PurchaseOrderItem