P_EWM_AvailableStock

DDL: P_EWM_AVAILABLESTOCK Type: view_entity COMPOSITE Package: VDM_EWM_CORE_RAP

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)

SourceAliasJoin Type
P_EWM_AvailableStock_Base _AvailableStock from

Associations (5)

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

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

KeyFieldSource TableSource FieldDescription
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]
;