P_StkPostgHistCancelBasic02
Stock posting history cancel documents part 2
P_StkPostgHistCancelBasic02 is a Composite CDS View that provides data about "Stock posting history cancel documents part 2" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 37 fields with key fields MaterialDocument, MaterialDocumentYear, MaterialDocumentItem. It has 1 association to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialDocumentRecord | matdoc | from |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StartDate | sydate | |
| P_EndDate | sydate |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_MaterialDocumentRecord | matdoc_predecessor | matdoc.ReversedMaterialDocument = matdoc_predecessor.MaterialDocument and matdoc.ReversedMaterialDocumentYear = matdoc_predecessor.MaterialDocumentYear and matdoc.ReversedMaterialDocumentItem = matdoc_predecessor.MaterialDocumentItem and matdoc.ReversedMaterialDocument <> '' and matdoc.StockIdentifyingMaterial = matdoc_predecessor.StockIdentifyingMaterial and matdoc.Plant = matdoc_predecessor.Plant and matdoc.StockIdfgStorageLocation = matdoc_predecessor.StockIdfgStorageLocation and matdoc.StockIdentifyingBatch = matdoc_predecessor.StockIdentifyingBatch and matdoc.SpecialStockIdfgSupplier = matdoc_predecessor.SpecialStockIdfgSupplier and matdoc.SpecialStockIdfgSalesOrder = matdoc_predecessor.SpecialStockIdfgSalesOrder and matdoc.SpecialStockIdfgSalesOrderItem = matdoc_predecessor.SpecialStockIdfgSalesOrderItem and matdoc.SpecialStockIdfgWBSElement = matdoc_predecessor.SpecialStockIdfgWBSElement and matdoc.SpecialStockIdfgCustomer = matdoc_predecessor.SpecialStockIdfgCustomer and matdoc.InventoryStockType = matdoc_predecessor.InventoryStockType and matdoc.InventorySpecialStockType = matdoc_predecessor.InventorySpecialStockType and matdoc.SpecialStockIdfgStockOwner = matdoc_predecessor.SpecialStockIdfgStockOwner and matdoc.ResourceID = matdoc_predecessor.ResourceID and matdoc_predecessor.GoodsMovementIsCancelled = 'X' |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Stock posting history cancel documents part 2 | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (37)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | MaterialDocument | MaterialDocument | ||
| KEY | MaterialDocumentYear | MaterialDocumentYear | ||
| KEY | MaterialDocumentItem | MaterialDocumentItem | ||
| CostEstimate | CostEstimate | |||
| CompanyCode | I_MaterialDocumentRecord | CompanyCode | ||
| Material | StockIdentifyingMaterial | |||
| Plant | Plant | |||
| StorageLocation | StockIdfgStorageLocation | |||
| Batch | StockIdentifyingBatch | |||
| Supplier | SpecialStockIdfgSupplier | |||
| SalesOrder | SpecialStockIdfgSalesOrder | |||
| SalesOrderItem | SpecialStockIdfgSalesOrderItem | |||
| WBSElementInternalID | SpecialStockIdfgWBSElement | |||
| Customer | SpecialStockIdfgCustomer | |||
| InventoryStockType | InventoryStockType | |||
| InventorySpecialStockType | InventorySpecialStockType | |||
| SpecialStockIdfgStockOwner | SpecialStockIdfgStockOwner | |||
| ResourceID | ResourceID | |||
| InventoryValuationType | InventoryValuationType | |||
| MaterialBaseUnit | MaterialBaseUnit | |||
| MatlStkChangeQtyInBaseUnit | MatlStkChangeQtyInBaseUnit | |||
| CompanyCodeCurrency | CompanyCodeCurrency | |||
| GoodsMovementStkAmtInCCCrcy | GoodsMovementStkAmtInCCCrcy | |||
| PurchaseOrder | PurchaseOrder | |||
| PurchaseOrderItem | PurchaseOrderItem | |||
| ManufacturingOrder | ManufacturingOrder | |||
| ManufacturingOrderItem | ManufacturingOrderItem | |||
| DeliveryDocument | DeliveryDocument | |||
| DeliveryDocumentItem | DeliveryDocumentItem | |||
| Reservation | Reservation | |||
| ReservationItem | ReservationItem | |||
| GoodsMovementType | GoodsMovementType | |||
| GoodsMovementRefDocType | GoodsMovementRefDocType | |||
| GoodsReceiptType | GoodsReceiptType | |||
| ConsumptionPosting | ConsumptionPosting | |||
| PostingDate | PostingDate | |||
| PredecessorPostingDate | matdoc_predecessor | PostingDate |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stock posting history cancel documents part 2'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM:
{
viewType: #COMPOSITE,
private: true
}
define view entity P_StkPostgHistCancelBasic02
with parameters
@Environment.systemField: #SYSTEM_DATE
P_StartDate : sydate,
@Environment.systemField: #SYSTEM_DATE
P_EndDate : sydate
as select from I_MaterialDocumentRecord as matdoc
association [1..1] to I_MaterialDocumentRecord as matdoc_predecessor on matdoc.ReversedMaterialDocument = matdoc_predecessor.MaterialDocument
and matdoc.ReversedMaterialDocumentYear = matdoc_predecessor.MaterialDocumentYear
and matdoc.ReversedMaterialDocumentItem = matdoc_predecessor.MaterialDocumentItem
and matdoc.ReversedMaterialDocument <> ''
and matdoc.StockIdentifyingMaterial = matdoc_predecessor.StockIdentifyingMaterial
and matdoc.Plant = matdoc_predecessor.Plant
and matdoc.StockIdfgStorageLocation = matdoc_predecessor.StockIdfgStorageLocation
and matdoc.StockIdentifyingBatch = matdoc_predecessor.StockIdentifyingBatch
and matdoc.SpecialStockIdfgSupplier = matdoc_predecessor.SpecialStockIdfgSupplier
and matdoc.SpecialStockIdfgSalesOrder = matdoc_predecessor.SpecialStockIdfgSalesOrder
and matdoc.SpecialStockIdfgSalesOrderItem = matdoc_predecessor.SpecialStockIdfgSalesOrderItem
and matdoc.SpecialStockIdfgWBSElement = matdoc_predecessor.SpecialStockIdfgWBSElement
and matdoc.SpecialStockIdfgCustomer = matdoc_predecessor.SpecialStockIdfgCustomer
and matdoc.InventoryStockType = matdoc_predecessor.InventoryStockType
and matdoc.InventorySpecialStockType = matdoc_predecessor.InventorySpecialStockType
and matdoc.SpecialStockIdfgStockOwner = matdoc_predecessor.SpecialStockIdfgStockOwner
and matdoc.ResourceID = matdoc_predecessor.ResourceID
and matdoc_predecessor.GoodsMovementIsCancelled = 'X'
{
key MaterialDocument,
key MaterialDocumentYear,
key MaterialDocumentItem,
CostEstimate,
matdoc.CompanyCode as CompanyCode,
// stock fields for filter
StockIdentifyingMaterial as Material,
Plant,
StockIdfgStorageLocation as StorageLocation,
StockIdentifyingBatch as Batch,
SpecialStockIdfgSupplier as Supplier,
SpecialStockIdfgSalesOrder as SalesOrder,
SpecialStockIdfgSalesOrderItem as SalesOrderItem,
SpecialStockIdfgWBSElement as WBSElementInternalID,
SpecialStockIdfgCustomer as Customer,
InventoryStockType,
InventorySpecialStockType,
SpecialStockIdfgStockOwner,
ResourceID,
InventoryValuationType,
// stock quantity
MaterialBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
MatlStkChangeQtyInBaseUnit,
CompanyCodeCurrency,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
GoodsMovementStkAmtInCCCrcy,
// reference documents
PurchaseOrder,
PurchaseOrderItem,
ManufacturingOrder,
ManufacturingOrderItem,
DeliveryDocument,
DeliveryDocumentItem,
Reservation,
ReservationItem,
// other fields
GoodsMovementType,
GoodsMovementRefDocType,
GoodsReceiptType,
ConsumptionPosting,
PostingDate,
// Reversal Document
matdoc_predecessor.PostingDate as PredecessorPostingDate
}
where
PostingDate >= $parameters.P_StartDate
and PostingDate <= $parameters.P_EndDate
and GoodsMovementCancellationType = '2'
and(
matdoc_predecessor.PostingDate < $parameters.P_StartDate
or matdoc_predecessor.PostingDate > $parameters.P_EndDate
)
and(
MatlStkChangeQtyInBaseUnit <> 0
or TotalGoodsMvtAmtInCCCrcy = 0
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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