P_EWM_HandlingUnitItem01

DDL: P_EWM_HANDLINGUNITITEM01 SQL: PEWMHUITEM01 Type: view COMPOSITE

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.

Data Sources (1)

SourceAliasJoin Type
I_EWM_HandlingUnitItem _HandlingUnitItem from

Associations (6)

CardinalityTargetAliasCondition
[0..1] P_EWM_HandlingUnitHeader02 _HandlingUnitHeader _HandlingUnitItem.ParentHandlingUnitUUID = _HandlingUnitHeader.HandlingUnitUUID
[0..1] I_EWM_StockWithMaterial _StockWithMaterial $projection.StockItemUUID = _StockWithMaterial.StockItemUUID
[0..1] I_EWM_StockWithMaterialAndBat _StockWithMaterialAndBatch $projection.StockItemUUID = _StockWithMaterialAndBatch.StockItemUUID
[0..1] I_EWM_StockWithReferenceDoc _StockWitRefDoc $projection.StockItemUUID = _StockWitRefDoc.StockItemUUID
[0..1] I_EWM_StockWithSalesOrdOrProj _StockWithProjectOrSalesOrder $projection.StockItemUUID = _StockWithProjectOrSalesOrder.StockItemUUID
[1..1] I_BusinessPartner _BusinessPartner $projection.EntitledToDisposeParty = _BusinessPartner.BusinessPartner

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PEWMHUITEM01 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor P_EWM_HandlingUnitItem01_2 view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY HandlingUnitExternalID _HandlingUnitHeader HandlingUnitExternalID
KEY Warehouse _HandlingUnitHeader Warehouse
KEY StockItemUUID I_EWM_HandlingUnitItem StockItemUUID
DeliveryCategory I_EWM_HandlingUnitItem DeliveryCategory
DeliveryUUID I_EWM_HandlingUnitItem DeliveryUUID
DeliveryItemUUID I_EWM_HandlingUnitItem DeliveryItemUUID
ProductUUIDendasProductUUID
BatchUUIDendasBatchUUID
HandlingUnitQuantity I_EWM_HandlingUnitItem HandlingUnitQuantity
HandlingUnitBaseUnitOfMeasure I_EWM_HandlingUnitItem HandlingUnitBaseUnitOfMeasure
HandlingUnitAltUnitOfMeasure I_EWM_HandlingUnitItem HandlingUnitAltUnitOfMeasure
ShelfLifeExpirationDate I_EWM_HandlingUnitItem ShelfLifeExpirationDate
GoodsReceiptUTCDateTime I_EWM_HandlingUnitItem GoodsReceiptUTCDateTime
CountryOfOrigin I_EWM_HandlingUnitItem CountryOfOrigin
ParentHandlingUnitUUID I_EWM_HandlingUnitItem ParentHandlingUnitUUID
LastChangeUTCDateTime _HandlingUnitHeader LastChangeUTCDateTime
_BusinessPartner _BusinessPartner
@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'

define view P_EWM_HandlingUnitItem01
  as select from I_EWM_HandlingUnitItem as _HandlingUnitItem

  // It could be possible that the HU Header in the /LIME/NQUAN is not 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 Order or 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
      end as ProductUUID,

      case _HandlingUnitItem.CurrentNumberOfKeyTable
      //      when 'W01' then cast( 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
      end as BatchUUID,

      case _HandlingUnitItem.CurrentNumberOfKeyTable
        when 'W01' then _StockWithMaterial.EntitledToDisposeParty
        when 'W02' then _StockWithMaterialAndBatch.EntitledToDisposeParty
        when 'W03' then _StockWitRefDoc.EntitledToDisposeParty
        when 'W04' then _StockWithProjectOrSalesOrder.EntitledToDisposeParty
      end as EntitledToDisposeParty,

      _HandlingUnitItem.HandlingUnitQuantity,
      _HandlingUnitItem.HandlingUnitBaseUnitOfMeasure,
      _HandlingUnitItem.HandlingUnitAltUnitOfMeasure,
      _HandlingUnitItem.ShelfLifeExpirationDate,
      _HandlingUnitItem.GoodsReceiptUTCDateTime,
      _HandlingUnitItem.CountryOfOrigin,
      _HandlingUnitItem.ParentHandlingUnitUUID,
      _HandlingUnitHeader.LastChangeUTCDateTime,

      // Associations

      _BusinessPartner
}
where
      _HandlingUnitHeader.HandlingUnitExternalID is not initial
  and _HandlingUnitHeader.Warehouse              is not 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":""
}
}*/