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_InboundDeliveryItem.
-- 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.
-- SQL view name: PEWMINBDELIVITEM
CREATE VIEW P_EWM_InboundDeliveryItem AS
SELECT
InboundDeliveryUUID,
InboundDeliveryItemUUID,
Warehouse,
EWMWarehouse,
InboundDelivery,
EWMInboundDelivery,
InboundDeliveryItem,
EWMInboundDeliveryItem,
_InboundDeliveyHeader.InboundDeliveryDocumentType AS InboundDeliveryDocumentType,
DeliveryDocumentCategory,
DeliveryItemCategory,
EWMInboundDeliveryItemCategory,
InboundDeliveryItemType,
EWMInboundDeliveryItemType,
WarehouseProcessType,
WarehouseDoor,
StagingAreaGroup,
StagingArea,
StagingBay,
GoodsMovementBin,
Product,
Batch,
RequirementSegment,
StockSegment,
EntitledToDisposeParty,
StockOwner,
EWMStockOwner,
StockType,
EWMStockType,
QuantityUnit,
ProductQuantity,
CompletionStatus,
GoodsReceiptStatus,
LastChangeTime,
EWMDelivLastChangeUTCDateTime,
_InboundDeliveyHeader.ShipFromParty AS ShipFromParty,
_InboundDeliveyHeader.Carrier AS Carrier,
_InboundDeliveyHeader.ShipFromPartyName AS ShipFromPartyName,
_InboundDeliveyHeader.CarrierName AS CarrierName,
_DisposalParty.BusinessPartnerName AS NameOfEntitledToDisposeParty,
_Owner.BusinessPartnerName AS StockOwnerName,
tstmp_current_utctimestamp() AS CurrentUTCTimestamp,
_DeliveryItemDateTime[1:DeliveryDateTimeType = 'EPTAW' and DeliveryDateTimeCategory ='ACTUAL'].DeliveryRelatedEndDateTime AS ActualPutawayEndUTCDateTime,
_DeliveryItemDateTime[1:DeliveryDateTimeType = 'SGOODSRECPT'and DeliveryDateTimeCategory = 'ACTUAL'].DeliveryRelatedStartDateTime AS ActualGRStartUTCDateTime,
_DeliveryItemDateTime[1:DeliveryDateTimeType = 'SGOODSRECPT'and DeliveryDateTimeCategory = 'PLAN'].DeliveryRelatedStartDateTime AS PlannedGRStartUTCDateTime,
_DeliveryItemDateTime[1:DeliveryDateTimeType = 'EGOODSRECPT' and DeliveryDateTimeCategory ='ACTUAL'].DeliveryRelatedEndDateTime AS ActualGREndUTCDateTime,
_DeliveryItemDateTime[1:DeliveryDateTimeType = 'EGOODSRECPT' and DeliveryDateTimeCategory ='PLAN'].DeliveryRelatedEndDateTime AS PlannedGREndUTCDateTime,
_ItemStatus[1:DeliveryStatusType = 'DUN'].ValidityEndUTCDateTime AS UnloadingEndUTCDateTime,
_ItemStatus[1:DeliveryStatusType = 'DCO' and EWMDeliveryStatus = '9'].ValidityEndUTCDateTime AS InbDelivCompltnEndUTCDateTime,
_InboundDeliveyHeader._DeliveryDateTime[1:DeliveryDateTimeType = 'TINYARD'and DeliveryDateTimeCategory = 'ACTUAL' ].DeliveryRelatedEndDateTime AS ActualArrivalInYardUTCDateTime,
_InboundDeliveyHeader._DeliveryDateTime[1:DeliveryDateTimeType = 'TINYARD'and DeliveryDateTimeCategory = 'PLAN' ].DeliveryRelatedEndDateTime AS PlndArrivalInYardUTCDateTime,
_ItemStatus[1:DeliveryStatusType = 'DTU'].EWMDeliveryStatus AS TransportationUnitAssgmtStatus,
_ItemStatus[1:DeliveryStatusType = 'DEU'].EWMDeliveryStatus AS PlanningPutawayStatus,
_ItemStatus[1:DeliveryStatusType = 'DTL'].EWMDeliveryStatus AS CheckToleranceStatus,
_ItemStatus[1:DeliveryStatusType = 'DWG'].EWMDeliveryStatus AS GoodsMovementBlockStatus,
_ItemStatus[1:DeliveryStatusType = 'DQE'].EWMDeliveryStatus AS QualityMgmtInspectionStatus,
_ItemStatus[1:DeliveryStatusType = 'DQP'].EWMDeliveryStatus AS QualityMgmtInspPlngStatus,
_ItemStatus[1:DeliveryStatusType = 'DQS'].EWMDeliveryStatus AS QualityMgmtCountPlngStatus,
_ItemStatus[1:DeliveryStatusType = 'DPT'].EWMDeliveryStatus AS PutawayStatus,
_ItemStatus[1:DeliveryStatusType = 'DVQ'].EWMDeliveryStatus AS ValuationQtyAssignmentStatus,
_ItemStatus[1:DeliveryStatusType = 'DWV'].EWMDeliveryStatus AS ValueAddedServiceOrderStatus,
_ItemStatus[1:DeliveryStatusType = 'DUN'].EWMDeliveryStatus AS UnloadingStatus,
_ItemStatus[1:DeliveryStatusType = 'DTR'].EWMDeliveryStatus AS TransitStatus,
_ItemStatus[1:DeliveryStatusType = 'DWN'].EWMDeliveryStatus AS TransitProcedureStatus,
_ItemStatus[1:DeliveryStatusType = 'DTD'].EWMDeliveryStatus AS TransportationPlanningStatus,
_ItemStatus[1:DeliveryStatusType = 'DBO'].EWMDeliveryStatus AS OverallBlockStatus,
_ItemStatus[1:DeliveryStatusType = 'DBD'].EWMDeliveryStatus AS ItemInconsistencyBlkStatus,
_ItemStatus[1:DeliveryStatusType = 'DBT'].EWMDeliveryStatus AS TranspPlanBlockStatus,
_ItemStatus[1:DeliveryStatusType = 'DWA'].EWMDeliveryStatus AS WarehouseActivityStatus,
_whseControl.DisplayVolumeUnit AS DisplayVolumeUnit,
_whseControl.DisplayWeightUnit AS DisplayWeightUnit,
_Transportation.EWMMeansOfTransport AS MeansOfTransport,
_Transportation.EWMMeansOfTransport AS EWMMeansOfTransport,
_Transportation.EWMMeansOfTransportType AS MeansOfTransportType,
_Transportation.EWMMeansOfTransportType AS EWMMeansOfTransportType,
InbDelivItemCrtnUTCDateTime,
PlndGREndWhseTmznDateTime,
cast(substring(cast(PlndGREndWhseTmznDateTime as abap.char( 17 )), 1, 4) as /scwm/de_datetime_year) AS PlndGoodsReceiptWhseTmznYear,
cast(substring(cast(PlndGREndWhseTmznDateTime as abap.char( 17 )), 1, 6) as /scwm/de_datetime_mon) AS PlndGoodsReceiptWhseTmznMonth,
cast(substring(cast(PlndGREndWhseTmznDateTime as abap.char( 17 )), 1, 8) as /scwm/de_datetime_date) AS PlndGoodsReceiptWhseTmznDate,
cast(substring(cast(PlndGREndWhseTmznDateTime as abap.char( 17 )), 1, 10) as /scwm/de_datetime_hour) AS PlndGoodsReceiptWhseTmznHour,
cast(substring(cast(PlndGREndWhseTmznDateTime as abap.char( 17 )), 9, 6) as /scwm/de_datetime_time) AS PlndGoodsReceiptWhseTmznTime,
UnloadingEndWhseTmznDateTime,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 1, 4) as /scwm/de_datetime_year) AS UnloadingEndWhseTmznYear,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 1, 6) as /scwm/de_datetime_mon) AS UnloadingEndWhseTmznMonth,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 1, 8) as /scwm/de_datetime_date) AS UnloadingEndWhseTmznDate,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 1, 10) as /scwm/de_datetime_hour) AS UnloadingEndWhseTmznHour,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 9, 6) as /scwm/de_datetime_time) AS UnloadingEndWhseTmznTime,
PutawayEndWhseTmznDateTime,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 1, 4) as /scwm/de_datetime_year) AS PutawayEndWhseTmznYear,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 1, 6) as /scwm/de_datetime_mon) AS PutawayEndWhseTmznMonth,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 1, 8) as /scwm/de_datetime_date) AS PutawayEndWhseTmznDate,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 1, 10) as /scwm/de_datetime_hour) AS PutawayEndWhseTmznHour,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 9, 6) as /scwm/de_datetime_time) AS PutawayEndWhseTmznTime,
ActualGREndWhseTmznDateTime,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 1, 4) as /scwm/de_datetime_year) AS GoodsReceiptEndWhseTmznYear,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 1, 6) as /scwm/de_datetime_mon) AS GoodsReceiptEndWhseTmznMonth,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 1, 8) as /scwm/de_datetime_date) AS GoodsReceiptEndWhseTmznDate,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 1, 10) as /scwm/de_datetime_hour) AS GoodsReceiptEndWhseTmznHour,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 9, 6) as /scwm/de_datetime_time) AS GoodsReceiptEndWhseTmznTime,
InbDelivItmCmpltWhseTmznDteTme,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 1, 4) as /scwm/de_datetime_year) AS InbDelivCompltnEndWhseTmznYear,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 1, 6) as /scwm/de_datetime_mon) AS InbDelivCompltnEndWhseTmznMnth,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 1, 8) as /scwm/de_datetime_date) AS InbDelivCompltnEndWhseTmznDate,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 1, 10) as /scwm/de_datetime_hour) AS InbDelivCompltnEndWhseTmznHour,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 9, 6) as /scwm/de_datetime_time) AS InbDelivCompltnEndWhseTmznTime,
_InboundDeliveyHeader.InbDelivCrtnWhseTmznDateTime AS InbDelivCrtnWhseTmznDateTime,
_InboundDeliveyHeader.PlndDeliveryWhseTmznDateTime AS PlndDeliveryWhseTmznDateTime,
_InboundDeliveyHeader.ActualDeliveryWhseTmznDateTime AS ActualDeliveryWhseTmznDateTime,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznDteTme AS PlndArrvlInYardWhseTmznDteTme,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznDteTme AS ActlArrvlInYardWhseTmznDteTme,
_InboundDeliveyHeader.PlannedDeliveryWhseTmznYear AS PlannedDeliveryWhseTmznYear,
_InboundDeliveyHeader.PlannedDeliveryWhseTmznMonth AS PlannedDeliveryWhseTmznMonth,
_InboundDeliveyHeader.PlannedDeliveryWhseTmznDate AS PlannedDeliveryWhseTmznDate,
_InboundDeliveyHeader.PlannedDeliveryWhseTmznHour AS PlannedDeliveryWhseTmznHour,
_InboundDeliveyHeader.PlannedDeliveryWhseTmznTime AS PlannedDeliveryWhseTmznTime,
_InboundDeliveyHeader.ActualDeliveryWhseTmznYear AS ActualDeliveryWhseTmznYear,
_InboundDeliveyHeader.ActualDeliveryWhseTmznMonth AS ActualDeliveryWhseTmznMonth,
_InboundDeliveyHeader.ActualDeliveryWhseTmznDate AS ActualDeliveryWhseTmznDate,
_InboundDeliveyHeader.ActualDeliveryWhseTmznHour AS ActualDeliveryWhseTmznHour,
_InboundDeliveyHeader.ActualDeliveryWhseTmznTime AS ActualDeliveryWhseTmznTime,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznYear AS PlndArrvlInYardWhseTmznYear,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznMonth AS PlndArrvlInYardWhseTmznMonth,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznDate AS PlndArrvlInYardWhseTmznDate,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznHour AS PlndArrvlInYardWhseTmznHour,
_InboundDeliveyHeader.PlndArrvlInYardWhseTmznTime AS PlndArrvlInYardWhseTmznTime,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznYear AS ActlArrvlInYardWhseTmznYear,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznMonth AS ActlArrvlInYardWhseTmznMonth,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznDate AS ActlArrvlInYardWhseTmznDate,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznHour AS ActlArrvlInYardWhseTmznHour,
_InboundDeliveyHeader.ActlArrvlInYardWhseTmznTime AS ActlArrvlInYardWhseTmznTime,
_InboundDeliveyHeader.WhseTmznPlannedDeliverymins AS WhseTmznPlannedDeliverymins,
_InboundDeliveyHeader.WhseTmznPlndArrivalinYardmins AS WhseTmznPlndArrivalinYardmins,
_InboundDeliveyHeader.WhseTmznActualDeliverymins AS WhseTmznActualDeliverymins,
_InboundDeliveyHeader.WhseTmznActualArrvlinYardmins AS WhseTmznActualArrvlinYardmins,
_InboundDeliveyHeader.TimeZoneID AS TimeZoneID,
cast(substring(cast(InbDelivItemCrtnUTCDateTime as abap.char( 17 )), 11, 2) as abap.numc( 2 ) ) AS WhseTmznItemCreationmins,
cast(substring(cast(InbDelivItmCmpltWhseTmznDteTme as abap.char( 17 )), 11, 2) as abap.numc( 2 ) ) AS WhseTmznCompletionEndmins,
cast(substring(cast(ActualGREndWhseTmznDateTime as abap.char( 17 )), 11, 2) as abap.numc( 2 ) ) AS WhseTmznGoodsReceiptEndmins,
cast(substring(cast(PutawayEndWhseTmznDateTime as abap.char( 17 )), 11, 2) as abap.numc( 2 ) ) AS WhseTmznPutawayEndmins,
cast(substring(cast(UnloadingEndWhseTmznDateTime as abap.char( 17 )), 11, 2) as abap.numc( 2 ) ) AS WhseTmznUnloadingEndmins,
_ReceivingOffice.OrganizationalUnit AS ReceivingOffice,
_QuantityAdjustment.EWMDeliveryAdjustmentQuantity AS EWMDeliveryAdjustmentQuantity,
_InboundDeliveyHeader.EWMWarehouseCurrentDate AS EWMWarehouseCurrentDate
FROM I_EWM_InbDeliveryItemBasic
LEFT OUTER JOIN P_EWM_ProcessCodeDelivQtyChg AS _QuantityAdjustment ON InboundDeliveryUUID = _QuantityAdjustment.DeliveryUUID AND InboundDeliveryItemUUID = _QuantityAdjustment.DeliveryItemUUID AND _QuantityAdjustment.DeliveryDocumentCategory = 'PDI' -- association [0..1]
LEFT OUTER JOIN P_EWM_InboundDeliveryHeader AS _InboundDeliveyHeader ON InboundDeliveryUUID = _InboundDeliveyHeader.InboundDeliveryUUID -- association [0..1]
LEFT OUTER JOIN I_EWM_WhseReqTransportation AS _Transportation ON InboundDeliveryUUID = _Transportation.EWMWarehouseRequestUUID AND _Transportation.EWMWhseRequestDocumentCategory = 'PDI' -- association [0..1]
LEFT OUTER JOIN I_EWM_DeliveryBPLocation AS _ReceivingOffice ON InboundDeliveryUUID = _ReceivingOffice.OutboundDeliveryOrderUUID AND _ReceivingOffice.BusinessPartnerRole = 'SO' AND _ReceivingOffice.EWMDeliveryDocumentCategory = 'PDI' -- association [0..1]
LEFT OUTER JOIN I_EWM_WarehouseControl_2 AS _whseControl ON EWMWarehouse = _whseControl.EWMWarehouse -- association [0..1]
LEFT OUTER JOIN I_BusinessPartner AS _Owner ON StockOwner = _Owner.BusinessPartner -- association [0..1]
LEFT OUTER JOIN I_BusinessPartner AS _DisposalParty ON EntitledToDisposeParty = _DisposalParty.BusinessPartner -- association [0..1]
;