C_MRPSalesOrderCard is a Consumption CDS View that provides data about "MRP Sales Order" in SAP S/4HANA. It reads from 1 data source (I_MRPSalesOrder) and exposes 55 fields with key fields SalesOrder, SalesOrderItem, SalesOrderScheduleLine. It has 2 associations to related views. It is exposed through 5 OData services (ASQL_F0246A, ASQL_F0263A, ASQL_F7681, ...). Part of development package ODATA_PP_MRP.
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_MRPSalesOrderCard.-- 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 C_MRPSalesOrderCard ASSELECT
I_MRPSalesOrder.SalesOrder AS SalesOrder,
I_MRPSalesOrder.SalesOrderItem AS SalesOrderItem,
I_MRPSalesOrder.ScheduleLine AS SalesOrderScheduleLine,
I_MRPSalesOrder.SalesOrder AS SDDocument,
cast ( 'VC' as delkz preserving type ) AS MRPElementCategory,
I_MRPSalesOrder.MRPPlant AS MRPPlant,
I_MRPSalesOrder.Material AS Material,
I_MRPSalesOrder.MaterialName AS MaterialName,
cast( I_MRPSalesOrder.DeliveryIsBlocked as lifsd_x ) AS DeliveryIsBlocked,
I_MRPSalesOrder.BaseUnit AS BaseUnit,
I_MRPSalesOrder.SalesUnit AS SalesUnit,
casewhen I_MRPSalesOrder.OpenReqdDelivQtyInBaseUnit > 0 then I_MRPSalesOrder.CorrectedQtyInBaseUnit - I_MRPSalesOrder.OpenReqdDelivQtyInBaseUnit elsecast(0 as abap.quan( 13, 3 )) endas DeliveredQuantityInBaseUnit AS quan133endasDeliveredQuantityInBaseUnit,
I_MRPSalesOrder.CorrectedQtyInBaseUnit AS CorrectedQtyInBaseUnit,
I_MRPSalesOrder.OpenQuantity AS OpenQuantity,
I_MRPSalesOrder.Customer AS Customer,
I_MRPSalesOrder.CustomerName AS CustomerName,
cast('' as ad_namtext) AS ContactPersonName,
cast('' as ad_tlnmbr1) AS ContactPersonPhoneNumber,
cast('' as ad_smtpadr) AS InternalContactEmailAddress,
I_MRPSalesOrder.SalesOrderDate AS SalesOrderDate,
I_MRPSalesOrder.ProductAvailabilityDate AS ProductAvailabilityDate,
I_MRPSalesOrder.RequestedDeliveryDate AS RequestedDeliveryDate,
I_MRPSalesOrder.LoadingDate AS LoadingDate,
I_MRPSalesOrder.DeliveryPriority AS DeliveryPriority,
I_MRPSalesOrder.DeliveryPriorityDesc AS DeliveryPriorityDesc,
I_MRPSalesOrder.DeliveryBlockReason AS DeliveryBlockReason,
_DeliveryBlockReason._Text[1: Language = $session.system_language ].DeliveryBlockReasonText AS DeliveryBlockReasonText,
I_MRPSalesOrder.MaterialByCustomer AS MaterialByCustomer,
I_MRPSalesOrder.WBSElementInternalID AS WBSElementInternalID,
I_MRPSalesOrder._WBSElementBasicData.WBSElementExternalID AS WBSElementExternalID,
I_MRPSalesOrder._WBSElementBasicData.WBSDescription AS WBSDescription,
cast( _ProjectRespPersn.PersonWorkAgreement as ps_s4_vernr preserving type ) AS ResponsiblePerson,
_ProjectRespPersn._WorkforcePerson.PersonFullName AS ResponsiblePersonName,
I_MRPSalesOrder._WBSElementBasicData._Project.ProjectExternalID AS ProjectExternalID,
I_MRPSalesOrder._WBSElementBasicData._Project.ProjectDescription AS ProjectDescription,
cast( concat( concat( ltrim( I_MRPSalesOrder.SalesOrder, '0' ), '-' ), ltrim( I_MRPSalesOrder.SalesOrderItem, '0' ) ) as char16 ) AS UICT_SalesOrderItemText,
cast ( casewhen Customer is initial then 'X' else '' endas boolean preserving type ) AS UICT_Customer,
cast ( '' as boolean preserving type ) AS UICT_ContactPersonName,
cast ( '' as boolean preserving type ) AS UICT_ContactPersonPhoneNumber,
cast ( '' as boolean preserving type ) AS UICT_IntContactEmailAddress,
cast ( casewhen SalesOrderDate is initial then 'X' else '' endas boolean preserving type ) AS UICT_SalesOrderDate,
cast ( casewhen ProductAvailabilityDate is initial then 'X' else '' endas boolean preserving type ) AS UICT_ProductAvailabilityDate,
cast ( casewhen LoadingDate is initial then 'X' else '' endas boolean preserving type ) AS UICT_RequestedLoadingDate,
cast ( casewhen OrderQuantity is initial then 'X' else '' endas boolean preserving type ) AS UICT_OrderQuantity,
cast ( casewhen OpenQuantity is initial then 'X' else '' endas boolean preserving type ) AS UICT_OpenQuantity,
cast ( casewhen DeliveryPriority is initial then 'X' else '' endas boolean preserving type ) AS UICT_DeliveryPriority,
cast ( casewhen DeliveryBlockReason is initial then 'X' else '' endas boolean preserving type ) AS UICT_DeliveryBlockReason,
cast ( casewhen MaterialByCustomer is initial then 'X' else '' endas boolean preserving type ) AS UICT_MaterialByCustomer,
cast ( casewhen SalesOrder is initial then 'X' else '' endas boolean preserving type ) AS UICT_SalesOrder,
cast ( casewhen Material is initial then 'X' else '' endas boolean preserving type ) AS UICT_Material,
cast ( '' as boolean preserving type ) AS UICT_WBSElement,
cast ( '' as boolean preserving type ) AS UICT_ResponsiblePerson,
cast ( '' as boolean preserving type ) AS UICT_Project,
cast ( '' as abap.char( 25 ) ) AS UICT_DeliveryIsBlocked
FROM I_MRPSalesOrder
LEFTOUTERJOIN C_Salesorderfs AS _SalesOrder ON SalesOrder = _SalesOrder.SalesOrder -- association [1..1]LEFTOUTERJOIN I_MRPElementCategoryText AS _MRPElementCategoryText ON _MRPElementCategoryText.MRPElementCategory = 'VC' AND _MRPElementCategoryText.Language = $session.system_language -- association [0..1]
;