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 I_ProjectVersionData.
-- 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 I_ProjectVersionData AS
SELECT
cast ( vsproj_cn.pspnr as ps_s4_proj_pspnr preserving type ) AS ProjectInternalID,
cast ( vsproj_cn.vsnmr as ps_s4_vsnmr preserving type ) AS Version,
vsproj_cn.pspid_edit AS ProjectExternalID,
cast( vsproj_cn.pspid as cc_ps_pspid ) AS Project,
cast( vsproj_cn.post1 as ps_s4_proj_post1_v1 preserving type) AS ProjectDescription,
vsproj_cn.profl AS ProjectProfileCode,
cast ( vsproj_cn.vernr as ps_s4_vernr ) AS ResponsiblePerson,
cast ( vsproj_cn.verna as ps_s4_verna ) AS ResponsiblePersonName,
vsproj_cn.prctr AS ProfitCenter,
cast ( vsproj_cn.vkokr as kokrs ) AS ControllingArea,
cast ( vsproj_cn.plfaz as ps_plfaz_chg ) AS PlannedStartDate,
cast ( vsproj_cn.plsez as ps_plsez_chg ) AS PlannedEndDate,
cast ( vsproj_cn.loevm as ps_s4_loevm ) AS IsMarkedForDeletion,
cast ( vsproj_cn.astnr as ps_s4_astnr ) AS ApplicantCode,
vsproj_cn.objnr AS ProjectObject,
cast ( vsproj_cn.vgplf as ps_s4_vgplf ) AS PlanningMethForProjBasicDate,
cast ( vsproj_cn.ewplf as ps_s4_ewplf ) AS PlanningMethForProjFcstdDate,
cast ( vsproj_cn.vbukr as bukrs ) AS CompanyCode,
cast (vsproj_cn.ernam as ernam ) AS CreatedByUser,
cast (vsproj_cn.erdat as erdat) AS CreationDate,
cast ( vsproj_cn.aenam as ps_s4_aenam ) AS LastChangedByUser,
cast ( vsproj_cn.aedat as ps_s4_aedat ) AS LastChangeDate,
vsproj_cn.astna AS ApplicantName,
cast ( vsproj_cn.vgsbr as gsber ) AS BusinessArea,
vsproj_cn.werks AS Plant,
cast ( vsproj_cn.kostl as kostl ) AS CostCenter,
cast ( vsproj_cn.scope as ps_s4_scope_cv ) AS ControllingObjectClass,
cast ( vsproj_cn.pwhie as ps_pwhie ) AS Currency,
cast ( vsproj_cn.kalid as appca ) AS FactoryCalendar,
vsproj_cn.vprof AS NetworkProfile,
cast ( vsproj_cn.besta as psb_stock ) AS ProjectHasOwnStock,
vsproj_cn.xstat AS WBSIsStatisticalWBSElement,
cast ( vsproj_cn.txjcd as wb2_txjcd_busvol ) AS TaxJurisdiction,
cast ( vsproj_cn.zschm as ps_zschm ) AS ProjInterestCalcProfile,
vsproj_cn.imprf AS InvestmentProfile,
vsproj_cn.bprof AS BudgetProfile,
vsproj_cn.pprof AS PlanningProfile,
cast ( vsproj_cn.func_area as fkber ) AS FunctionalArea,
cast ( vsproj_cn.zteht as cgpl_duration_unit ) AS SchedulingDurationUnit,
cast ( vsproj_cn.scprf as ps_s4_schdprf ) AS WBSSchedulingProfile,
vsproj_cn.slwid AS FreeDefinedTableFieldSemantic,
cast ( vsproj_cn.usr00 as usr00proj preserving type ) AS FreeDefinedAttribute01,
cast ( vsproj_cn.usr01 as usr01proj preserving type ) AS FreeDefinedAttribute02,
cast ( vsproj_cn.usr02 as usr02proj preserving type ) AS FreeDefinedAttribute03,
cast ( vsproj_cn.usr03 as usr03proj preserving type ) AS FreeDefinedAttribute04,
cast ( vsproj_cn.usr04 as usr04proj preserving type ) AS FreeDefinedQuantity1,
cast ( vsproj_cn.use04 as use04proj preserving type ) AS FreeDefinedQuantity1Unit,
cast ( vsproj_cn.usr05 as usr05proj preserving type ) AS FreeDefinedQuantity2,
cast ( vsproj_cn.use05 as use05proj preserving type ) AS FreeDefinedQuantity2Unit,
cast ( vsproj_cn.usr06 as usr06proj preserving type ) AS FreeDefinedAmount1,
cast ( vsproj_cn.use06 as use06proj preserving type ) AS FreeDefinedAmount1Currency,
cast ( vsproj_cn.usr07 as usr07proj preserving type ) AS FreeDefinedAmount2,
cast ( vsproj_cn.use07 as use07proj preserving type ) AS FreeDefinedAmount2Currency,
cast ( vsproj_cn.usr08 as usr08proj preserving type ) AS FreeDefinedDate1,
cast ( vsproj_cn.usr09 as usr09proj preserving type ) AS FreeDefinedDate2,
cast ( vsproj_cn.usr10 as usr10proj preserving type ) AS FreeDefinedIndicator1,
cast ( vsproj_cn.usr11 as usr11proj preserving type ) AS FreeDefinedIndicator2
FROM vsproj_cn
LEFT OUTER JOIN I_ProjectResponsiblePerson AS _ResponsiblePerson ON ResponsiblePerson = _ResponsiblePerson.ResponsiblePerson -- association [0..1]
LEFT OUTER JOIN I_ProjectApplicant AS _ProjectApplicant ON ApplicantCode = _ProjectApplicant.ApplicantCode -- association [0..1]
LEFT OUTER JOIN I_ProjectProfileCode AS _ProjectProfileCode ON ProjectProfileCode = _ProjectProfileCode.ProjectProfileCode -- association [1..1]
LEFT OUTER JOIN I_ProfitCenter AS _ProfitCenter ON ProfitCenter = _ProfitCenter.ProfitCenter AND ControllingArea = _ProfitCenter.ControllingArea -- association [1..*]
LEFT OUTER JOIN I_NetworkProfile AS _NetworkProfile ON NetworkProfile = _NetworkProfile.NetworkProfile -- association [1..*]
LEFT OUTER JOIN I_TaxJurisdiction AS _TaxJurisdiction ON TaxJurisdiction = _TaxJurisdiction.TaxJurisdiction -- association [1..*]
LEFT OUTER JOIN I_Interestcalculationprofile AS _ProjInterestCalcProfile ON ProjInterestCalcProfile = _ProjInterestCalcProfile.ProjInterestCalcProfile -- association [1..1]
LEFT OUTER JOIN I_FunctionalArea AS _FunctionalArea ON FunctionalArea = _FunctionalArea.FunctionalArea -- association [1..1]
LEFT OUTER JOIN I_PlanningMethod AS _ProjBasicDatePlanMethName ON PlanningMethForProjBasicDate = _ProjBasicDatePlanMethName.PlanningMethForProjBasicDate -- association [1..1]
LEFT OUTER JOIN I_PlanningMethod AS _ProjFcstdDatePlanMethName ON PlanningMethForProjFcstdDate = _ProjFcstdDatePlanMethName.PlanningMethForProjBasicDate -- association [1..1]
LEFT OUTER JOIN I_Wbsschedulingprofile AS _Wbsschedulingprofile ON WBSSchedulingProfile = _Wbsschedulingprofile.WBSSchedulingProfile -- association [1..1]
LEFT OUTER JOIN I_ControllingObjectClass AS _ControllingObjectClass ON ControllingObjectClass = _ControllingObjectClass.ControllingObjectClass -- association [1..1]
;