P_StkPostgHistCancelBasic01

DDL: P_STKPOSTGHISTCANCELBASIC01 Type: view_entity COMPOSITE

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)

SourceAliasJoin Type
I_MaterialDocumentRecord matdoc from

Parameters (2)

NameTypeDefault
P_StartDate sydate
P_EndDate sydate

Associations (1)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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":""
}
}*/