P_EWM_HandlingUnitItem01 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_EWM_HandlingUnitItem) and exposes 17 fields with key fields HandlingUnitExternalID, Warehouse, StockItemUUID. It has 6 associations to related views.
@AbapCatalog.sqlViewName: 'PEWMHUITEM01'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED@ObjectModel.usageType.serviceQuality: #D@ObjectModel.usageType.sizeCategory: #M@ObjectModel.usageType.dataClass: #TRANSACTIONAL@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #COMPOSITE@VDM.private: true@VDM.lifecycle.status: #DEPRECATED@VDM.lifecycle.successor: 'P_EWM_HandlingUnitItem01_2'
defineview P_EWM_HandlingUnitItem01
asselectfrom I_EWM_HandlingUnitItem as _HandlingUnitItem
// It could be possible that the HU Header in the /LIME/NQUAN isnot an active/planned for inbound delivery HU
association [0..1] to P_EWM_HandlingUnitHeader02 as _HandlingUnitHeader on _HandlingUnitItem.ParentHandlingUnitUUID = _HandlingUnitHeader.HandlingUnitUUID
// Simple Stock Info
association [0..1] to I_EWM_StockWithMaterial as _StockWithMaterial on $projection.StockItemUUID = _StockWithMaterial.StockItemUUID
// Stock is Batch relevant
association [0..1] to I_EWM_StockWithMaterialAndBat as _StockWithMaterialAndBatch on $projection.StockItemUUID = _StockWithMaterialAndBatch.StockItemUUID
// Stock based on Reference Documents --> PDI/PDO
association [0..1] to I_EWM_StockWithReferenceDoc as _StockWitRefDoc on $projection.StockItemUUID = _StockWitRefDoc.StockItemUUID
// Sales Orderor Project Stock
association [0..1] to I_EWM_StockWithSalesOrdOrProj as _StockWithProjectOrSalesOrder on $projection.StockItemUUID = _StockWithProjectOrSalesOrder.StockItemUUID
association [1..1] to I_BusinessPartner as _BusinessPartner on $projection.EntitledToDisposeParty = _BusinessPartner.BusinessPartner
{
key _HandlingUnitHeader.HandlingUnitExternalID,
key _HandlingUnitHeader.Warehouse,
key _HandlingUnitItem.StockItemUUID,
_HandlingUnitItem.DeliveryCategory,
_HandlingUnitItem.DeliveryUUID,
_HandlingUnitItem.DeliveryItemUUID,
case _HandlingUnitItem.CurrentNumberOfKeyTable
when 'W01' then _StockWithMaterial.ProductUUID
when 'W02' then _StockWithMaterialAndBatch.ProductUUID
when 'W03' then _StockWitRefDoc.ProductUUID
when 'W04' then _StockWithProjectOrSalesOrder.ProductUUID
endas ProductUUID,
case _HandlingUnitItem.CurrentNumberOfKeyTable
// when 'W01' thencast( hextobin('00000000000000000000000000000000') as /scwm/de_batchid ) => Must be NULL otherwise, Not relevant Batches will be joined on P_EWM_HandlingUnitItem02
when 'W02' then _StockWithMaterialAndBatch.BatchUUID
when 'W03' then _StockWitRefDoc.BatchUUID
when 'W04' then _StockWithProjectOrSalesOrder.BatchUUID
endas BatchUUID,
case _HandlingUnitItem.CurrentNumberOfKeyTable
when 'W01' then _StockWithMaterial.EntitledToDisposeParty
when 'W02' then _StockWithMaterialAndBatch.EntitledToDisposeParty
when 'W03' then _StockWitRefDoc.EntitledToDisposeParty
when 'W04' then _StockWithProjectOrSalesOrder.EntitledToDisposeParty
endas EntitledToDisposeParty,
_HandlingUnitItem.HandlingUnitQuantity,
_HandlingUnitItem.HandlingUnitBaseUnitOfMeasure,
_HandlingUnitItem.HandlingUnitAltUnitOfMeasure,
_HandlingUnitItem.ShelfLifeExpirationDate,
_HandlingUnitItem.GoodsReceiptUTCDateTime,
_HandlingUnitItem.CountryOfOrigin,
_HandlingUnitItem.ParentHandlingUnitUUID,
_HandlingUnitHeader.LastChangeUTCDateTime,
// Associations
_BusinessPartner
}
where
_HandlingUnitHeader.HandlingUnitExternalID isnot initial
and _HandlingUnitHeader.Warehouse isnot initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EWM_HANDLINGUNITITEM",
"I_EWM_STOCKWITHMATERIAL",
"I_EWM_STOCKWITHMATERIALANDBAT",
"I_EWM_STOCKWITHREFERENCEDOC",
"I_EWM_STOCKWITHSALESORDORPROJ",
"P_EWM_HANDLINGUNITHEADER02"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_EWM_STOCKWITHMATERIAL",
"I_EWM_STOCKWITHMATERIALANDBAT",
"I_EWM_STOCKWITHREFERENCEDOC",
"I_EWM_STOCKWITHSALESORDORPROJ",
"P_EWM_HANDLINGUNITHEADER02"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/