P_WBSElementWithVersion

DDL: P_WBSELEMENTWITHVERSION SQL: PWBSWITHVERS Type: view COMPOSITE

P_WBSElementWithVersion is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_WBSElement, I_WBSElementVersion) and exposes 223 fields with key fields WBSElement, Version, Version.

Data Sources (2)

SourceAliasJoin Type
I_WBSElement I_WBSElement union_all
I_WBSElementVersion I_WBSElementVersion from

Annotations (5)

NameValueLevelField
AbapCatalog.sqlViewName PWBSWITHVERS view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.authorizationCheck #CHECK view

Fields (223)

KeyFieldSource TableSource FieldDescription
KEY WBSElement WBSElement
KEY Version Version
WBSElementWithCodingMask WBSElementWithCodingMask
IsProjectVersionObject
WBSElementInternalID WBSElementInternalID
WBSElementHierarchyLevel WBSElementHierarchyLevel
OverheadCode OverheadCode
ResultAnalysisInternalID ResultAnalysisInternalID
WBSElementObject WBSElementObject
WBSDescription WBSDescription
ProjectInternalID ProjectInternalID
Project Project
ResponsiblePerson ResponsiblePerson
ResponsiblePersonName ResponsiblePersonName
CreatedByUser CreatedByUser
CreationDate CreationDate
LastChangedByUser LastChangedByUser
LastChangeDate LastChangeDate
ApplicantCode ApplicantCode
ApplicantName ApplicantName
ProjectType ProjectType
WBSElementIsPlanningElement WBSElementIsPlanningElement
WBSIsAccountAssignmentElement WBSIsAccountAssignmentElement
WBSElementIsBillingElement WBSElementIsBillingElement
CostingSheet CostingSheet
PriorityCode PriorityCode
CompanyCode CompanyCode
BusinessArea BusinessArea
ControllingArea ControllingArea
ReqgCostCenterControllingArea ReqgCostCenterControllingArea
RequestingCostCenter RequestingCostCenter
RespCostCenterControllingArea RespCostCenterControllingArea
ResponsibleCostCenter ResponsibleCostCenter
Plant Plant
ProfitCenter ProfitCenter
ControllingObjectClass ControllingObjectClass
BasicStartDate BasicStartDate
BasicEndDate BasicEndDate
ActualStartDate ActualStartDate
ActualEndDate ActualEndDate
SchedldBasicEarliestStartDate SchedldBasicEarliestStartDate
SchedldBasicEarliestEndDate SchedldBasicEarliestEndDate
SchedldBasicLatestStartDate SchedldBasicLatestStartDate
ScheduledBasicLatestEndDate ScheduledBasicLatestEndDate
TentativeActualStartDate TentativeActualStartDate
TentativeActualEndDate TentativeActualEndDate
SchedldFcstdEarliestStartDate SchedldFcstdEarliestStartDate
SchedldFcstdEarliestEndDate SchedldFcstdEarliestEndDate
LatestSchedldFcstdStartDate LatestSchedldFcstdStartDate
LatestSchedldFcstdEndDate LatestSchedldFcstdEndDate
IsMarkedForDeletion IsMarkedForDeletion
WBSIsMarkedForIntegratedPlng WBSIsMarkedForIntegratedPlng
WBSIsStatisticalWBSElement WBSIsStatisticalWBSElement
TaxJurisdiction TaxJurisdiction
FunctionalArea FunctionalArea
Currency Currency
FactoryCalendar FactoryCalendar
Location Location
Equipment Equipment
FunctionalLocation FunctionalLocation
ProjectObjectChangeNumber ProjectObjectChangeNumber
ProjectObjectReferenceElement ProjectObjectReferenceElement
ProgressAnlysAggregationWeight ProgressAnlysAggregationWeight
ProjInterestCalcProfile ProjInterestCalcProfile
InvestmentProfile InvestmentProfile
ActualDuration ActualDuration
BasicDuration BasicDuration
BasicDurationUnit BasicDurationUnit
DueToStartDays
DueToEndDays
OverdueToStartDays
OverdueToEndDays
CostCenter CostCenter
FreeDefinedTableFieldSemantic FreeDefinedTableFieldSemantic
FreeDefinedAttribute01 FreeDefinedAttribute01
FreeDefinedAttribute02 FreeDefinedAttribute02
FreeDefinedAttribute03 FreeDefinedAttribute03
FreeDefinedAttribute04 FreeDefinedAttribute04
FreeDefinedQuantity1 FreeDefinedQuantity1
FreeDefinedQuantity1Unit FreeDefinedQuantity1Unit
FreeDefinedQuantity2 FreeDefinedQuantity2
FreeDefinedQuantity2Unit FreeDefinedQuantity2Unit
FreeDefinedAmount1 FreeDefinedAmount1
FreeDefinedAmount1Currency FreeDefinedAmount1Currency
FreeDefinedAmount2 FreeDefinedAmount2
FreeDefinedAmount2Currency FreeDefinedAmount2Currency
FreeDefinedDate1 FreeDefinedDate1
FreeDefinedDate2 FreeDefinedDate2
FreeDefinedIndicator1 FreeDefinedIndicator1
FreeDefinedIndicator2 FreeDefinedIndicator2
JointVenture JointVenture
JointVentureRecoveryCode JointVentureRecoveryCode
JointVentureEquityType JointVentureEquityType
JointVentureObjectType JointVentureObjectType
JointVentureClass JointVentureClass
JointVentureSubClass JointVentureSubClass
_ControllingObjectClass _ControllingObjectClass
_ControllingArea _ControllingArea
_CompanyCode _CompanyCode
_BusinessArea _BusinessArea
_ProfitCenter _ProfitCenter
_Plant _Plant
_ProjectType _ProjectType
_PriorityCode _PriorityCode
_TaxJurisdiction _TaxJurisdiction
_Location _Location
_Equipment _Equipment
_FunctionalLocation _FunctionalLocation
_FunctionalArea _FunctionalArea
_Interestcalculationprofile _Interestcalculationprofile
_FactoryCalendar _FactoryCalendar
_ResponsiblePerson _ResponsiblePerson
_ProjectApplicant _ProjectApplicant
KEY Version
WBSElementWithCodingMask WBSElementWithCodingMask
IsProjectVersionObject
WBSElementInternalID WBSElementInternalID
WBSElementHierarchyLevel WBSElementHierarchyLevel
OverheadCode OverheadCode
ResultAnalysisInternalID ResultAnalysisInternalID
WBSElementObject WBSElementObject
WBSDescription WBSDescription
ProjectInternalID ProjectInternalID
Project Project
ResponsiblePerson ResponsiblePerson
ResponsiblePersonName ResponsiblePersonName
CreatedByUser CreatedByUser
CreationDate CreationDate
LastChangedByUser LastChangedByUser
LastChangeDate LastChangeDate
ApplicantCode ApplicantCode
ApplicantName ApplicantName
ProjectType ProjectType
WBSElementIsPlanningElement WBSElementIsPlanningElement
WBSIsAccountAssignmentElement WBSIsAccountAssignmentElement
WBSElementIsBillingElement WBSElementIsBillingElement
CostingSheet CostingSheet
PriorityCode PriorityCode
CompanyCode CompanyCode
BusinessArea BusinessArea
ControllingArea ControllingArea
ReqgCostCenterControllingArea ReqgCostCenterControllingArea
RequestingCostCenter RequestingCostCenter
RespCostCenterControllingArea RespCostCenterControllingArea
ResponsibleCostCenter ResponsibleCostCenter
Plant Plant
ProfitCenter ProfitCenter
ControllingObjectClass ControllingObjectClass
BasicStartDate BasicStartDate
BasicEndDate BasicEndDate
ActualStartDate ActualStartDate
ActualEndDate ActualEndDate
SchedldBasicEarliestStartDate SchedldBasicEarliestStartDate
SchedldBasicEarliestEndDate SchedldBasicEarliestEndDate
SchedldBasicLatestStartDate SchedldBasicLatestStartDate
ScheduledBasicLatestEndDate ScheduledBasicLatestEndDate
TentativeActualStartDate TentativeActualStartDate
TentativeActualEndDate TentativeActualEndDate
SchedldFcstdEarliestStartDate SchedldFcstdEarliestStartDate
SchedldFcstdEarliestEndDate SchedldFcstdEarliestEndDate
LatestSchedldFcstdStartDate LatestSchedldFcstdStartDate
LatestSchedldFcstdEndDate LatestSchedldFcstdEndDate
IsMarkedForDeletion IsMarkedForDeletion
WBSIsMarkedForIntegratedPlng WBSIsMarkedForIntegratedPlng
WBSIsStatisticalWBSElement WBSIsStatisticalWBSElement
TaxJurisdiction TaxJurisdiction
FunctionalArea FunctionalArea
Currency Currency
FactoryCalendar FactoryCalendar
Location Location
Equipment Equipment
FunctionalLocation FunctionalLocation
ProjectObjectChangeNumber ProjectObjectChangeNumber
ProjectObjectReferenceElement ProjectObjectReferenceElement
ProgressAnlysAggregationWeight ProgressAnlysAggregationWeight
ProjInterestCalcProfile ProjInterestCalcProfile
InvestmentProfile InvestmentProfile
ActualDuration ActualDuration
BasicDuration BasicDuration
BasicDurationUnit BasicDurationUnit
BasicEndDateelse0endendasDueToEndDays
CostCenter CostCenter
FreeDefinedTableFieldSemantic FreeDefinedTableFieldSemantic
FreeDefinedAttribute01 FreeDefinedAttribute01
FreeDefinedAttribute02 FreeDefinedAttribute02
FreeDefinedAttribute03 FreeDefinedAttribute03
FreeDefinedAttribute04 FreeDefinedAttribute04
FreeDefinedQuantity1 FreeDefinedQuantity1
FreeDefinedQuantity1Unit FreeDefinedQuantity1Unit
FreeDefinedQuantity2 FreeDefinedQuantity2
FreeDefinedQuantity2Unit FreeDefinedQuantity2Unit
FreeDefinedAmount1 FreeDefinedAmount1
FreeDefinedAmount1Currency FreeDefinedAmount1Currency
FreeDefinedAmount2 FreeDefinedAmount2
FreeDefinedAmount2Currency FreeDefinedAmount2Currency
FreeDefinedDate1 FreeDefinedDate1
FreeDefinedDate2 FreeDefinedDate2
FreeDefinedIndicator1 FreeDefinedIndicator1
FreeDefinedIndicator2 FreeDefinedIndicator2
JointVenture JointVenture
JointVentureRecoveryCode JointVentureRecoveryCode
JointVentureEquityType JointVentureEquityType
JointVentureObjectType JointVentureObjectType
JointVentureClass JointVentureClass
JointVentureSubClass JointVentureSubClass
_ControllingObjectClass _ControllingObjectClass
_ControllingArea _ControllingArea
_CompanyCode _CompanyCode
_BusinessArea _BusinessArea
_ProfitCenter _ProfitCenter
_Plant _Plant
_ProjectType _ProjectType
_PriorityCode _PriorityCode
_TaxJurisdiction _TaxJurisdiction
_Location _Location
_Equipment _Equipment
_FunctionalLocation _FunctionalLocation
_FunctionalArea _FunctionalArea
_Interestcalculationprofile _Interestcalculationprofile
_FactoryCalendar _FactoryCalendar
_ResponsiblePerson _ResponsiblePerson
_ProjectApplicant _ProjectApplicant
_WBSElementShortText _WBSElementShortText
@AbapCatalog.sqlViewName: 'PWBSWITHVERS'
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #COMPOSITE
@VDM.private: true
@AccessControl.authorizationCheck: #CHECK

define view P_WBSElementWithVersion
  as select from I_WBSElementVersion

{

  key WBSElement,

  key Version,
      WBSElementWithCodingMask,  //Not finalized field - please donot use


      'X'               as  IsProjectVersionObject,
      WBSElementInternalID,
      WBSElementHierarchyLevel,
      OverheadCode,
      ResultAnalysisInternalID,
      WBSElementObject,
      WBSDescription,
      ProjectInternalID,
      Project,
      ResponsiblePerson,
      ResponsiblePersonName,
      CreatedByUser,
      CreationDate,
      LastChangedByUser,
      LastChangeDate,
      ApplicantCode,
      ApplicantName,
      ProjectType,
      WBSElementIsPlanningElement,
      WBSIsAccountAssignmentElement,
      WBSElementIsBillingElement,
      CostingSheet,
      PriorityCode,
      CompanyCode,
      BusinessArea,
      ControllingArea,
      ReqgCostCenterControllingArea,
      RequestingCostCenter,
      RespCostCenterControllingArea,
      ResponsibleCostCenter,
      Plant,
      ProfitCenter,
      ControllingObjectClass,
      BasicStartDate,
      BasicEndDate,
      ForecastedStartDate,
      ForecastedEndDate,
      ActualStartDate,
      ActualEndDate,
      SchedldBasicEarliestStartDate,
      SchedldBasicEarliestEndDate,
      SchedldBasicLatestStartDate,
      ScheduledBasicLatestEndDate,
      TentativeActualStartDate,
      TentativeActualEndDate,
      SchedldFcstdEarliestStartDate,
      SchedldFcstdEarliestEndDate,
      LatestSchedldFcstdStartDate,
      LatestSchedldFcstdEndDate,
      IsMarkedForDeletion,
      WBSIsMarkedForIntegratedPlng,
      WBSIsStatisticalWBSElement,
      TaxJurisdiction,
      FunctionalArea,
      Currency,
      FactoryCalendar,
      Location,
      Equipment,
      FunctionalLocation,
      ProjectObjectChangeNumber,
      ProjectObjectReferenceElement,
      ProgressAnlysAggregationWeight,
      ProjInterestCalcProfile,
      InvestmentProfile,
      ForecastedDuration,
      ForecastedDurationUnit,
      ActualDuration,
      BasicDuration,
      BasicDurationUnit,

      //Calculate Due Overdue Dates

      cast( 0 as int4 ) as  DueToStartDays,

      cast( 0 as int4 ) as  DueToEndDays,

      cast( 0 as int4 ) as  OverdueToStartDays,

      cast( 0 as int4 ) as  OverdueToEndDays,
      CostCenter,
      FreeDefinedTableFieldSemantic,
      FreeDefinedAttribute01,
      FreeDefinedAttribute02,
      FreeDefinedAttribute03,
      FreeDefinedAttribute04,
      FreeDefinedQuantity1,
      FreeDefinedQuantity1Unit,
      FreeDefinedQuantity2,
      FreeDefinedQuantity2Unit,
      FreeDefinedAmount1,
      FreeDefinedAmount1Currency,
      FreeDefinedAmount2,
      FreeDefinedAmount2Currency,
      FreeDefinedDate1,
      FreeDefinedDate2,
      FreeDefinedIndicator1,
      FreeDefinedIndicator2,
//  Joint Venture fields inclusion in the view      

      JointVenture,
      JointVentureRecoveryCode,
      JointVentureEquityType,
      JointVentureObjectType,
      JointVentureClass,
      JointVentureSubClass,
      //-->Associations


      //I_WBSElementVersion._WBSElementLangBsdDesc,

      _ControllingObjectClass,
      _ControllingArea,
      _CompanyCode,
      _BusinessArea,
      _ProfitCenter,
      _Plant,
      _ProjectType,
      _PriorityCode,
      _TaxJurisdiction,
      _Location,
      _Equipment,
      _FunctionalLocation,
      _FunctionalArea,
      _Interestcalculationprofile,
      _FactoryCalendar,
      _ResponsiblePerson,
      _ProjectApplicant,
      _WBSElementShortText
      //<--Associations


}

