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 C_Customer360DeliveryDocument.
-- 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: CUST360BDRDEL
CREATE VIEW C_Customer360DeliveryDocument AS
SELECT
OutboundDelivery.OutboundDelivery AS OutboundDelivery,
OutboundDelivery.EU_DeliveryARCStatus AS EU_DeliveryARCStatus,
OutboundDelivery._ExciseTaxStatus._Text[1:Language = $session.system_language].EU_ARCStatusDesc AS EU_ARCStatusDesc,
cast(case when OutboundDelivery.DeliveryPriority = '00' then ' ' else OutboundDelivery.DeliveryPriority end as abap.numc(2) ) as DeliveryPriority AS numc2asDeliveryPriority,
OutboundDelivery._DeliveryPriority._Text[1:Language = $session.system_language].DeliveryPriorityDesc AS DeliveryPriorityDesc,
OutboundDelivery.PickingDate AS PickingDate,
OutboundDelivery.OverallPickingStatus AS OverallPickingStatus,
OutboundDelivery._OverallPickingStatus._Text[1:Language = $session.system_language].OverallPickingStatusDesc AS OverallPickingStatusDesc,
cast( case OutboundDelivery.OverallPickingStatus when '' then 0 when 'A' then 1 when 'B' then 2 when 'C' then 3 else 0 end as abap.int1 ) as PickingStatusCriticality AS int1asPickingStatusCriticality,
OutboundDelivery.OverallPickingConfStatus AS OverallPickingConfStatus,
OutboundDelivery._OverallPickingConfStatus._Text[1:Language = $session.system_language].OverallPickingConfStatusDesc AS OverallPickingConfStatusDesc,
cast( case OutboundDelivery.OverallPickingConfStatus when '' then 0 when 'A' then 1 when 'B' then 2 when 'C' then 3 else 0 end as abap.int1 ) as ConfirmationStatusCriticality AS int1asConfirmationStatusCriticality,
_FreightOrder.FreightOrder AS FreightOrder,
OutboundDelivery.OverallGoodsMovementStatus AS OverallGoodsMovementStatus,
OutboundDelivery._OverallGoodsMovementStatus._Text[1:Language = $session.system_language].OverallGoodsMovementStatusDesc AS OverallGoodsMovementStatusDesc,
cast( case OutboundDelivery.OverallGoodsMovementStatus when '' then 0 when 'A' then 1 when 'B' then 2 when 'C' then 3 else 0 end as abap.int1 ) as GoodsMovementStatusCriticality AS int1asGoodsMovementStatusCriticality,
OutboundDelivery.ShipToParty AS ShipToParty,
OutboundDelivery._Partner[1:PartnerFunction='WE']._Address.FullName AS CustomerName,
OutboundDelivery.ShippingPoint AS ShippingPoint,
cast(OutboundDelivery._ShippingPoint._Text[1: Language=$session.system_language].ShippingPointName as bezei30) AS ShippingPointName,
OutboundDelivery.ActualGoodsMovementDate AS ActualGoodsMovementDate,
cast (OutboundDelivery.PlannedGoodsIssueDate as wadak_plan) AS PlannedGoodsIssueDate,
OutboundDelivery.LoadingDate AS LoadingDate,
OutboundDelivery.CreatedByUser AS CreatedByUser,
_User.UserDescription AS UserDescription,
OutboundDelivery.DeliveryDocumentType AS DeliveryDocumentType,
cast(_DeliveryTypeVH._Text[1: Language=$session.system_language].DeliveryDocumentTypeName as vtext) AS DeliveryTypeName,
OutboundDelivery.CreationDate AS CreationDate,
OutboundDelivery.OverallChmlCmplncStatus AS OverallChmlCmplncStatus,
OutboundDelivery._OverallChmlCmplncStatus._Text[1:Language = $session.system_language].OverallChmlCmplncStatusDesc AS OverallChmlCmplncStatusDesc,
cast( case OutboundDelivery.OverallChmlCmplncStatus when '' then 0 when 'A' then 3 when 'C' then 1 when 'D' then 1 else 0 end as abap.int1 ) as OvrlChmlCmplncStsCriticality AS int1asOvrlChmlCmplncStsCriticality,
OutboundDelivery.OverallDangerousGoodsStatus AS OverallDangerousGoodsStatus,
OutboundDelivery._OverallDangerousGoodsStatus._Text[1:Language = $session.system_language].OverallDangerousGoodsStsDesc AS OverallDangerousGoodsStsDesc,
cast( case OutboundDelivery.OverallDangerousGoodsStatus when '' then 0 when 'A' then 3 when 'B' then 2 when 'D' then 1 else 0 end as abap.int1 ) as OvrlDngrsGdsStsCriticality AS int1asOvrlDngrsGdsStsCriticality,
OutboundDelivery.OverallSafetyDataSheetStatus AS OverallSafetyDataSheetStatus,
OutboundDelivery._OvrlSftyDataSheetSts._Text[1:Language = $session.system_language].OverallSafetyDataSheetStsDesc AS OverallSafetyDataSheetStsDesc,
cast( case OutboundDelivery.OverallSafetyDataSheetStatus when '' then 0 when 'A' then 3 when 'B' then 2 when 'D' then 1 else 0 end as abap.int1 ) as OvrlSftyDataSheetStsCritlty AS int1asOvrlSftyDataSheetStsCritlty,
OutboundDelivery.ReadyForWarehouseExecStatus AS ReadyForWarehouseExecStatus,
OutboundDelivery._WarehouseExecutionStatus._Text[1:Language = $session.system_language].SafetyDataSheetStatusDesc AS SafetyDataSheetStatusDesc,
OutboundDelivery.DelivAdvncdShipgRcvgRlvnce AS DelivAdvncdShipgRcvgRlvnce,
OutboundDelivery._DelivAdvncdShipgRcvgRlvnce._Text[1:Language = $session.system_language].DelivAdvncdShipgRcvgRlvnceDesc AS DelivAdvncdShipgRcvgRlvnceDesc,
OutboundDelivery.ProposedDeliveryRoute AS ProposedDeliveryRoute,
OutboundDelivery._ProposedDeliveryRoute._Text[1:Language = $session.system_language].RouteName AS RouteName,
OutboundDelivery._ShipToParty AS _ShipToParty,
OutboundDelivery._ShippingPoint AS _ShippingPoint,
OutboundDelivery._OverallChmlCmplncStatus AS _OverallChmlCmplncStatus,
OutboundDelivery._OverallDangerousGoodsStatus AS _OverallDangerousGoodsStatus,
OutboundDelivery._OvrlSftyDataSheetSts AS _OvrlSftyDataSheetSts,
OutboundDelivery._ExciseTaxStatus AS _ExciseTaxStatus,
OutboundDelivery._WarehouseExecutionStatus AS _WarehouseExecutionStatus,
OutboundDelivery._DelivAdvncdShipgRcvgRlvnce AS _DelivAdvncdShipgRcvgRlvnce,
OutboundDelivery._ProposedDeliveryRoute AS _ProposedDeliveryRoute
FROM I_OutboundDelivery AS OutboundDelivery
INNER JOIN I_Customer360BusDocSetting AS Customer360BusDocSetting ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN C_DeliveryShipToPartyVH AS _DeliveryShipToPartyVH ON ShipToParty = _DeliveryShipToPartyVH.Customer -- association [0..*]
LEFT OUTER JOIN I_DeliveryPriority AS _DeliveryPriority ON DeliveryPriority = _DeliveryPriority.DeliveryPriority -- association [0..1]
LEFT OUTER JOIN C_ShippingPointVH AS _ShippingPointVH ON ShippingPoint = _ShippingPointVH.ShippingPoint -- association [0..1]
LEFT OUTER JOIN C_OutboundDeliveryTypeVH AS _DeliveryTypeVH ON DeliveryDocumentType = _DeliveryTypeVH.DeliveryDocumentType -- association [0..1]
LEFT OUTER JOIN I_User AS _User ON CreatedByUser = _User.UserID -- association [0..1]
LEFT OUTER JOIN C_OutbDelivFirstFreightOrd AS _FreightOrder ON OutboundDelivery = _FreightOrder.DeliveryDocument -- association [0..*]
;