P_StkPostgHistBasicNoReversal
Stock posting history documents without reversal
P_StkPostgHistBasicNoReversal is a Composite CDS View that provides data about "Stock posting history documents without reversal" in SAP S/4HANA. It reads from 6 data sources and exposes 149 fields.
Data Sources (6)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialDocumentRecord | _matdoc | inner |
| P_StkPostgHistAcctgNoStkQty | acdoca | union_all |
| I_GLAccountLineItemRawData | acdoca | union_all |
| finsc_ledger | finsc_ledger | inner |
| I_MaterialDocumentRecord | matdoc | from |
| P_StkPostgHistCancelBasic | P_StkPostgHistCancelBasic | union_all |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StartDate | sydate | |
| P_EndDate | sydate |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Stock posting history documents without reversal | 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 (149)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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 | StorageLocation | |
| Batch | I_MaterialDocumentRecord | StockIdentifyingBatch | Lot No. | |
| Supplier | I_MaterialDocumentRecord | SpecialStockIdfgSupplier | Supplier | |
| SalesOrder | I_MaterialDocumentRecord | SpecialStockIdfgSalesOrder | SD Document | |
| SalesOrderItem | I_MaterialDocumentRecord | SpecialStockIdfgSalesOrderItem | Sales Order Item | |
| WBSElementInternalID | I_MaterialDocumentRecord | SpecialStockIdfgWBSElement | WBS Internal ID | |
| Customer | I_MaterialDocumentRecord | SpecialStockIdfgCustomer | Sold-to Party | |
| 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 | StorageLocation | |
| Batch | I_MaterialDocumentRecord | StockIdentifyingBatch | Lot No. | |
| Supplier | I_MaterialDocumentRecord | SpecialStockIdfgSupplier | Supplier | |
| SalesOrder | I_MaterialDocumentRecord | SpecialStockIdfgSalesOrder | SD Document | |
| SalesOrderItem | I_MaterialDocumentRecord | SpecialStockIdfgSalesOrderItem | Sales Order Item | |
| WBSElementInternalID | I_MaterialDocumentRecord | SpecialStockIdfgWBSElement | WBS Internal ID | |
| Customer | I_MaterialDocumentRecord | SpecialStockIdfgCustomer | Sold-to Party | |
| 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 | |
| P_StartDate | ||||
| 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 | Material | Product Sold | |
| Plant | I_MaterialDocumentRecord | Plant | Valuation Area | |
| StorageLocation | I_MaterialDocumentRecord | StorageLocation | StorageLocation | |
| Batch | I_MaterialDocumentRecord | Batch | Lot No. | |
| Supplier | I_MaterialDocumentRecord | Supplier | Supplier | |
| SalesOrder | I_MaterialDocumentRecord | SalesOrder | SD Document | |
| SalesOrderItem | I_MaterialDocumentRecord | SalesOrderItem | Sales Order Item | |
| WBSElementInternalID | I_MaterialDocumentRecord | WBSElementInternalID | WBS Internal ID | |
| Customer | I_MaterialDocumentRecord | Customer | Sold-to Party | |
| 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 | |
| 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 | StorageLocation | |||
| Batch | Lot No. | |||
| Supplier | Supplier | |||
| SalesOrder | SD Document | |||
| SalesOrderItem | Sales Order Item | |||
| WBSElementInternalID | WBS Internal ID | |||
| Customer | Sold-to Party | |||
| 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_StkPostgHistBasicNoReversal.
-- 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_StkPostgHistBasicNoReversal 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 P_StartDate,
matdoc.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, P_StkPostgHistCancelBasic, I_GLAccountLineItemRawData
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA