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_WBSElementVersionData.
-- 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_WBSElementVersionData AS
SELECT
cast ( vsprps_cn.pspnr as ps_s4_pspnr preserving type ) AS WBSElementInternalID,
cast ( vsprps_cn.vsnmr as vsnmr_v preserving type ) AS Version,
vsprps_cn.posid_edit AS WBSElementExternalID,
cast ( vsprps_cn.posid as ps_posid_edit preserving type ) AS WBSElement,
vsprps_cn.poski AS WBSElementShortID,
cast ( vsprps_cn.post1 as ps_s4_post1 preserving type ) AS WBSDescription,
cast ( vsprps_cn.vernr as ps_s4_vernr preserving type ) AS ResponsiblePerson,
cast ( vsprps_cn.verna as ps_s4_verna preserving type ) AS ResponsiblePersonName,
cast ( vsprps_cn.astnr as ps_s4_astnr preserving type ) AS ApplicantCode,
vsprps_cn.astna AS ApplicantName,
cast ( vsprps_cn.pbukr as bukrs preserving type ) AS CompanyCode,
cast ( vsprps_cn.pgsbr as gsber preserving type ) AS BusinessArea,
cast ( vsprps_cn.pkokr as ps_s4_kokrs preserving type ) AS ControllingArea,
cast ( vsprps_cn.func_area as fkber preserving type ) AS FunctionalArea,
vsprps_cn.prctr AS ProfitCenter,
cast ( vsprps_cn.fkstl as ps_s4_fkstl preserving type ) AS ResponsibleCostCenter,
vsprps_cn.werks AS Plant,
vsprps_cn.slwid AS FreeDefinedTableFieldSemantic,
cast ( vsprps_cn.fabkl as stkal preserving type ) AS FactoryCalendar,
cast ( vsprps_cn.pspri as nw_prio preserving type ) AS PriorityCode,
cast ( vsprps_cn.pwpos as ps_pwpos preserving type ) AS Currency,
vsprps_cn.kalsm AS CostingSheet,
cast ( vsprps_cn.kostl as ps_kostl preserving type ) AS CostCenter,
cast ( vsprps_cn.akstl as ps_s4_akstl preserving type ) AS RequestingCostCenter,
cast ( vsprps_cn.psphi as ps_s4_proj_pspnr preserving type ) AS ProjectInternalID,
cast ( vsprps_cn.fakkz as ps_fakkz preserving type ) AS WBSElementIsBillingElement,
vsprps_cn.objnr AS WBSElementObject,
vsprps_cn.imprf AS InvestmentProfile,
vsprps_cn.xstat AS WBSIsStatisticalWBSElement,
cast ( vsprps_cn.belkz as ps_s4_belkz preserving type ) AS WBSIsAccountAssignmentElement,
vsprps_cn.prart AS ProjectType,
cast ( vsprps_cn.plakz as ps_plakz preserving type ) AS WBSElementIsPlanningElement,
vsprps_cn.stort AS WorkCenterLocation,
vsprps_cn.abgsl AS ResultAnalysisInternalID,
vsprps_cn.txjcd AS TaxJurisdiction,
cast ( vsprps_cn.tplnr as tplnr_unconverted preserving type ) AS FunctionalLocation,
vsprps_cn.ernam AS CreatedByUser,
vsprps_cn.erdat AS CreationDate,
vsprps_cn.aenam AS LastChangedByUser,
vsprps_cn.aedat AS LastChangeDate,
vsprps_cn.fkokr AS RespCostCenterControllingArea,
cast ( vsprps_cn.plint as plint_t preserving type ) AS WBSIsMarkedForIntegratedPlng,
vsprps_cn.equnr AS Equipment,
vsprps_cn.aennr AS ProjectObjectChangeNumber,
vsprps_cn.stufe AS WBSElementHierarchyLevel,
cast ( vsprps_cn.zschl as fin_ovhkey preserving type ) AS OverheadCode,
cast ( vsprps_cn.adpsp as ps_s4_addcompare_core preserving type ) AS ReferenceElement,
vsprps_cn.zschm AS ProjInterestCalcProfile,
cast ( vsprps_cn.evgew as ev_weightd preserving type ) AS ProgressAnlysAggregationWeight,
vsprps_cn.akokr AS ReqgCostCenterControllingArea,
vsprps_cn.txtsp AS Language,
cast( vsprps_cn.loevm as ps_s4_loevm ) AS IsMarkedForDeletion,
vsprps_cn.grpkz AS WBSElementIsGroupingWBSElement,
vsprps_cn.clasf AS WBSElementIsUsedInProjSmmry,
vsprps_cn.klvar AS CostingVariant,
cast ( pstrt as ps_s4_pstrt preserving type ) AS BasicStartDate,
cast ( istrt as ps_s4_istrt preserving type ) AS ActualStartDate,
cast ( pende as ps_s4_pende preserving type ) AS BasicEndDate,
cast ( iende as ps_s4_iende preserving type ) AS ActualEndDate,
cast ( pdaur as ps_s4_pdaur preserving type ) AS BasicDuration,
cast ( peinh as ps_s4_peinh preserving type ) AS BasicDurationUnit,
cast ( idaur as ps_s4_idaur preserving type ) AS ActualDuration,
cast ( ieinh as ps_ieinh preserving type ) AS ActualDurationUnit,
cast ( pstrm as ps_gstrs preserving type ) AS SchedldBasicEarliestStartDate,
cast ( petrm as ps_s4_gltrs preserving type ) AS ScheduledBasicLatestEndDate,
cast ( estrm as ps_s4_gstpp preserving type ) AS SchedldFcstdEarliestStartDate,
cast ( eetrm as ps_s4_gltpp preserving type ) AS LatestSchedldFcstdEndDate,
cast ( vistr as ps_s4_istvorl preserving type ) AS TentativeActualStartDate,
cast ( viend as ps_s4_ienvorl preserving type ) AS TentativeActualEndDate,
vsprps_cn.vname AS JointVenture,
vsprps_cn.recid AS JointVentureCostRecoveryCode,
vsprps_cn.etype AS JointVentureEquityType,
vsprps_cn.otype AS JntVntrProjectType,
vsprps_cn.jibcl AS JntIntrstBillgClass,
vsprps_cn.jibsa AS JntIntrstBillgSubClass,
vsprps_cn.subpr AS SubProject,
vsprps_cn.izwek AS InvestmentReason,
vsprps_cn.isize AS InvestmentScale,
vsprps_cn.iumkz AS EnvironmentalInvestmentReason,
vsprps_cn.abukr AS RequestingCompanyCode,
vsprps_cn.zuord AS NetworkAssignmentType,
vsprps_cn.ktrg AS CostObject,
vsprps_cn.fplnr AS BillingPlan,
cast ( vsprps_cn.scope as ps_s4_scope_cv ) AS ControllingObjectClass,
cast ( vsprps_cn.usr00 as usr00prps preserving type ) AS FreeDefinedAttribute01,
cast ( vsprps_cn.usr01 as usr01prps preserving type ) AS FreeDefinedAttribute02,
cast ( vsprps_cn.usr02 as usr02prps preserving type ) AS FreeDefinedAttribute03,
cast ( vsprps_cn.usr03 as usr03prps preserving type ) AS FreeDefinedAttribute04,
cast ( vsprps_cn.usr04 as usr04prps preserving type ) AS FreeDefinedQuantity1,
cast ( vsprps_cn.use04 as use04prps preserving type ) AS FreeDefinedQuantity1Unit,
cast ( vsprps_cn.usr05 as usr05prps preserving type ) AS FreeDefinedQuantity2,
cast ( vsprps_cn.use05 as use05prps preserving type ) AS FreeDefinedQuantity2Unit,
cast ( vsprps_cn.usr06 as abap.curr( 13, 2 ) ) AS FreeDefinedAmount1,
cast ( vsprps_cn.use06 as use06prps preserving type ) AS FreeDefinedAmount1Currency,
cast ( vsprps_cn.usr07 as abap.curr( 13, 2 ) ) AS FreeDefinedAmount2,
cast ( vsprps_cn.use07 as use07prps preserving type ) AS FreeDefinedAmount2Currency,
cast ( vsprps_cn.usr08 as usr08prps preserving type ) AS FreeDefinedDate1,
cast ( vsprps_cn.usr09 as usr09prps preserving type ) AS FreeDefinedDate2,
cast ( vsprps_cn.usr10 as usr10prps preserving type ) AS FreeDefinedIndicator1,
cast ( vsprps_cn.usr11 as usr11prps preserving type ) AS FreeDefinedIndicator2,
case dats_is_valid( vsprte_cn.pstrs ) when 0 then '00000000' else vsprte_cn.pstrs end as SchedldBasicLatestStartDate AS pstrsendasSchedldBasicLatestStartDate
FROM vsprps_cn
LEFT OUTER JOIN I_ProjectVersionData AS _Project ON ProjectInternalID = _Project.ProjectInternalID AND Version = _Project.Version -- association [1..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_ControllingArea AS _ControllingArea ON ControllingArea = _ControllingArea.ControllingArea -- association [0..1]
LEFT OUTER JOIN I_FunctionalArea AS _FunctionalArea ON FunctionalArea = _FunctionalArea.FunctionalArea -- association [0..1]
LEFT OUTER JOIN I_ProfitCenter AS _ProfitCenter ON ControllingArea = _ProfitCenter.ControllingArea AND ProfitCenter = _ProfitCenter.ProfitCenter -- association [0..*]
LEFT OUTER JOIN I_CostCenter AS _ResponsibleCostCenter ON ControllingArea = _ResponsibleCostCenter.ControllingArea AND ResponsibleCostCenter = _ResponsibleCostCenter.CostCenter -- association [0..*]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [0..1]
LEFT OUTER JOIN I_FactoryCalendar AS _FactoryCalendar ON FactoryCalendar = _FactoryCalendar.FactoryCalendar -- association [0..1]
LEFT OUTER JOIN I_CostCenter AS _CostCenter ON ControllingArea = _CostCenter.ControllingArea AND CostCenter = _CostCenter.CostCenter -- association [0..*]
LEFT OUTER JOIN I_Projecttype AS _ProjectType ON ProjectType = _ProjectType.ProjectType -- association [1..1]
LEFT OUTER JOIN I_Prioritycode AS _PriorityCode ON PriorityCode = _PriorityCode.PriorityCode -- association [1..1]
LEFT OUTER JOIN I_ControllingObjectClass AS _ControllingObjectClass ON ControllingObjectClass = _ControllingObjectClass.ControllingObjectClass -- association [1..1]
LEFT OUTER JOIN I_BusinessArea AS _BusinessArea ON BusinessArea = _BusinessArea.BusinessArea -- association [1..1]
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 E_WBSElementVersionData AS _Extension ON WBSElementInternalID = _Extension.WBSElementInternalID AND Version = _Extension.Version -- association [1..1]
;