P_EWM_HandlingUnitItem01_2

DDL: P_EWM_HANDLINGUNITITEM01_2 Type: view_entity COMPOSITE

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.

Data Sources (1)

SourceAliasJoin Type
I_EWM_HandlingUnitItem I_EWM_HandlingUnitItem from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_EWM_HandlingUnitHdr_2 _Header $projection.ParentHandlingUnitUUID = _Header.HandlingUnitUUID and( _Header.HandlingUnitIndicator = '' or _Header.HandlingUnitIndicator = 'B' )
[0..1] I_EWM_StockWithMaterial_2 _StockWithMaterial $projection.StockItemUUID = _StockWithMaterial.StockItemUUID
[0..1] I_EWM_StkWthMatlAndBat_2 _StockWithMaterialAndBatch $projection.StockItemUUID = _StockWithMaterialAndBatch.StockItemUUID
[0..1] I_EWM_StockWithReferenceDoc_2 _StockWitRefDoc $projection.StockItemUUID = _StockWitRefDoc.StockItemUUID
[0..1] I_EWM_StkWithSalesOrdOrProj_2 _StockWithProjectOrSalesOrder $projection.StockItemUUID = _StockWithProjectOrSalesOrder.StockItemUUID

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY EWMWarehouse _Header EWMWarehouse
KEY HandlingUnitNumber _Header HandlingUnitNumber
KEY ParentHandlingUnitUUID ParentHandlingUnitUUID
KEY StockItemUUID StockItemUUID
CurrentNumberOfKeyTable CurrentNumberOfKeyTable
DeliveryCategory DeliveryCategory
EWMDocumentCategory EWMDocumentCategory
DeliveryUUID DeliveryUUID
DeliveryItemUUID DeliveryItemUUID
HandlingUnitQuantity HandlingUnitQuantity
HandlingUnitBaseUnitOfMeasure HandlingUnitBaseUnitOfMeasure
HandlingUnitAltUnitOfMeasure HandlingUnitAltUnitOfMeasure
ShelfLifeExpirationDate ShelfLifeExpirationDate
GoodsReceiptUTCDateTime GoodsReceiptUTCDateTime
CountryOfOrigin CountryOfOrigin
@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" ]  } */
define view entity P_EWM_HandlingUnitItem01_2
  as select from 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 Order or 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' then cast( _StockWithMaterial.ProductUUID as /scwm/de_matid_noconv preserving type )
        when 'W02' then cast( _StockWithMaterialAndBatch.ProductUUID as /scwm/de_matid_noconv preserving type )
        when 'W03' then cast( _StockWitRefDoc.ProductUUID as /scwm/de_matid_noconv preserving type )
        when 'W04' then cast( _StockWithProjectOrSalesOrder.ProductUUID as /scwm/de_matid_noconv preserving type )
        else cast( hextobin('00000000000000000000000000000000') as /scwm/de_matid_noconv preserving type )
      end as ProductUUID,

      case CurrentNumberOfKeyTable
        when 'W02' then _StockWithMaterialAndBatch.BatchUUID
        when 'W03' then _StockWitRefDoc.BatchUUID
        when 'W04' then _StockWithProjectOrSalesOrder.BatchUUID
        else cast( hextobin('00000000000000000000000000000000') as /scwm/de_batchid preserving type )
      end as BatchUUID,

      case CurrentNumberOfKeyTable
        when 'W02' then bintohex( _StockWithMaterialAndBatch.BatchUUID )
        when 'W03' then bintohex( _StockWitRefDoc.BatchUUID )
        when 'W04' then bintohex( _StockWithProjectOrSalesOrder.BatchUUID )
        else '00000000000000000000000000000000'
      end as BatchUUIDHex,

      case CurrentNumberOfKeyTable
        when 'W01' then _StockWithMaterial.EntitledToDisposeParty
        when 'W02' then _StockWithMaterialAndBatch.EntitledToDisposeParty
        when 'W03' then _StockWitRefDoc.EntitledToDisposeParty
        when 'W04' then _StockWithProjectOrSalesOrder.EntitledToDisposeParty
        else cast( '' as /scwm/de_entitled )
      end as EntitledToDisposeParty,

      case CurrentNumberOfKeyTable
        when 'W01' then _StockWithMaterial.EWMStockOwner
        when 'W02' then _StockWithMaterialAndBatch.EWMStockOwner
        when 'W03' then _StockWitRefDoc.EWMStockOwner
        when 'W04' then _StockWithProjectOrSalesOrder.EWMStockOwner
        else cast( '' as /scwm/de_owner )
      end as EWMStockOwner,

      case CurrentNumberOfKeyTable
        when 'W01' then cast( _StockWithMaterial.EWMStockType as /scwm/de_cat preserving type )
        when 'W02' then cast( _StockWithMaterialAndBatch.EWMStockType as /scwm/de_cat preserving type )
        when 'W03' then cast( _StockWitRefDoc.EWMStockType as /scwm/de_cat preserving type )
        when 'W04' then cast( _StockWithProjectOrSalesOrder.EWMStockType as /scwm/de_cat preserving type )
        else cast( '' as /scwm/de_cat )
      end as EWMStockType,

      @Semantics.quantity.unitOfMeasure: 'HandlingUnitBaseUnitOfMeasure'
      HandlingUnitQuantity,
      HandlingUnitBaseUnitOfMeasure,
      HandlingUnitAltUnitOfMeasure,
      ShelfLifeExpirationDate,
      GoodsReceiptUTCDateTime,
      CountryOfOrigin
}
where
      _Header.HandlingUnitNumber is not initial
  and _Header.EWMWarehouse       is not 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":""
}
}*/