P_EWM_HandlingUnitHeader04_2 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_EWM_HandlingUnitHdr_2) and exposes 14 fields with key fields HandlingUnitNumber, EWMWarehouse. It has 1 association to related views.
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view P_EWM_HandlingUnitHeader04_2.-- Reconstructed from parsed metadata (data sources, associations, fields).-- SAP annotations are omitted and the structure is reformulated as SQL;-- this is a functional approximation, not the verbatim SAP source. Some join-- conditions may be unavailable and a few CDS constructs are kept as-is.CREATE VIEW P_EWM_HandlingUnitHeader04_2 ASSELECT
HandlingUnitNumber,
EWMWarehouse,
HandlingUnitUUID,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHU01'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_planned preserving type ) AS EWMHandlingUnitIsNotPlanned,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHU02'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_in_stock preserving type ) AS EWMHandlingUnitIsNotInStock,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHU04'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_unloaded preserving type ) AS EWMHandlingUnitIsNotUnloaded,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHU05'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_loaded preserving type ) AS EWMHandlingUnitIsNotLoaded,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHU06'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_assigned_to_tu preserving type ) AS EWMTranspUnitIsNotAssigned,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS1'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_cntnt_change_blck preserving type ) AS EWMHUContentChangeIsNotBlocked,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS2'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_movement_blocked preserving type ) AS EWMHUMvmntChangeIsNotBlocked,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS3'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_attrbt_chng_blck preserving type ) AS EWMHUAttrbtChngIsNotBlocked,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS4'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_posting_chng_blck preserving type ) AS EWMHUPostingChangeIsNotBlocked,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS5'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_blckd_by_customs preserving type ) AS EWMHUIsNotBlockedByCustoms,
cast( _HandlingUnitStatus[1:EWMHandlingUnitSystemStatus = 'IHUS8'].EWMHUSystemStatusIsInactive as ewm_de_hu_is_packed_for_ship preserving type ) AS EWMHUIsNotPackedForShipping
FROM I_EWM_HandlingUnitHdr_2
LEFTOUTERJOIN I_EWM_HandlingUnitStatus AS _HandlingUnitStatus ON HandlingUnitUUID = _HandlingUnitStatus.HandlingUnitUUID -- association [0..*]
;