P_StkPostgHistBasic

DDL: P_STKPOSTGHISTBASIC Type: view_entity COMPOSITE

Stock posting history basic view

P_StkPostgHistBasic is a Composite CDS View that provides data about "Stock posting history basic view" in SAP S/4HANA. It reads from 5 data sources (I_MaterialDocumentRecord, P_StkPostgHistAcctgNoStkQty, I_GLAccountLineItemRawData, finsc_ledger, I_MaterialDocumentRecord) and exposes 113 fields.

Data Sources (5)

SourceAliasJoin Type
I_MaterialDocumentRecord _matdoc inner
P_StkPostgHistAcctgNoStkQty acdoca union_all
I_GLAccountLineItemRawData acdoca union_all
finsc_ledger finsc_ledger inner
I_MaterialDocumentRecord matdoc from

Parameters (2)

NameTypeDefault
P_StartDate sydate
P_EndDate sydate

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Stock posting history basic view view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (113)

KeyFieldSource TableSource FieldDescription
StockLevelIsValuated
MaterialDocument I_MaterialDocumentRecord MaterialDocument Material Doc.
MaterialDocumentYear I_MaterialDocumentRecord MaterialDocumentYear Material Document Year
MaterialDocumentItem I_MaterialDocumentRecord MaterialDocumentItem Material Document Item
FiscalYearendasFiscalYear
CostEstimate I_MaterialDocumentRecord CostEstimate Cost EstimateNo
CompanyCode I_MaterialDocumentRecord CompanyCode Receiver Company Code
Material I_MaterialDocumentRecord StockIdentifyingMaterial Product Sold
Plant I_MaterialDocumentRecord Plant Valuation Area
StorageLocation I_MaterialDocumentRecord StockIdfgStorageLocation Stor. Location SID
Batch I_MaterialDocumentRecord StockIdentifyingBatch Batch SID
Supplier I_MaterialDocumentRecord SpecialStockIdfgSupplier Supplier SID
SalesOrder I_MaterialDocumentRecord SpecialStockIdfgSalesOrder Stock Ident Header
SalesOrderItem I_MaterialDocumentRecord SpecialStockIdfgSalesOrderItem Stock Ident Item
WBSElementInternalID I_MaterialDocumentRecord SpecialStockIdfgWBSElement WBS Internal ID
Customer I_MaterialDocumentRecord SpecialStockIdfgCustomer Customer SID
InventoryStockType I_MaterialDocumentRecord InventoryStockType Stock Type
InventorySpecialStockType I_MaterialDocumentRecord InventorySpecialStockType Special Stock Type
SpecialStockIdfgStockOwner I_MaterialDocumentRecord SpecialStockIdfgStockOwner
ResourceID I_MaterialDocumentRecord ResourceID Vehicle ID
InventoryValuationType I_MaterialDocumentRecord InventoryValuationType Valuation Type
MaterialBaseUnit I_MaterialDocumentRecord MaterialBaseUnit Valuation UoM
MatlStkChangeQtyInBaseUnit I_MaterialDocumentRecord MatlStkChangeQtyInBaseUnit
CompanyCodeCurrency I_MaterialDocumentRecord CompanyCodeCurrency Local Currency
PurchaseOrder I_MaterialDocumentRecord PurchaseOrder Purchasing Document
PurchaseOrderItem I_MaterialDocumentRecord PurchaseOrderItem Purchasing Doc. Item
ManufacturingOrder I_MaterialDocumentRecord ManufacturingOrder Order ID
ManufacturingOrderItem I_MaterialDocumentRecord ManufacturingOrderItem Order item no.
DeliveryDocument I_MaterialDocumentRecord DeliveryDocument Outbound Delivery
DeliveryDocumentItem I_MaterialDocumentRecord DeliveryDocumentItem Outb. Delivery Item
Reservation I_MaterialDocumentRecord Reservation Reservation
ReservationItem I_MaterialDocumentRecord ReservationItem Reservation Item
GoodsMovementType I_MaterialDocumentRecord GoodsMovementType Movement Type
GoodsMovementRefDocType I_MaterialDocumentRecord GoodsMovementRefDocType Reference Doc. Type
GoodsReceiptType I_MaterialDocumentRecord GoodsReceiptType Receipt Ind.
ConsumptionPosting I_MaterialDocumentRecord ConsumptionPosting Consumption Posting
CompanyCode0asStockLevelIsValuated
MaterialDocument I_GLAccountLineItemRawData MaterialDocument Material Doc.
MaterialDocumentYear I_GLAccountLineItemRawData MaterialDocumentYear Material Document Year
MaterialDocumentItem I_GLAccountLineItemRawData MaterialDocumentItem Material Document Item
AccountingDocument I_GLAccountLineItemRawData AccountingDocument Journal Entry
FiscalYear I_GLAccountLineItemRawData FiscalYear G/L Fiscal Year
CostEstimate I_GLAccountLineItemRawData CostEstimate Cost EstimateNo
CompanyCode I_GLAccountLineItemRawData CompanyCode Receiver Company Code
Material I_MaterialDocumentRecord StockIdentifyingMaterial Product Sold
Plant I_MaterialDocumentRecord Plant Valuation Area
StorageLocation I_MaterialDocumentRecord StockIdfgStorageLocation Stor. Location SID
Batch I_MaterialDocumentRecord StockIdentifyingBatch Batch SID
Supplier I_MaterialDocumentRecord SpecialStockIdfgSupplier Supplier SID
SalesOrder I_MaterialDocumentRecord SpecialStockIdfgSalesOrder Stock Ident Header
SalesOrderItem I_MaterialDocumentRecord SpecialStockIdfgSalesOrderItem Stock Ident Item
WBSElementInternalID I_MaterialDocumentRecord SpecialStockIdfgWBSElement WBS Internal ID
Customer I_MaterialDocumentRecord SpecialStockIdfgCustomer Customer SID
InventoryStockType I_MaterialDocumentRecord InventoryStockType Stock Type
InventorySpecialStockType I_MaterialDocumentRecord InventorySpecialStockType Special Stock Type
SpecialStockIdfgStockOwner I_MaterialDocumentRecord SpecialStockIdfgStockOwner
ResourceID I_MaterialDocumentRecord ResourceID Vehicle ID
InventoryValuationType I_MaterialDocumentRecord InventoryValuationType Valuation Type
MaterialBaseUnit I_GLAccountLineItemRawData MaterialBaseUnit Valuation UoM
MatlStkChangeQtyInBaseUnit I_GLAccountLineItemRawData MatlStkChangeQtyInBaseUnit
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency Local Currency
AmountInCompanyCodeCurrency I_GLAccountLineItemRawData AmountInCompanyCodeCurrency Local Crcy Amt
PurchaseOrder I_MaterialDocumentRecord PurchaseOrder Purchasing Document
PurchaseOrderItem I_MaterialDocumentRecord PurchaseOrderItem Purchasing Doc. Item
ManufacturingOrder I_MaterialDocumentRecord ManufacturingOrder Order ID
ManufacturingOrderItem I_MaterialDocumentRecord ManufacturingOrderItem Order item no.
DeliveryDocument I_MaterialDocumentRecord DeliveryDocument Outbound Delivery
DeliveryDocumentItem I_MaterialDocumentRecord DeliveryDocumentItem Outb. Delivery Item
Reservation I_MaterialDocumentRecord Reservation Reservation
ReservationItem I_MaterialDocumentRecord ReservationItem Reservation Item
GoodsMovementType I_MaterialDocumentRecord GoodsMovementType Movement Type
GoodsMovementRefDocType I_MaterialDocumentRecord GoodsMovementRefDocType Reference Doc. Type
GoodsReceiptType I_MaterialDocumentRecord GoodsReceiptType Receipt Ind.
ConsumptionPosting I_MaterialDocumentRecord ConsumptionPosting Consumption Posting
xleadingX1asStockLevelIsValuated
MaterialDocument Material Doc.
MaterialDocumentYear Material Document Year
MaterialDocumentItem Material Document Item
AccountingDocument I_GLAccountLineItemRawData AccountingDocument Journal Entry
FiscalYear I_GLAccountLineItemRawData FiscalYear G/L Fiscal Year
CostEstimate I_GLAccountLineItemRawData CostEstimate Cost EstimateNo
CompanyCode I_GLAccountLineItemRawData CompanyCode Receiver Company Code
Material I_GLAccountLineItemRawData Product Product Sold
Plant I_GLAccountLineItemRawData Plant Valuation Area
StorageLocation Stor. Location SID
Batch Batch SID
Supplier Supplier SID
SalesOrder Stock Ident Header
SalesOrderItem Stock Ident Item
WBSElementInternalID WBS Internal ID
Customer Customer SID
InventoryStockType Stock Type
InventorySpecialStockType Special Stock Type
SpecialStockIdfgStockOwner
ResourceID Vehicle ID
InventoryValuationType I_GLAccountLineItemRawData InventoryValuationType Valuation Type
MaterialBaseUnit I_GLAccountLineItemRawData CostSourceUnit Valuation UoM
MatlStkChangeQtyInBaseUnit I_GLAccountLineItemRawData ValuationQuantity
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency Local Currency
AmountInCompanyCodeCurrency I_GLAccountLineItemRawData AmountInCompanyCodeCurrency Local Crcy Amt
PurchaseOrder I_GLAccountLineItemRawData PurchasingDocument Purchasing Document
PurchaseOrderItem I_GLAccountLineItemRawData PurchasingDocumentItem Purchasing Doc. Item
ManufacturingOrder I_GLAccountLineItemRawData OrderID Order ID
ManufacturingOrderItem I_GLAccountLineItemRawData OrderItem Order item no.
DeliveryDocument Outbound Delivery
DeliveryDocumentItem Outb. Delivery Item
Reservation Reservation
ReservationItem Reservation Item
GoodsMovementType Movement Type
GoodsMovementRefDocType Reference Doc. Type
GoodsReceiptType Receipt Ind.
ConsumptionPosting Consumption Posting
PostingDate I_GLAccountLineItemRawData PostingDate Posting Date for GR

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_StkPostgHistBasic.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- Parameters: P_StartDate : sydate, P_EndDate : sydate