union all

select from I_WBSElement

{

  key WBSElement,

  key ''  as Version,

      WBSElementWithCodingMask, //Not finalized field - please donot use

      ''  as IsProjectVersionObject,
      WBSElementInternalID,
      WBSElementHierarchyLevel,
      OverheadCode,
      ResultAnalysisInternalID,
      WBSElementObject,
      WBSDescription,
      ProjectInternalID,
      Project,
      ResponsiblePerson,
      ResponsiblePersonName,
      CreatedByUser,
      CreationDate,
      LastChangedByUser,
      LastChangeDate,
      ApplicantCode,
      ApplicantName,
      ProjectType,
      WBSElementIsPlanningElement,
      WBSIsAccountAssignmentElement,
      WBSElementIsBillingElement,
      CostingSheet,
      PriorityCode,
      CompanyCode,
      BusinessArea,
      ControllingArea,
      ReqgCostCenterControllingArea,
      RequestingCostCenter,
      RespCostCenterControllingArea,
      ResponsibleCostCenter,
      Plant,
      ProfitCenter,
      ControllingObjectClass,
      BasicStartDate,
      BasicEndDate,
      ForecastedStartDate,
      ForecastedEndDate,
      ActualStartDate,
      ActualEndDate,
      SchedldBasicEarliestStartDate,
      SchedldBasicEarliestEndDate,
      SchedldBasicLatestStartDate,
      ScheduledBasicLatestEndDate,
      TentativeActualStartDate,
      TentativeActualEndDate,
      SchedldFcstdEarliestStartDate,
      SchedldFcstdEarliestEndDate,
      LatestSchedldFcstdStartDate,
      LatestSchedldFcstdEndDate,
      IsMarkedForDeletion,
      WBSIsMarkedForIntegratedPlng,
      WBSIsStatisticalWBSElement,
      TaxJurisdiction,
      FunctionalArea,
      Currency,
      FactoryCalendar,
      Location,
      Equipment,
      FunctionalLocation,
      ProjectObjectChangeNumber,
      ProjectObjectReferenceElement,
      ProgressAnlysAggregationWeight,
      ProjInterestCalcProfile,
      InvestmentProfile,
      ForecastedDuration,
      ForecastedDurationUnit,
      ActualDuration,
      BasicDuration,
      BasicDurationUnit,
      //Calculate Due Overdue Dates

      case
          when I_WBSElement.SchedldBasicLatestStartDate != '00000000' and I_WBSElement.SchedldBasicLatestStartDate > $session.system_date
           and I_WBSElement.TentativeActualStartDate = '00000000' and I_WBSElement.TentativeActualEndDate = '00000000'
           and I_WBSElement.ActualStartDate = '00000000' and I_WBSElement.ActualEndDate = '00000000'
              then dats_days_between( cast($session.system_date as sydatum),
                                      I_WBSElement.SchedldBasicLatestStartDate
                                    )
      else
          case
              when I_WBSElement.BasicStartDate != '00000000'  and I_WBSElement.BasicStartDate > $session.system_date
               and I_WBSElement.TentativeActualStartDate = '00000000' and I_WBSElement.TentativeActualEndDate = '00000000'
               and I_WBSElement.ActualStartDate = '00000000' and I_WBSElement.ActualEndDate = '00000000'
               and I_WBSElement.SchedldBasicLatestStartDate = '00000000'
                  then dats_days_between( cast($session.system_date as sydatum),
                                          I_WBSElement.BasicStartDate
                                        )
              else 0
           end
      end as DueToStartDays,
      case
         when I_WBSElement.ScheduledBasicLatestEndDate != '00000000' and I_WBSElement.ScheduledBasicLatestEndDate > $session.system_date
          and I_WBSElement.ActualEndDate = '00000000'
             then dats_days_between( cast($session.system_date as sydatum),
                                     I_WBSElement.ScheduledBasicLatestEndDate
                                   )
          else
             case
                 when I_WBSElement.BasicEndDate != '00000000'  and I_WBSElement.BasicEndDate > $session.system_date
                  and I_WBSElement.ActualEndDate = '00000000' and I_WBSElement.ScheduledBasicLatestEndDate = '00000000'
                     then dats_days_between( cast($session.system_date as sydatum),
                                             I_WBSElement.BasicEndDate
                                           )
                 else 0
              end
      end as DueToEndDays,
      case
         when I_WBSElement.SchedldBasicLatestStartDate != '00000000' and I_WBSElement.SchedldBasicLatestStartDate < $session.system_date
          and I_WBSElement.TentativeActualStartDate = '00000000' and I_WBSElement.TentativeActualEndDate = '00000000'
          and I_WBSElement.ActualStartDate = '00000000' and I_WBSElement.ActualEndDate = '00000000'
             then dats_days_between( I_WBSElement.SchedldBasicLatestStartDate,
                                     cast($session.system_date as sydatum)
                                   )
         else
             case
                 when I_WBSElement.BasicStartDate != '00000000'  and I_WBSElement.BasicStartDate < $session.system_date
                  and I_WBSElement.TentativeActualStartDate = '00000000' and I_WBSElement.TentativeActualEndDate = '00000000'
                  and I_WBSElement.ActualStartDate = '00000000' and I_WBSElement.ActualEndDate = '00000000'
                  and I_WBSElement.SchedldBasicLatestStartDate = '00000000'
                     then dats_days_between( I_WBSElement.BasicStartDate,
                                             cast($session.system_date as sydatum)
                                           )
                 else 0
              end
      end as OverdueToStartDays,
      case
         when I_WBSElement.ScheduledBasicLatestEndDate != '00000000' and I_WBSElement.ScheduledBasicLatestEndDate < $session.system_date
          and I_WBSElement.ActualEndDate = '00000000'
             then dats_days_between( I_WBSElement.ScheduledBasicLatestEndDate,
                                     cast($session.system_date as sydatum)
                                   )
         else
             case
                 when I_WBSElement.BasicEndDate != '00000000'  and I_WBSElement.BasicEndDate < $session.system_date
                  and I_WBSElement.ActualEndDate = '00000000' and I_WBSElement.ScheduledBasicLatestEndDate = '00000000'
                     then dats_days_between( I_WBSElement.BasicEndDate,
                                             cast($session.system_date as sydatum)
                                           )
                 else 0
              end
      end as OverdueToEndDays,
      CostCenter,
      FreeDefinedTableFieldSemantic,
      FreeDefinedAttribute01,
      FreeDefinedAttribute02,
      FreeDefinedAttribute03,
      FreeDefinedAttribute04,
      FreeDefinedQuantity1,
      FreeDefinedQuantity1Unit,
      FreeDefinedQuantity2,
      FreeDefinedQuantity2Unit,
      FreeDefinedAmount1,
      FreeDefinedAmount1Currency,
      FreeDefinedAmount2,
      FreeDefinedAmount2Currency,
      FreeDefinedDate1,
      FreeDefinedDate2,
      FreeDefinedIndicator1,
      FreeDefinedIndicator2,
//  Joint Venture fields inclusion in the view      

      JointVenture,
      JointVentureRecoveryCode,
      JointVentureEquityType,
      JointVentureObjectType,
      JointVentureClass,
      JointVentureSubClass,      
      //-->Associations


      //I_WBSElement._WBSElementLangBsdDesc,

      _ControllingObjectClass,
      _ControllingArea,
      _CompanyCode,
      _BusinessArea,
      _ProfitCenter,
      _Plant,
      _ProjectType,
      _PriorityCode,
      _TaxJurisdiction,
      _Location,
      _Equipment,
      _FunctionalLocation,
      _FunctionalArea,
      _Interestcalculationprofile,
      _FactoryCalendar,
      _ResponsiblePerson,
      _ProjectApplicant,
      _WBSElementShortText
      //<--Associations


}