P_StkPostgHistCancelBasic01
Stock posting history cancel documents part 1
P_StkPostgHistCancelBasic01 is a Composite CDS View that provides data about "Stock posting history cancel documents part 1" 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_successor | matdoc.MaterialDocument = matdoc_successor.ReversedMaterialDocument and matdoc.MaterialDocumentYear = matdoc_successor.ReversedMaterialDocumentYear and matdoc.MaterialDocumentItem = matdoc_successor.ReversedMaterialDocumentItem and matdoc_successor.ReversedMaterialDocument <> '' and matdoc.StockIdentifyingMaterial = matdoc_successor.StockIdentifyingMaterial and matdoc.Plant = matdoc_successor.Plant and matdoc.StockIdfgStorageLocation = matdoc_successor.StockIdfgStorageLocation and matdoc.StockIdentifyingBatch = matdoc_successor.StockIdentifyingBatch and matdoc.SpecialStockIdfgSupplier = matdoc_successor.SpecialStockIdfgSupplier and matdoc.SpecialStockIdfgSalesOrder = matdoc_successor.SpecialStockIdfgSalesOrder and matdoc.SpecialStockIdfgSalesOrderItem = matdoc_successor.SpecialStockIdfgSalesOrderItem and matdoc.SpecialStockIdfgWBSElement = matdoc_successor.SpecialStockIdfgWBSElement and matdoc.SpecialStockIdfgCustomer = matdoc_successor.SpecialStockIdfgCustomer and matdoc.InventoryStockType = matdoc_successor.InventoryStockType and matdoc.InventorySpecialStockType = matdoc_successor.InventorySpecialStockType and matdoc.SpecialStockIdfgStockOwner = matdoc_successor.SpecialStockIdfgStockOwner and matdoc.ResourceID = matdoc_successor.ResourceID and matdoc_successor.GoodsMovementCancellationType = '2' |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Stock posting history cancel documents part 1 | 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 | |||
| SuccessorPostingDate | matdoc_successor | PostingDate |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stock posting history cancel documents part 1'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM:
{
viewType: #COMPOSITE,
private: true
}
define view entity P_StkPostgHistCancelBasic01
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_successor on matdoc.MaterialDocument = matdoc_successor.ReversedMaterialDocument
and matdoc.MaterialDocumentYear = matdoc_successor.ReversedMaterialDocumentYear
and matdoc.MaterialDocumentItem = matdoc_successor.ReversedMaterialDocumentItem
and matdoc_successor.ReversedMaterialDocument <> ''
and matdoc.StockIdentifyingMaterial = matdoc_successor.StockIdentifyingMaterial
and matdoc.Plant = matdoc_successor.Plant
and matdoc.StockIdfgStorageLocation = matdoc_successor.StockIdfgStorageLocation
and matdoc.StockIdentifyingBatch = matdoc_successor.StockIdentifyingBatch
and matdoc.SpecialStockIdfgSupplier = matdoc_successor.SpecialStockIdfgSupplier
and matdoc.SpecialStockIdfgSalesOrder = matdoc_successor.SpecialStockIdfgSalesOrder
and matdoc.SpecialStockIdfgSalesOrderItem = matdoc_successor.SpecialStockIdfgSalesOrderItem
and matdoc.SpecialStockIdfgWBSElement = matdoc_successor.SpecialStockIdfgWBSElement
and matdoc.SpecialStockIdfgCustomer = matdoc_successor.SpecialStockIdfgCustomer
and matdoc.InventoryStockType = matdoc_successor.InventoryStockType
and matdoc.InventorySpecialStockType = matdoc_successor.InventorySpecialStockType
and matdoc.SpecialStockIdfgStockOwner = matdoc_successor.SpecialStockIdfgStockOwner
and matdoc.ResourceID = matdoc_successor.ResourceID
and matdoc_successor.GoodsMovementCancellationType = '2'
{
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_successor.PostingDate as SuccessorPostingDate
}
where
PostingDate >= $parameters.P_StartDate
and PostingDate <= $parameters.P_EndDate
and GoodsMovementIsCancelled = 'X'
and(
GoodsMovementCancellationType = ''
or GoodsMovementCancellationType = '1'
)
and(
matdoc_successor.PostingDate < $parameters.P_StartDate
or matdoc_successor.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