CREATE VIEW P_StkPostgHistBasic AS
SELECT
  '0' AS StockLevelIsValuated,
  matdoc.MaterialDocument AS MaterialDocument,
  matdoc.MaterialDocumentYear AS MaterialDocumentYear,
  matdoc.MaterialDocumentItem AS MaterialDocumentItem,
  case when _MatDocAccounting.FiscalYear is null then cast('0000' as gjahr) else _MatDocAccounting.FiscalYear end as FiscalYear AS FiscalYearendasFiscalYear,
  matdoc.CostEstimate AS CostEstimate,
  matdoc.CompanyCode AS CompanyCode,
  matdoc.StockIdentifyingMaterial AS Material,
  matdoc.Plant AS Plant,
  matdoc.StockIdfgStorageLocation AS StorageLocation,
  matdoc.StockIdentifyingBatch AS Batch,
  matdoc.SpecialStockIdfgSupplier AS Supplier,
  matdoc.SpecialStockIdfgSalesOrder AS SalesOrder,
  matdoc.SpecialStockIdfgSalesOrderItem AS SalesOrderItem,
  matdoc.SpecialStockIdfgWBSElement AS WBSElementInternalID,
  matdoc.SpecialStockIdfgCustomer AS Customer,
  matdoc.InventoryStockType AS InventoryStockType,
  matdoc.InventorySpecialStockType AS InventorySpecialStockType,
  matdoc.SpecialStockIdfgStockOwner AS SpecialStockIdfgStockOwner,
  matdoc.ResourceID AS ResourceID,
  matdoc.InventoryValuationType AS InventoryValuationType,
  matdoc.MaterialBaseUnit AS MaterialBaseUnit,
  matdoc.MatlStkChangeQtyInBaseUnit AS MatlStkChangeQtyInBaseUnit,
  matdoc.CompanyCodeCurrency AS CompanyCodeCurrency,
  matdoc.PurchaseOrder AS PurchaseOrder,
  matdoc.PurchaseOrderItem AS PurchaseOrderItem,
  matdoc.ManufacturingOrder AS ManufacturingOrder,
  matdoc.ManufacturingOrderItem AS ManufacturingOrderItem,
  matdoc.DeliveryDocument AS DeliveryDocument,
  matdoc.DeliveryDocumentItem AS DeliveryDocumentItem,
  matdoc.Reservation AS Reservation,
  matdoc.ReservationItem AS ReservationItem,
  matdoc.GoodsMovementType AS GoodsMovementType,
  matdoc.GoodsMovementRefDocType AS GoodsMovementRefDocType,
  matdoc.GoodsReceiptType AS GoodsReceiptType,
  matdoc.ConsumptionPosting AS ConsumptionPosting,
  matdoc.PostingDate AS CompanyCode0asStockLevelIsValuated,
  acdoca.AccountingDocument AS AccountingDocument,
  acdoca.FiscalYear AS FiscalYear,
  acdoca.AmountInCompanyCodeCurrency AS AmountInCompanyCodeCurrency,
  acdoca.PostingDate AS xleadingX1asStockLevelIsValuated,
  acdoca.PostingDate AS PostingDate
FROM I_MaterialDocumentRecord AS matdoc
INNER JOIN I_MaterialDocumentRecord AS _matdoc ON /* join condition not captured in parsed metadata */
INNER JOIN finsc_ledger ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_StkPostgHistAcctgNoStkQty, I_GLAccountLineItemRawData
;