P_EWM_HandlingUnitItem01_2 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_EWM_HandlingUnitItem) and exposes 15 fields with key fields EWMWarehouse, HandlingUnitNumber, ParentHandlingUnitUUID, StockItemUUID. It has 5 associations to related views.
@AbapCatalog.viewEnhancementCategory: [#NONE]@AccessControl.authorizationCheck: #NOT_REQUIRED@Metadata.ignorePropagatedAnnotations: true@VDM.viewType: #COMPOSITE@VDM.private: true@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XL,
dataClass: #MIXED
}/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */defineviewentity P_EWM_HandlingUnitItem01_2
asselectfrom I_EWM_HandlingUnitItem
association [0..1] to I_EWM_HandlingUnitHdr_2 as _Header on $projection.ParentHandlingUnitUUID = _Header.HandlingUnitUUID
and(
_Header.HandlingUnitIndicator = ''
or _Header.HandlingUnitIndicator = 'B'
)
// Simple Stock Info
association [0..1] to I_EWM_StockWithMaterial_2 as _StockWithMaterial on $projection.StockItemUUID = _StockWithMaterial.StockItemUUID
// Stock is Batch relevant
association [0..1] to I_EWM_StkWthMatlAndBat_2 as _StockWithMaterialAndBatch on $projection.StockItemUUID = _StockWithMaterialAndBatch.StockItemUUID
// Stock based on Reference Documents --> PDI/PDO
association [0..1] to I_EWM_StockWithReferenceDoc_2 as _StockWitRefDoc on $projection.StockItemUUID = _StockWitRefDoc.StockItemUUID
// Sales Orderor Project Stock
association [0..1] to I_EWM_StkWithSalesOrdOrProj_2 as _StockWithProjectOrSalesOrder on $projection.StockItemUUID = _StockWithProjectOrSalesOrder.StockItemUUID
{
key _Header.EWMWarehouse,
key _Header.HandlingUnitNumber,
key ParentHandlingUnitUUID,
key StockItemUUID,
CurrentNumberOfKeyTable,
DeliveryCategory,
EWMDocumentCategory,
DeliveryUUID,
DeliveryItemUUID,
case CurrentNumberOfKeyTable
when 'W01' thencast( _StockWithMaterial.ProductUUID as /scwm/de_matid_noconv preserving type )
when 'W02' thencast( _StockWithMaterialAndBatch.ProductUUID as /scwm/de_matid_noconv preserving type )
when 'W03' thencast( _StockWitRefDoc.ProductUUID as /scwm/de_matid_noconv preserving type )
when 'W04' thencast( _StockWithProjectOrSalesOrder.ProductUUID as /scwm/de_matid_noconv preserving type )
elsecast( hextobin('00000000000000000000000000000000') as /scwm/de_matid_noconv preserving type )
endas ProductUUID,
case CurrentNumberOfKeyTable
when 'W02' then _StockWithMaterialAndBatch.BatchUUID
when 'W03' then _StockWitRefDoc.BatchUUID
when 'W04' then _StockWithProjectOrSalesOrder.BatchUUID
elsecast( hextobin('00000000000000000000000000000000') as /scwm/de_batchid preserving type )
endas BatchUUID,
case CurrentNumberOfKeyTable
when 'W02' then bintohex( _StockWithMaterialAndBatch.BatchUUID )
when 'W03' then bintohex( _StockWitRefDoc.BatchUUID )
when 'W04' then bintohex( _StockWithProjectOrSalesOrder.BatchUUID )
else '00000000000000000000000000000000'
endas BatchUUIDHex,
case CurrentNumberOfKeyTable
when 'W01' then _StockWithMaterial.EntitledToDisposeParty
when 'W02' then _StockWithMaterialAndBatch.EntitledToDisposeParty
when 'W03' then _StockWitRefDoc.EntitledToDisposeParty
when 'W04' then _StockWithProjectOrSalesOrder.EntitledToDisposeParty
elsecast( '' as /scwm/de_entitled )
endas EntitledToDisposeParty,
case CurrentNumberOfKeyTable
when 'W01' then _StockWithMaterial.EWMStockOwner
when 'W02' then _StockWithMaterialAndBatch.EWMStockOwner
when 'W03' then _StockWitRefDoc.EWMStockOwner
when 'W04' then _StockWithProjectOrSalesOrder.EWMStockOwner
elsecast( '' as /scwm/de_owner )
endas EWMStockOwner,
case CurrentNumberOfKeyTable
when 'W01' thencast( _StockWithMaterial.EWMStockType as /scwm/de_cat preserving type )
when 'W02' thencast( _StockWithMaterialAndBatch.EWMStockType as /scwm/de_cat preserving type )
when 'W03' thencast( _StockWitRefDoc.EWMStockType as /scwm/de_cat preserving type )
when 'W04' thencast( _StockWithProjectOrSalesOrder.EWMStockType as /scwm/de_cat preserving type )
elsecast( '' as /scwm/de_cat )
endas EWMStockType,
@Semantics.quantity.unitOfMeasure: 'HandlingUnitBaseUnitOfMeasure'
HandlingUnitQuantity,
HandlingUnitBaseUnitOfMeasure,
HandlingUnitAltUnitOfMeasure,
ShelfLifeExpirationDate,
GoodsReceiptUTCDateTime,
CountryOfOrigin
}
where
_Header.HandlingUnitNumber isnot initial
and _Header.EWMWarehouse isnot initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EWM_HANDLINGUNITHDR_2",
"I_EWM_HANDLINGUNITITEM",
"I_EWM_STKWITHSALESORDORPROJ_2",
"I_EWM_STKWTHMATLANDBAT_2",
"I_EWM_STOCKWITHMATERIAL_2",
"I_EWM_STOCKWITHREFERENCEDOC_2"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/