P_EWM_AvailableStock
Helper View for Available Stock
P_EWM_AvailableStock is a Composite CDS View that provides data about "Helper View for Available Stock" in SAP S/4HANA. It reads from 1 data source (P_EWM_AvailableStock_Base) and exposes 29 fields with key fields EWMWarehouse, Product, Batch, EWMStockOwner, EntitledToDisposeParty. It has 5 associations to related views. Part of development package VDM_EWM_CORE_RAP.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_EWM_AvailableStock_Base | _AvailableStock | from |
Associations (5)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Product | _Material | _AvailableStock.ProductUUID = _Material.ProductUUID and _Material.ProdSupChnMgmtUUID22 is not initial |
| [0..1] | I_WBSElementBasicData | _WBSElementBasicData | _AvailableStock.StockDocumentCategory = 'PJS' and _AvailableStock.StockDocumentNumber = _WBSElementBasicData.WBSElementInternalID |
| [0..1] | I_EWM_WBSElementDecentralized | _WBSElementDecentralized | _AvailableStock.StockDocumentCategory = 'PJS' and _AvailableStock.WarehouseSystemIsDecentralized = 'X' and _AvailableStock.StockDocumentNumber = _WBSElementDecentralized.StockDocumentNumber |
| [0..*] | I_UnitOfMeasure | _UnitOfMeasure | 1 = 1 |
| [0..1] | P_EWM_QltyInspectionEmbedded | _EWMQualityInspection_emb | _AvailableStock.QualityInspectionDocUUID = _EWMQualityInspection_emb.QualityInspectionDocUUID and _AvailableStock.QualityInspecitionDocBin2Hex != '00000000000000000000000000000000' |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.sizeCategory | #L | view |
Fields (29)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | EWMWarehouse | EWMWarehouse | Warehouse No. | |
| KEY | Product | _Material | Product | Product Sold |
| KEY | Batch | Batch | Lot No. | |
| KEY | EWMStockOwner | EWMStockOwner | Character Field with Length 10 | |
| KEY | EntitledToDisposeParty | EntitledToDisposeParty | Disposal Party | |
| KEY | EWMStockType | EWMStockType | Stock Type | |
| KEY | EWMStockUsage | EWMStockUsage | Usage | |
| KEY | EWMDocumentCategory | EWMDocumentCategory | ||
| KEY | StockDocumentCategory | StockDocumentCategory | Special Reference Stock Type | |
| KEY | HandlingUnitExternalID | HandlingUnitNumber | ||
| KEY | EWMStorageBin | EWMStorageBin | Storage Bin | |
| KEY | EWMResource | EWMResource | ||
| KEY | TranspUnitInternalNumber | TranspUnitInternalNumber | ||
| EWMBatchIsInRestrictedUseStock | EWMBatchIsInRestrictedUseStock | |||
| EWMStorageType | EWMStorageType | Storage Type | ||
| AvailableEWMStockQty | AvailableEWMStockQty | |||
| EWMStockQuantityBaseUnit | EWMStockQuantityBaseUnit | |||
| EWMStockQtyBaseUnitISOCode | ||||
| StockKeepingAlternativeUoM | StockKeepingAlternativeUoM | |||
| StockKeepingAltvUnitISOCode | ||||
| GoodsReceiptUTCDateTime | GoodsReceiptUTCDateTime | |||
| ShelfLifeExpirationDate | ShelfLifeExpirationDate | SLED/BBD | ||
| EWMStockIsBlockedForInventory | EWMStockIsBlockedForInventory | |||
| CountryOfOrigin | CountryOfOrigin | Country/Region of Origin | ||
| EWMHUHasOpenWarehouseTask | HandlingUnitOpenTaskInd | |||
| WhseQualityInspectionType | WhseQualityInspectionType | |||
| QualityInspectionDocument | _EWMQualityInspection_emb | QualityInspectionDocument | ||
| ParentHandlingUnitUUID | ParentHandlingUnitUUID | |||
| StockItemUUID | StockItemUUID |
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_EWM_AvailableStock.
-- 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_EWM_AvailableStock AS
SELECT
EWMWarehouse,
_Material.Product AS Product,
Batch,
EWMStockOwner,
EntitledToDisposeParty,
EWMStockType,
EWMStockUsage,
EWMDocumentCategory,
StockDocumentCategory,
HandlingUnitNumber AS HandlingUnitExternalID,
EWMStorageBin,
EWMResource,
TranspUnitInternalNumber,
EWMBatchIsInRestrictedUseStock,
EWMStorageType,
AvailableEWMStockQty,
EWMStockQuantityBaseUnit,
_UnitOfMeasure[1: UnitOfMeasure = EWMStockQuantityBaseUnit].UnitOfMeasureISOCode AS EWMStockQtyBaseUnitISOCode,
StockKeepingAlternativeUoM,
_UnitOfMeasure[1: UnitOfMeasure = StockKeepingAlternativeUoM].UnitOfMeasureISOCode AS StockKeepingAltvUnitISOCode,
GoodsReceiptUTCDateTime,
ShelfLifeExpirationDate,
EWMStockIsBlockedForInventory,
CountryOfOrigin,
HandlingUnitOpenTaskInd AS EWMHUHasOpenWarehouseTask,
WhseQualityInspectionType,
_EWMQualityInspection_emb.QualityInspectionDocument AS QualityInspectionDocument,
ParentHandlingUnitUUID,
StockItemUUID
FROM P_EWM_AvailableStock_Base AS _AvailableStock
LEFT OUTER JOIN I_Product AS _Material ON _AvailableStock.ProductUUID = _Material.ProductUUID AND _Material.ProdSupChnMgmtUUID22 is not initial -- association [0..1]
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElementBasicData ON _AvailableStock.StockDocumentCategory = 'PJS' AND _AvailableStock.StockDocumentNumber = _WBSElementBasicData.WBSElementInternalID -- association [0..1]
LEFT OUTER JOIN I_EWM_WBSElementDecentralized AS _WBSElementDecentralized ON _AvailableStock.StockDocumentCategory = 'PJS' AND _AvailableStock.WarehouseSystemIsDecentralized = 'X' AND _AvailableStock.StockDocumentNumber = _WBSElementDecentralized.StockDocumentNumber -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _UnitOfMeasure ON 1 = 1 -- association [0..*]
LEFT OUTER JOIN P_EWM_QltyInspectionEmbedded AS _EWMQualityInspection_emb ON _AvailableStock.QualityInspectionDocUUID = _EWMQualityInspection_emb.QualityInspectionDocUUID AND _AvailableStock.QualityInspecitionDocBin2Hex != '00000000000000000000000000000000' -- association [0..1]
;
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