I_HandlingUnitValueHelp

DDL: I_HANDLINGUNITVALUEHELP Type: view_entity COMPOSITE

HU ID and WH

I_HandlingUnitValueHelp is a Composite CDS View that provides data about "HU ID and WH" in SAP S/4HANA. It reads from 4 data sources (I_HandlingUnitHeader, P_EWM_HandlingUnitHeader02, I_HandlingUnitHeader, I_HandlingUnitHeader) and exposes 13 fields with key fields HandlingUnitExternalID, Warehouse, Warehouse, Warehouse, Warehouse. It has 6 associations to related views.

Data Sources (4)

SourceAliasJoin Type
I_HandlingUnitHeader ERPHeader from
P_EWM_HandlingUnitHeader02 EWMHeader union_all
I_HandlingUnitHeader vekp_decwhs union_all
I_HandlingUnitHeader vekp_ewm union_all

Associations (6)

CardinalityTargetAliasCondition
[0..1] I_HandlingUnitHeader _HandlingUnitParentHdr _HandlingUnitParentHdr.HandlingUnitInternalID = vekp_decwhs.HandlingUnitLowerLevelRefer
[0..1] I_UnitOfMeasure _WeightUnit _WeightUnit.UnitOfMeasure = vekp_ewm.WeightUnit
[0..1] I_UnitOfMeasure _WeightUnitTare _WeightUnitTare.UnitOfMeasure = vekp_ewm.HandlingUnitTareWeightUnit
[0..1] I_UnitOfMeasure _VolumeUnit _VolumeUnit.UnitOfMeasure = vekp_ewm.VolumeUnit
[0..1] I_UnitOfMeasure _VolumeUnitTare _VolumeUnitTare.UnitOfMeasure = vekp_ewm.HandlingUnitTareVolumeUnit
[0..1] I_UnitOfMeasure _UnitOfMeasureDimension _UnitOfMeasureDimension.UnitOfMeasure = vekp_ewm.UnitOfMeasureDimension

Annotations (9)

NameValueLevelField
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.authorizationCheck #CHECK view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.dataCategory #VALUE_HELP view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
EndUserText.label HU ID and WH view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY HandlingUnitExternalID I_HandlingUnitHeader HandlingUnitExternalID
KEY Warehouse
Plant Plant
HandlingUnitExternalID
KEY Warehouse
Plant I_HandlingUnitHeader Plant
HandlingUnitExternalID
KEY Warehouse ewm_whs Warehouse
Plant I_HandlingUnitHeader Plant
HandlingUnitExternalID
KEY Warehouse P_EWM_HandlingUnitHeader02 Warehouse
Plant
ShippingPoint
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@AccessControl.authorizationCheck: #CHECK
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.dataCategory: #VALUE_HELP
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@EndUserText.label: 'HU ID and WH'
define view entity I_HandlingUnitValueHelp
  // 1). select LO HUs for non-EWM and non-WM storage locations

  as select from I_HandlingUnitHeader as ERPHeader
{
  key ERPHeader.HandlingUnitExternalID,
  key cast('    ' as /scwm/lgnum) as Warehouse,

      @UI.hidden: true
      Plant,
      @UI.hidden: true
      ShippingPoint
}
where
  (
            HandlingUnitPackingObjectType != '00' //Not assigned to an object.

    and     HandlingUnitPackingObjectType != '02' //Sales document

    and     HandlingUnitPackingObjectType != '04' //Shipment

    and     HandlingUnitPackingObjectType != '05' //Non-Assigned HU

    and     HandlingUnitPackingObjectType != '06' //Non-Assigned HU

    and     HandlingUnitPackingObjectType != '21' //Cross-Outbound Delivery

    and     HandlingUnitPackingObjectType != '23' //Cross-Inbound Delivery

  )
  and(
            Warehouse                           is initial //only for S/4HANA Cloud! needs to be changed for onPrem

    and     HandlingUnitInternalStatus != '0060' //deleted


    //additional conditions to not show HUs that are managed by EWM

    and(
            //standalone HUs that are managed externally

            (
              HandlingUnitStockMgmtType != 'A'         //HU in system with IM stock -> HU is managed externally

              and HandlingUnitPackingObjectType = '12' //Non-Assigned HU -> standalone HU

            )
      or(
            HandlingUnitPackingObjectType       = '09' // Work Order - Finished Product

        or  HandlingUnitPackingObjectType       = '07' // Repititive Manufacturing

      )
      or(
            HandlingUnitPackingObjectType       = '01' // Outbound Delivery

        or  HandlingUnitPackingObjectType       = '03' // Inbound Delivery

      )
    )
  )

union all

