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 Pphmrp_Error_Mats.
-- 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: PPHMRP_ERR_MATS
-- Parameters: P_Language : sylangu, P_Uname : syuname
CREATE VIEW Pphmrp_Error_Mats AS
SELECT
d.matnr AS MaterialID,
d.werks AS MRPPlant,
cast(coalesce(makt.maktx, '') as maktx) AS MaterialDescription,
cast(max(t001w.name1) as name1) AS MRPPlantName,
cast(max(d.berid) as berid) AS MRPArea,
case mdlv.berty when '01' then cast(max(marc.dispo) as dispo) else cast(max(mdma.dispo) as dispo) end as MRPControllerID AS dispoasdispoendasMRPControllerID,
case mdlv.berty when '01' then cast(coalesce(t024d.dsnam, '') as dsnam) else cast(coalesce(t024d_mdma.dsnam, '') as dsnam) end as MRPControllerName AS dsnamasdsnamendasMRPControllerName,
cast(max(d.dstmp) as dstmp) AS LastMRPRun,
cast(max(d.lstmp) as ustmp) AS LastPlngFileEntryUpdate,
case mdlv.berty when '01' then cast(max(marc.dismm) as dismm) else cast(max(mdma.dismm) as dismm) end as MRPType AS dismmasdismmendasMRPType,
case mdlv.berty when '01' then cast(coalesce(t438t.dibez, '') as dibez) else cast(coalesce(t438t_mdma.dibez, '') as dibez) end as MRPTypeDesc AS dibezasdibezendasMRPTypeDesc,
case mdlv.berty when '01' then cast(max(marc.disls) as disls) else cast(max(mdma.disls) as disls) end as MRPLotSizeProcedure AS dislsasdislsendasMRPLotSizeProcedure,
case mdlv.berty when '01' then cast(coalesce(t439t.loslt, '') as loslt) else cast(coalesce(t439t_mdma.loslt, '') as loslt) end as MRPLotSizeProcedureDesc AS losltaslosltendasMRPLotSizeProcedureDesc,
d.msgid AS MessageID,
cast(min(d.msgty) as msgty) AS MessageType,
coalesce(dd07v.ddtext, '') AS MessageTypeText,
d.msgno AS MessageNumber,
max(d.msgv1) AS MessageVar1,
max(d.msgv2) AS MessageVar2,
max(d.msgv3) AS MessageVar3,
max(d.msgv4) AS MessageVar4,
coalesce( cast(t100.text as abap.char( 100 ) ), '' ) AS MessageText
FROM pph_dbvm AS d
INNER JOIN t001w ON /* join condition not captured in parsed metadata */
INNER JOIN mara ON /* join condition not captured in parsed metadata */
INNER JOIN marc ON /* join condition not captured in parsed metadata */
INNER JOIN mdlv ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN mdma ON /* join condition not captured in parsed metadata */
INNER JOIN sdm_aor AS aor ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t438t ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t439t ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t024d ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t024d AS t024d_mdma ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t439t AS t439t_mdma ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t438t AS t438t_mdma ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN makt ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN dd07v AS DD07V ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN t100 ON /* join condition not captured in parsed metadata */
;