P_SerialNumberStockDifference
Serialized Stock Difference
P_SerialNumberStockDifference is a Composite CDS View that provides data about "Serialized Stock Difference" in SAP S/4HANA. It reads from 2 data sources (P_SrlNmbrStockDiffSrlNmbrStock, P_SrlNmbrStockDiffMatlStock) and exposes 33 fields with key fields Material, Plant, Batch, StorageLocation, InventoryStockType. Part of development package ODATA_LO_SN_STOCK_QUANTITIES.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_SrlNmbrStockDiffSrlNmbrStock | _SrlNmbrQuanity | union_all |
| P_SrlNmbrStockDiffMatlStock | _StockQuantity | from |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Serialized Stock Difference | 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 (33)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | P_SrlNmbrStockDiffMatlStock | Material | Vehicle Model |
| KEY | Plant | P_SrlNmbrStockDiffMatlStock | Plant | Valuation Area |
| KEY | Batch | P_SrlNmbrStockDiffMatlStock | Batch | Lot No. |
| KEY | StorageLocation | P_SrlNmbrStockDiffMatlStock | StorageLocation | StorageLocation |
| KEY | InventoryStockType | P_SrlNmbrStockDiffMatlStock | InventoryStockType | Stock Type |
| KEY | InventorySpecialStockType | P_SrlNmbrStockDiffMatlStock | InventorySpecialStockType | Special Stock Type |
| KEY | Supplier | P_SrlNmbrStockDiffMatlStock | Supplier | Supplier |
| KEY | SalesOrder | P_SrlNmbrStockDiffMatlStock | SDDocument | SD Document |
| KEY | SalesOrderItem | P_SrlNmbrStockDiffMatlStock | SDDocumentItem | Sales Order Item |
| KEY | WBSElementInternalID | P_SrlNmbrStockDiffMatlStock | WBSElementInternalID | WBS Internal ID |
| KEY | Customer | P_SrlNmbrStockDiffMatlStock | Customer | Sold-to Party |
| KEY | StockOwner | P_SrlNmbrStockDiffMatlStock | SpecialStockIdfgStockOwner | Owner of stock |
| KEY | MaterialBaseUnit | P_SrlNmbrStockDiffMatlStock | MaterialBaseUnit | Valuation Unit |
| CompanyCode | P_SrlNmbrStockDiffMatlStock | CompanyCode | Receiver Company Code | |
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| SerialNumberQuantity | ||||
| Material | Vehicle Model | |||
| KEY | Plant | P_SrlNmbrStockDiffSrlNmbrStock | Plant | Valuation Area |
| KEY | Batch | P_SrlNmbrStockDiffSrlNmbrStock | Batch | Lot No. |
| KEY | StorageLocation | P_SrlNmbrStockDiffSrlNmbrStock | StorageLocation | StorageLocation |
| KEY | InventoryStockType | P_SrlNmbrStockDiffSrlNmbrStock | InventoryStockType | Stock Type |
| KEY | InventorySpecialStockType | P_SrlNmbrStockDiffSrlNmbrStock | InventorySpecialStockType | Special Stock Type |
| KEY | Supplier | P_SrlNmbrStockDiffSrlNmbrStock | Supplier | Supplier |
| KEY | SalesOrder | P_SrlNmbrStockDiffSrlNmbrStock | SalesOrder | SD Document |
| KEY | SalesOrderItem | P_SrlNmbrStockDiffSrlNmbrStock | SalesOrderItem | Sales Order Item |
| KEY | WBSElementInternalID | P_SrlNmbrStockDiffSrlNmbrStock | WBSElementInternalID | WBS Internal ID |
| KEY | Customer | P_SrlNmbrStockDiffSrlNmbrStock | Customer | Sold-to Party |
| KEY | StockOwner | P_SrlNmbrStockDiffSrlNmbrStock | StockOwner | Owner of stock |
| KEY | MaterialBaseUnit | P_SrlNmbrStockDiffSrlNmbrStock | MaterialBaseUnit | Valuation Unit |
| CompanyCode | P_SrlNmbrStockDiffSrlNmbrStock | CompanyCode | Receiver Company Code | |
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| SerialNumberQuantity | ||||
| SerialNumberProfile | P_SrlNmbrStockDiffSrlNmbrStock | SerialNumberProfile | SerialNoProfile |
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_SerialNumberStockDifference.
-- 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.
CREATE VIEW P_SerialNumberStockDifference AS
SELECT
_StockQuantity.Material AS Material,
_StockQuantity.Plant AS Plant,
_StockQuantity.Batch AS Batch,
_StockQuantity.StorageLocation AS StorageLocation,
_StockQuantity.InventoryStockType AS InventoryStockType,
_StockQuantity.InventorySpecialStockType AS InventorySpecialStockType,
_StockQuantity.Supplier AS Supplier,
_StockQuantity.SDDocument AS SalesOrder,
_StockQuantity.SDDocumentItem AS SalesOrderItem,
_StockQuantity.WBSElementInternalID AS WBSElementInternalID,
_StockQuantity.Customer AS Customer,
_StockQuantity.SpecialStockIdfgStockOwner AS StockOwner,
_StockQuantity.MaterialBaseUnit AS MaterialBaseUnit,
_StockQuantity.CompanyCode AS CompanyCode,
coalesce(_StockQuantity.MatlWrhsStkQtyInMatlBaseUnit, cast(0 as nsdm_stock_qty) ) AS MatlWrhsStkQtyInMatlBaseUnit,
cast(0 as nsdm_stock_qty) AS SerialNumberQuantity,
_SrlNmbrQuanity.SerialNumberProfile AS SerialNumberProfile
FROM P_SrlNmbrStockDiffMatlStock AS _StockQuantity
-- UNION ALL with additional select branch(es): P_SrlNmbrStockDiffSrlNmbrStock
;
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