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_Bpbapstatus.-- 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: PBPBAPSTATCREATE VIEW P_Bpbapstatus ASSELECT
dliid,
vbeln,
posnr,
quanity,
meins,
amount,
billdate,
description,
bill_mat,
source,
cpd_dliid,
casewhen cpd_dliid isnullthen 'A' when cpd_dliid isnotnulland P_Bpbapdata._diflow.fkdat <> '00000000' then 'C' when cpd_dliid isnotnulland P_Bpbapdata._diflow.dopen_x = 'X' and P_Bpbapdata._diflow.dopen_d = 'X' and P_Bpbapdata._diflow.dopen_space = ' ' and P_Bpbapdata._diflow.fkdat_active_x ='X' then 'C' when cpd_dliid isnotnulland P_Bpbapdata._diflow.dopen_x = ' ' and P_Bpbapdata._diflow.dopen_d = ' ' and P_Bpbapdata._diflow.dopen_space = ' ' and P_Bpbapdata._diflow.fkdat_active_x ='X' then 'C' when cpd_dliid isnotnulland P_Bpbapdata._diflow.dopen_x = ' ' and P_Bpbapdata._diflow.dopen_d = ' ' and P_Bpbapdata._diflow.dopen_space = ' ' and P_Bpbapdata._diflow.fkdat_active_x =' ' then 'A' when cpd_dliid isnotnulland P_Bpbapdata._diflow.dopen_x = 'X' and P_Bpbapdata._diflow.dopen_d = ' ' and P_Bpbapdata._diflow.dopen_space = ' ' and P_Bpbapdata._diflow.fkdat_active_x =' ' then 'A' when cpd_dliid isnotnulland P_Bpbapdata._diflow.dopen_x = 'X' and P_Bpbapdata._diflow.dopen_d = 'X' and P_Bpbapdata._diflow.dopen_space = ' ' and P_Bpbapdata._diflow.fkdat_active_x =' ' then 'A' else 'B' endas status AS fkdat_active_xthenAelseBendasstatus
FROM P_Bpbapdata
;