// 2). select LO HUs for ext. WM storage locations - only for outbound deliveries

select from I_HandlingUnitHeader     as vekp_decwhs
  join      I_ERPWarehouseParameters as whs_param on whs_param.Warehouse                   = vekp_decwhs.Warehouse
                                                  and(
                                                    whs_param.HandlingUnitWarehouseType    = 'X'
                                                    or whs_param.HandlingUnitWarehouseType is initial
                                                  )

association [0..1] to I_HandlingUnitHeader as _HandlingUnitParentHdr on _HandlingUnitParentHdr.HandlingUnitInternalID = vekp_decwhs.HandlingUnitLowerLevelRefer

{
  key vekp_decwhs.HandlingUnitExternalID,
  key cast('    ' as /scwm/lgnum preserving type) as Warehouse,

      vekp_decwhs.Plant,

      vekp_decwhs.ShippingPoint

}
where
       vekp_decwhs.Warehouse                  is not initial
  and(
       vekp_decwhs.HandlingUnitPackingObjectType != '00' //Not assigned to an object.

    or vekp_decwhs.HandlingUnitPackingObjectType != '02' //Sales document

    or vekp_decwhs.HandlingUnitPackingObjectType != '04' //Shipment

    or vekp_decwhs.HandlingUnitPackingObjectType != '05' //Non-Assigned HU

    or vekp_decwhs.HandlingUnitPackingObjectType != '06' //Non-Assigned HU

    or vekp_decwhs.HandlingUnitPackingObjectType != '21' //Cross-Outbound Delivery

    or vekp_decwhs.HandlingUnitPackingObjectType != '23' //Cross-Inbound Delivery

  )
  and  vekp_decwhs.HandlingUnitInternalStatus <> '0060'

union all

// 3). select LO HUs for EWM storage locations - only for outbound deliveries

// - for inbound and standalone HUs EWM is master system,

// so for last ones we take them always from EWM and ignore LO ones

select from I_HandlingUnitHeader         as vekp_ewm
  join      I_ERPWarehouseParameters     as whs_param on  whs_param.Warehouse                 = vekp_ewm.Warehouse
                                                      and whs_param.HandlingUnitWarehouseType = 'E'
  join      I_ERPWarehouseToEWMWarehouse as ewm_whs   on ewm_whs.WarehouseERP = vekp_ewm.Warehouse

association [0..1] to I_UnitOfMeasure      as _WeightUnit             on _WeightUnit.UnitOfMeasure = vekp_ewm.WeightUnit
association [0..1] to I_UnitOfMeasure      as _WeightUnitTare         on _WeightUnitTare.UnitOfMeasure = vekp_ewm.HandlingUnitTareWeightUnit
association [0..1] to I_UnitOfMeasure      as _VolumeUnit             on _VolumeUnit.UnitOfMeasure = vekp_ewm.VolumeUnit
association [0..1] to I_UnitOfMeasure      as _VolumeUnitTare         on _VolumeUnitTare.UnitOfMeasure = vekp_ewm.HandlingUnitTareVolumeUnit
association [0..1] to I_UnitOfMeasure      as _UnitOfMeasureDimension on _UnitOfMeasureDimension.UnitOfMeasure = vekp_ewm.UnitOfMeasureDimension

association [0..1] to I_HandlingUnitHeader as _HandlingUnitParentHdr  on _HandlingUnitParentHdr.HandlingUnitInternalID = vekp_ewm.HandlingUnitLowerLevelRefer

{
  key vekp_ewm.HandlingUnitExternalID,
  key ewm_whs.Warehouse as Warehouse,

      vekp_ewm.Plant,
      vekp_ewm.ShippingPoint
}
where
      vekp_ewm.Warehouse                     is not initial
  and(
      vekp_ewm.HandlingUnitPackingObjectType =  '01'
    or // Outbound Delivery

      vekp_ewm.HandlingUnitPackingObjectType =  '21'
  )    // Cross-Outbound Delivery

  and vekp_ewm.HandlingUnitInternalStatus    <> '0060'

union all

// 4). select EWM HUs

select from P_EWM_HandlingUnitHeader02 as EWMHeader
{
  key EWMHeader.HandlingUnitExternalID,
  key EWMHeader.Warehouse,

      cast('    ' as hum_werks) as Plant,
      cast('    ' as vstel)     as ShippingPoint
}
where
  EWMHeader.HandlingUnitStatus != 'D' //deleted

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ERPWAREHOUSEPARAMETERS",
"I_ERPWAREHOUSETOEWMWAREHOUSE",
"I_HANDLINGUNITHEADER",
"P_EWM_HANDLINGUNITHEADER02"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/