R_ProjectBillingElementTP

DDL: R_PROJECTBILLINGELEMENTTP SQL: RPRJBLGELMTP Type: view_entity TRANSACTIONAL

Details of Billing Element

R_ProjectBillingElementTP is a Transactional CDS View that provides data about "Details of Billing Element" in SAP S/4HANA. It reads from 1 data source (I_ProjectBillingElement) and exposes 55 fields with key field ProjectBillingElementUUID. It has 16 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_ProjectBillingElement ProjectBillingElement from

Associations (16)

CardinalityTargetAliasCondition
[1..1] I_EnterpriseProjectElement _EnterpriseProjectElement $projection.BillingWBSElementInternalID = _EnterpriseProjectElement.WBSElementInternalID
[1..1] P_ProjBillgElmntSalesDets2 _ProjBillgElmntSalesDets $projection.ProjectBillingElementUUID = _ProjBillgElmntSalesDets.ProjectBillingElementUUID
[1..1] P_ProjectBillingElmntDueDate3 _DueBillingDate $projection.ProjectBillingElementUUID = _DueBillingDate.ProjectBillingElementUUID
[0..1] I_TmpProjectBillingRequest _TmpProjectBillingRequest $projection.ProjectBillingElementUUID = _TmpProjectBillingRequest.ProjectBillingElementUUID
[0..1] I_PrjBlgElmOverduePrepayment _PrjBlgElmOverduePrepayment $projection.ProjectBillingElementUUID = _PrjBlgElmOverduePrepayment.ProjectBillingElementUUID
[0..1] I_PrjBlgElmPrepaymentAmount _PrjBlgElmPrepaymentAmount $projection.ProjectBillingElementUUID = _PrjBlgElmPrepaymentAmount.ProjectBillingElementUUID
[0..1] I_PrjBlgElmBllbleRevnAmt _PrjBlgElmBllbleRevnAmt $projection.ProjectBillingElementUUID = _PrjBlgElmBllbleRevnAmt.ProjectBillingElementUUID -- can be moved to C_
[0..*] I_ProjectBillingDocDetails _ProjectBillingDocDetails $projection.BillingWBSElementInternalID = _ProjectBillingDocDetails.WBSElementInternalID -- can be moved to C_
[0..*] R_ProjectBillingRequestItemTP _ProjectBillingRequestItemTP $projection.ProjectBillingElementUUID = _ProjectBillingRequestItemTP.ProjectBillingElementUUID
[1..1] I_ProfitCenterText _ProfitCenterName $projection.WBSElementProfitCenter = _ProfitCenterName.ProfitCenter and $projection.ControllingArea = _ProfitCenterName.ControllingArea and $projection.projectstartdate <= _ProfitCenterName.ValidityEndDate and $projection.projectstartdate >= _ProfitCenterName.ValidityStartDate and _ProfitCenterName.Language = $session.system_language
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer -- can be moved to C_
[0..*] I_PrjBlgElmEntrForPrepayment _PrjBlgElmEntrForPrepayment $projection.ProjectBillingElementUUID = _PrjBlgElmEntrForPrepayment.ProjectBillingElementUUID
[0..1] I_EngagementProjectSrvcOrgText _ServiceOrganizationText _ServiceOrganizationText.EngagementProjectServiceOrg = $projection.EngagementProjectServiceOrg and _ServiceOrganizationText.Language = $session.system_language
[0..1] E_ProjectBillingElement _Extension $projection.ProjectBillingElementUUID = _Extension.ProjectBillingElementUUID
[0..*] R_ProjectBillingElementEntryTP _ProjectBillingElementEntry
[0..1] R_ProjBillgElmObjectLinkTP _ProjBillgElmObjectLink

Annotations (9)

NameValueLevelField
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.sapObjectNodeType.name ProjectBillingElement view
EndUserText.label Details of Billing Element view

Fields (55)

KeyFieldSource TableSource FieldDescription
KEY ProjectBillingElementUUID I_ProjectBillingElement ProjectBillingElementUUID
BillingWBSElementInternalID I_ProjectBillingElement BillingWBSElementInternalID
DocumentCurrency I_ProjectBillingElement DocumentCurrency
BilledRevenueAmtInDocCrcy I_ProjectBillingElement BilledRevenueAmtInDocCrcy
WrittenOffRevenueAmtInDocCrcy I_ProjectBillingElement WrittenOffRevenueAmtInDocCrcy
ProjBillingProfile I_ProjectBillingElement ProjBillingProfile
ProjectBillingCategory I_ProjectBillingElement ProjectBillingCategory
ProjBillgElmntCreatedByUser I_ProjectBillingElement ProjBillgElmntCreatedByUser
ProjBillgElmntCreatedAtDteTme I_ProjectBillingElement ProjBillgElmntCreatedAtDteTme
ProjBillgElmntLastChgdByUser I_ProjectBillingElement ProjBillgElmntLastChgdByUser
ProjBillgElmntLastChgdAtDteTme I_ProjectBillingElement ProjBillgElmntLastChgdAtDteTme
WBSElementExternalID
BillingPlan _ProjBillgElmntSalesDets BillingPlan
SalesOrder _ProjBillgElmntSalesDets SalesOrder
SalesOrderItem _ProjBillgElmntSalesDets SalesOrderItem
TransactionCurrency _ProjBillgElmntSalesDets TransactionCurrency
WBSElementProfitCenter _EnterpriseProjectElement ProfitCenter
ProfitCenterHierarchyNode
CappedNetAmount _ProjBillgElmntSalesDets CappedNetAmount
ControllingArea
Project
ProfitCenter
ProcessingStatus
ProjectStartDate
ProjectEndDate
SoldToPartyasCustomer
ProjectBillingRequest _TmpProjectBillingRequest ProjectBillingRequest
ProjectBillingRequestUUID _TmpProjectBillingRequest ProjectBillingRequestUUID
BillingBlockStatus _ProjBillgElmntSalesDets BillingBlockStatus
TotalBlockStatus
OverallBillingBlockStatus
BillingBlockReason _ProjBillgElmntSalesDets BillingBlockReason
HeaderBillingBlockReason
SalesDocumentRjcnReason _ProjBillgElmntSalesDets SalesDocumentRjcnReason
EngagementProjectServiceOrg
DueBillingDate _DueBillingDate DueBillingDate
UserID _DueBillingDate UserID
BillableRevenueAmtInDocCrcy
PrjBlgElmPlndPrepaymentIsOvrd _PrjBlgElmOverduePrepayment PrjBlgElmPlndPrepaymentIsOvrd
PlndPrepaymentAmtInProjCrcy _PrjBlgElmPrepaymentAmount PlndPrepaymentAmtInProjCrcy
_ServiceOrganizationText _ServiceOrganizationText
_ProfitCenterName _ProfitCenterName
_PrjBlgElmBllbleRevnAmt _PrjBlgElmBllbleRevnAmt
_PrjBlgElmEntrForPrepayment _PrjBlgElmEntrForPrepayment
_SalesDocItemBillPlan _ProjBillgElmntSalesDets _SalesDocItemBillPlan
_SalesOrderItem _ProjBillgElmntSalesDets _SalesOrderItem
_SalesOrder _ProjBillgElmntSalesDets _SalesOrder
_ProjectBillingElementEntry _ProjectBillingElementEntry
_WBSElement I_ProjectBillingElement _WBSElement
_ProjectBillingRequestItemTP _ProjectBillingRequestItemTP
_Customer _Customer
_EnterpriseProjectElement _EnterpriseProjectElement
_PrjBlgElmPrepaymentAmount _PrjBlgElmPrepaymentAmount
_PrjBlgElmOverduePrepayment _PrjBlgElmOverduePrepayment
_ProjBillgElmObjectLink _ProjBillgElmObjectLink
//@AbapCatalog.sqlViewName: 'RPRJBLGELMTP'

//@ClientHandling.algorithm: #SESSION_VARIABLE

//@ClientHandling.type: #CLIENT_DEPENDENT

@VDM.viewType: #TRANSACTIONAL
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
//@AbapCatalog.compiler.compareFilter: true

//@AbapCatalog.preserveKey: true

@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: ['_PrjBlgElmPrepaymentAmount' , '_PrjBlgElmEntrForPrepayment','_PrjBlgElmOverduePrepayment' ]

@AccessControl.personalData.blocking: #NOT_REQUIRED

@ObjectModel.usageType: {
    sizeCategory: #XL,
    dataClass:  #TRANSACTIONAL,
    serviceQuality: #C
}

@ObjectModel.sapObjectNodeType.name: 'ProjectBillingElement'

@EndUserText.label: 'Details of Billing Element'
define root view entity R_ProjectBillingElementTP
  as select from I_ProjectBillingElement as ProjectBillingElement

  association [1..1] to I_EnterpriseProjectElement     as _EnterpriseProjectElement    on  $projection.BillingWBSElementInternalID = _EnterpriseProjectElement.WBSElementInternalID

  association [1..1] to P_ProjBillgElmntSalesDets2     as _ProjBillgElmntSalesDets     on  $projection.ProjectBillingElementUUID = _ProjBillgElmntSalesDets.ProjectBillingElementUUID
  association [1..1] to P_ProjectBillingElmntDueDate3  as _DueBillingDate              on  $projection.ProjectBillingElementUUID = _DueBillingDate.ProjectBillingElementUUID

  association [0..1] to I_TmpProjectBillingRequest     as _TmpProjectBillingRequest    on  $projection.ProjectBillingElementUUID = _TmpProjectBillingRequest.ProjectBillingElementUUID

  association [0..1] to I_PrjBlgElmOverduePrepayment   as _PrjBlgElmOverduePrepayment  on  $projection.ProjectBillingElementUUID = _PrjBlgElmOverduePrepayment.ProjectBillingElementUUID
  association [0..1] to I_PrjBlgElmPrepaymentAmount    as _PrjBlgElmPrepaymentAmount   on  $projection.ProjectBillingElementUUID = _PrjBlgElmPrepaymentAmount.ProjectBillingElementUUID
  association [0..1] to I_PrjBlgElmBllbleRevnAmt       as _PrjBlgElmBllbleRevnAmt      on  $projection.ProjectBillingElementUUID = _PrjBlgElmBllbleRevnAmt.ProjectBillingElementUUID

  -- can be moved to C_
  association [0..*] to I_ProjectBillingDocDetails     as _ProjectBillingDocDetails    on  $projection.BillingWBSElementInternalID = _ProjectBillingDocDetails.WBSElementInternalID

  -- can be moved to C_
  association [0..*] to R_ProjectBillingRequestItemTP  as _ProjectBillingRequestItemTP on  $projection.ProjectBillingElementUUID = _ProjectBillingRequestItemTP.ProjectBillingElementUUID

  association [1..1] to I_ProfitCenterText             as _ProfitCenterName            on  $projection.WBSElementProfitCenter =  _ProfitCenterName.ProfitCenter
                                                                                       and $projection.ControllingArea        =  _ProfitCenterName.ControllingArea
                                                                                       and $projection.projectstartdate       <= _ProfitCenterName.ValidityEndDate
                                                                                       and $projection.projectstartdate       >= _ProfitCenterName.ValidityStartDate
                                                                                       and _ProfitCenterName.Language         = $session.system_language
  association [1..1] to I_Customer                     as _Customer                    on  $projection.Customer = _Customer.Customer

  -- can be moved to C_
  association [0..*] to I_PrjBlgElmEntrForPrepayment   as _PrjBlgElmEntrForPrepayment  on  $projection.ProjectBillingElementUUID = _PrjBlgElmEntrForPrepayment.ProjectBillingElementUUID

  association [0..1] to I_EngagementProjectSrvcOrgText as _ServiceOrganizationText     on  _ServiceOrganizationText.EngagementProjectServiceOrg = $projection.EngagementProjectServiceOrg
                                                                                       and _ServiceOrganizationText.Language                    = $session.system_language

  //Extensibility

  association [0..1] to E_ProjectBillingElement        as _Extension                   on  $projection.ProjectBillingElementUUID = _Extension.ProjectBillingElementUUID

  composition [0..*] of R_ProjectBillingElementEntryTP as _ProjectBillingElementEntry
  composition [0..1] of R_ProjBillgElmObjectLinkTP     as _ProjBillgElmObjectLink
{
  key ProjectBillingElement.ProjectBillingElementUUID,
      ProjectBillingElement.BillingWBSElementInternalID,
      ProjectBillingElement.DocumentCurrency,
      ProjectBillingElement.BilledRevenueAmtInDocCrcy,
      ProjectBillingElement.WrittenOffRevenueAmtInDocCrcy,
      ProjectBillingElement.ProjBillingProfile                                                         as ProjBillingProfile,
      ProjectBillingElement.ProjectBillingCategory                                                     as ProjectBillingCategory,
      // Admin Fields data

      @Semantics.user.createdBy: true
      ProjectBillingElement.ProjBillgElmntCreatedByUser,
      @Semantics.systemDateTime.createdAt: true
      ProjectBillingElement.ProjBillgElmntCreatedAtDteTme,
      @Semantics.user.lastChangedBy: true
      ProjectBillingElement.ProjBillgElmntLastChgdByUser,
      @Semantics.systemDateTime.lastChangedAt: true
      ProjectBillingElement.ProjBillgElmntLastChgdAtDteTme,

      cast( _EnterpriseProjectElement.ProjectElement as ps_posid_edit preserving type )                as WBSElementExternalID,
      -- { POC ToBill calculation - To be deleted
      _ProjBillgElmntSalesDets.BillingWBSElementInternalID                                             as DestinationWBSElement,
      -- } POC ToBill calculation
      cast ( ProjectBillingElement._WBSElement.ProjectInternalID as ps_s4_proj_pspnr preserving type ) as ProjectInternalID,
      _ProjBillgElmntSalesDets.BillingPlan,
      _ProjBillgElmntSalesDets.SalesOrder,     // 2208 | Partner Function changes

      _ProjBillgElmntSalesDets.SalesOrderItem, // 2208 | Partner Function changes

      _ProjBillgElmntSalesDets.TransactionCurrency                                                     as TransactionCurrency,

      // The below field is used in I_ProfitCenterText and hence cannot be moved up

      _EnterpriseProjectElement.ProfitCenter                                                           as WBSElementProfitCenter,

      --hierarchical value help for profit centre realization
      cast('' as fis_prctr_hryid_42)                                                                   as ProfitCenterHierarchy,
      cast('' as fis_prctr_hrynid_50)                                                                  as ProfitCenterHierarchyNode,

      @Semantics.amount.currencyCode: 'DocumentCurrency'
      _ProjBillgElmntSalesDets.CappedNetAmount                                                         as CappedNetAmount,

      _EnterpriseProjectElement._Project.ControllingArea                                               as ControllingArea,
      _EnterpriseProjectElement._Project.Project                                                       as Project,
      _EnterpriseProjectElement._Project.ProfitCenter,
      _EnterpriseProjectElement._Project.ProcessingStatus,
      _EnterpriseProjectElement._Project.ProjectStartDate,
      _EnterpriseProjectElement._Project.ProjectEndDate,
      -- Is needed is C-view for on-condition in association to the Customer contact card
      _ProjBillgElmntSalesDets._SalesOrder.SoldToParty                                                 as Customer,

      _TmpProjectBillingRequest.ProjectBillingRequest,
      _TmpProjectBillingRequest.ProjectBillingRequestUUID,
      -- used in C-view in where clause
      _ProjBillgElmntSalesDets.SDDocumentRejectionStatus                                               as SDDocumentRejectionStatus,
      _ProjBillgElmntSalesDets.BillingBlockStatus,
      _ProjBillgElmntSalesDets._SalesOrder.TotalBlockStatus,
      _ProjBillgElmntSalesDets._SalesOrder.OverallBillingBlockStatus,
      _ProjBillgElmntSalesDets.BillingBlockReason                                                      as BillingBlockReason,
      _ProjBillgElmntSalesDets._SalesOrder.HeaderBillingBlockReason                                    as HeaderBillingBlockReason,
      _ProjBillgElmntSalesDets.SalesDocumentRjcnReason                                                 as SalesDocumentRjcnReason,
      _EnterpriseProjectElement._Project.EnterpriseProjectServiceOrg                                   as EngagementProjectServiceOrg,
      _DueBillingDate.DueBillingDate,
      _DueBillingDate.UserID,
      --@Semantics.amount.currencyCode: 'DocumentCurrency'
      --_PrjBlgElmBllbleRevnAmt.BillableRevenueAmtInDocCrcy,

      _PrjBlgElmOverduePrepayment.PrjBlgElmPlndPrepaymentIsOvrd,
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      _PrjBlgElmPrepaymentAmount.PlndPrepaymentAmtInProjCrcy,
      -- { adding this due to bad performance on C-view
      _EnterpriseProjectElement._Project.ProjectDescription                                            as ProjectDescription,
      cast (_EnterpriseProjectElement._Project.EnterpriseProjectServiceOrg as crmt_service_org_resp )  as ServiceOrganizationUnit,
      _EnterpriseProjectElement._Project.ResponsibleCostCenter                                         as ResponsibleCostCenter,
      -- }
      _ProjectBillingDocDetails,
      _ServiceOrganizationText,
      _ProfitCenterName,
      _PrjBlgElmBllbleRevnAmt,

      _PrjBlgElmEntrForPrepayment,
      _ProjBillgElmntSalesDets._SalesDocItemBillPlan,
      _ProjBillgElmntSalesDets._SalesOrderItem,
      _ProjBillgElmntSalesDets._SalesOrder,
      _ProjectBillingElementEntry,
      ProjectBillingElement._WBSElement,
      _ProjectBillingRequestItemTP,
      _Customer,
      _EnterpriseProjectElement,

      _PrjBlgElmPrepaymentAmount,
      _PrjBlgElmOverduePrepayment,
      _ProjBillgElmObjectLink
}

//define root view entity R_ProjectBillingElementTP

//  as select from    I_ProjectBillingElement   as ProjectBillingElement

//  // This is a temporary workaround tried out below :  FXU

//  // Need to change once associations are supported in projection view - changes are done in line 23 to 32

//  // added extra inner join (upto line 31) just because we were getting several errors while accessing

//  // This is not correct way to do associations/joins: Currently this is only done to improve performance in below view

//  // I_ProjectBillingElement - The service quality can now be changed to A from C

//  --//added by FXU

//  --inner join      I_WBSElementBasicData     as _WBSData                 on ProjectBillingElement.BillingWBSElementInternalID = _WBSData.WBSElementInternalID

//  --left outer to one join I_SalesOrderItem          as _SalesOrderItemData on ProjectBillingElement.BillingWBSElementInternalID = _SalesOrderItemData.WBSElement --BP bring back

//

//  -- { POC ToBill calculation

//  left outer one to one join P_ProjectBillingElmntDueDate3 as DueBillingDate on ProjectBillingElement.ProjectBillingElementUUID = DueBillingDate.ProjectBillingElementUUID

//   -- } POC ToBill calculation

//

//  left outer to one join I_WBSElementBasicData     as _WBSData            on ProjectBillingElement.BillingWBSElementInternalID = _WBSData.WBSElementInternalID                     --BP bring back

//  --inner join I_EnterpriseProjectElement as EnterpriseProjectElement    on  ProjectBillingElement.BillingWBSElementInternalID = EnterpriseProjectElement.WBSElementInternalID

//  --                                                                     and EnterpriseProjectElement.WBSElementIsBillingElement = 'X'

//

//  //  inner join      I_ProjectBasicData        as _Proj                    on _WBSData.ProjectInternalID = _Proj.ProjectInternalID

//

//  //    inner join      I_EngagementProjectItem   as _EngProjItem             on  _Proj.ProjectObject                    = _EngProjItem.EngagementProjectItem

//  //                                                                          and _EngProjItem.EngagementProjectItemType = '0PD'

//  //    inner join      I_EngagementProject       as EngProj                  on _EngProjItem.EngagementProject = EngProj.EngagementProject

//

//

////    left outer join P_CUSTPROJSLSORDITMBYUSER as _CUSTPROJSLSORDITMBYUSER on  _CUSTPROJSLSORDITMBYUSER.WBSElement = ProjectBillingElement.BillingWBSElementInternalID

////                                                                          and _CUSTPROJSLSORDITMBYUSER.UserID     = $session.user

//

//   -- { POC ToBill calculation

//    --association [1..1] to P_ProjBillgElmntSalesDets  as _ProjBillgElmntSalesDets  on $projection.BillingWBSElementInternalID = _ProjBillgElmntSalesDets.BillingWBSElementInternalID

//  association [1..1] to P_ProjBillgElmntSalesDets2  as _ProjBillgElmntSalesDets  on $projection.ProjectBillingElementUUID = _ProjBillgElmntSalesDets.ProjectBillingElementUUID

//  association [1..1] to P_PrjBlgElmBllbleRevnAmt2   as _PrjBlgElmBllbleRevnAmt   on $projection.ProjectBillingElementUUID = _PrjBlgElmBllbleRevnAmt.ProjectBillingElementUUID

//   -- } POC ToBill calculation

//

//

//

//  --inner join P_ProjBillgElmntSalesDets  as _ProjBillgElmntSalesDets  on ProjectBillingElement.BillingWBSElementInternalID = _ProjBillgElmntSalesDets.BillingWBSElementInternalID

//  --association [0..1] to P_ProjectBillingElmntDueDate as _ProjBillgElmntDueDate    on  $projection.BillingPlan = _ProjBillgElmntDueDate.BillingPlan

//  --_MyProjectBillingElements.BillingWBSElementInternalID = ProjectBillingElement.BillingWBSElementInternalID

//  --association [0..1] to I_MyProjectBillingElements as _MyProjectBillingElements on $projection.SalesOrder     = _MyProjectBillingElements.SalesOrder

//  --                                                                             and $projection.SalesOrderItem = _MyProjectBillingElements.SalesOrderItem

//  --_MyProjectBillingElements.BillingWBSElementInternalID = ProjectBillingElement.BillingWBSElementInternalID

//                                                                                --and _MyProjectBillingElements.UserID = $session.user

//

//

//

//

//  --association [1..1] to I_EnterpriseProject            as _EnterpriseProject           on  _WBSData.ProjectInternalID = _EnterpriseProject.ProjectInternalID

//  association [1..1] to I_EnterpriseProject            as _EnterpriseProject           on  $projection.ProjectInternalID = _EnterpriseProject.ProjectInternalID

////  association [1..1] to I_EngagementProjectItem        as _EngProjItem1                on  $projection.ProjectObject               = _EngProjItem1.EngagementProjectItem

////                                                                                       and _EngProjItem1.EngagementProjectItemType = '0PD'

////                                                                                       and $projection.project                     = _EngProjItem1.EngagementProject

//  association [1..1] to I_EnterpriseProjectElement     as _EnterpriseProjectElement    on  $projection.BillingWBSElementInternalID = _EnterpriseProjectElement.WBSElementInternalID

//                                                                                      and _EnterpriseProjectElement.WBSElementIsBillingElement = 'X'

//

//  --association [1..1] to I_SalesOrderItem               as _SalesOrderItem              on  $projection.BillingWBSElementInternalID = _SalesOrderItem.WBSElementInternalID

//  --association [1..1] to I_SalesOrderItem               as _SalesOrderItem              on _SalesOrderItemData.SalesOrder     = _SalesOrderItem.SalesOrder     --BP bring back

//  --                                                                                    and _SalesOrderItemData.SalesOrderItem = _SalesOrderItem.SalesOrderItem --BP bring back

//  --association [1..1] to I_SalesOrder                   as _SalesOrder                  on  $projection.salesorder = _SalesOrder.SalesOrder // 2208 | Partner Function changes

//  --association [1..*] to I_SalesDocItemCompletePartner  as _SalesItemCompletePartner on $projection.salesorder = _SalesItemCompletePartner.SalesDocument // 2208 | Partner Function changes

//  --                                                                                  and $projection.salesorderitem=_SalesItemCompletePartner.SalesDocumentItem

//

//

//  --association [1..1] to I_SalesDocItemBillingPlan        as _SalesDocItemBillPlan        on  $projection.billingplan = _SalesDocItemBillPlan.BillingPlan

//  --association [1..1] to I_SalesDocItemBillingPlan        as _SalesDocItemBillPlan        on _SalesOrderItemData.SalesOrder = _SalesDocItemBillPlan.SalesDocument         --BP bring back

//  --                                                                                      and _SalesOrderItemData.SalesOrderItem = _SalesDocItemBillPlan.SalesDocumentItem --BP bring back

//   association [1..*] to I_ProjectBillingDocDetails     as _ProjectBillingDocDetails    on  $projection.BillingWBSElementInternalID = _ProjectBillingDocDetails.WBSElementInternalID

//  //  association [0..1] to I_WBSElementBasicData          as _WBSElement                  on  $projection.BillingWBSElementInternalID = _WBSElement.WBSElementInternalID

//  // association [1..*] to I_ProjectBillgRequestRevnCube  as _ProjectBillgRequestRevnCube  on  $projection.ProjectBillingElementUUID = _ProjectBillgRequestRevnCube.ProjectBillingElementUUID

//  association [1..1] to I_TmpProjectBillingRequest     as _TmpProjectBillingRequest    on  $projection.ProjectBillingElementUUID = _TmpProjectBillingRequest.ProjectBillingElementUUID

//                                                                                       and _TmpProjectBillingRequest.ProjectBillingRequestStatus = 'C'

//  association [0..*] to R_ProjectBillingRequestItemTP  as _ProjectBillingRequestItemTP on  $projection.ProjectBillingElementUUID = _ProjectBillingRequestItemTP.ProjectBillingElementUUID

//

////  association [0..1] to I_CostCenter                   as _CostCenter                  on  $projection.responsiblecostcenter = _CostCenter.CostCenter

////                                                                                       and $projection.ControllingArea  =  _CostCenter.ControllingArea

////                                                                                       and $projection.projectstartdate <= _CostCenter.ValidityEndDate

////                                                                                       and $projection.projectstartdate >= _CostCenter.ValidityStartDate

////  association [0..1] to I_CostCenterText               as _CostCenterText              //on  $projection.costcenter       =  _CostCenterText.CostCenter

////                                                                                       on  $projection.responsiblecostcenter =  _CostCenterText.CostCenter

////                                                                                       and $projection.ControllingArea  =  _CostCenterText.ControllingArea

////                                                                                       and $projection.projectstartdate <= _CostCenterText.ValidityEndDate

////                                                                                       and $projection.projectstartdate >= _CostCenterText.ValidityStartDate

////////                                                                                       and $projection.plannedstartdate <= _CostCenterText.ValidityEndDate

////////                                                                                       and $projection.plannedstartdate >= _CostCenterText.ValidityStartDate

////                                                                                       and _CostCenterText.Language     = $session.system_language

////  association [0..1] to I_ProfitCenterText             as _ProfitCenterText            on  $projection.ProfitCenter     =  _ProfitCenterText.ProfitCenter

////                                                                                       and $projection.ControllingArea  =  _ProfitCenterText.ControllingArea

////                                                                                       and $projection.projectstartdate <= _ProfitCenterText.ValidityEndDate

////                                                                                       and $projection.projectstartdate >= _ProfitCenterText.ValidityStartDate

//////                                                                                       and $projection.plannedstartdate <= _ProfitCenterText.ValidityEndDate

//////                                                                                       and $projection.plannedstartdate >= _ProfitCenterText.ValidityStartDate

////                                                                                       and _ProfitCenterText.Language   = $session.system_language

//  association [1..1] to I_ProfitCenterText             as _ProfitCenterName            on  $projection.WBSElementProfitCenter =  _ProfitCenterName.ProfitCenter

//                                                                                       and $projection.ControllingArea        =  _ProfitCenterName.ControllingArea

//                                                                                       and $projection.projectstartdate         <= _ProfitCenterName.ValidityEndDate

//                                                                                       and $projection.projectstartdate         >= _ProfitCenterName.ValidityStartDate

////                                                                                       and $projection.plannedstartdate       <= _ProfitCenterName.ValidityEndDate

////                                                                                       and $projection.plannedstartdate       >= _ProfitCenterName.ValidityStartDate

//                                                                                       and _ProfitCenterName.Language         = $session.system_language

//  --association [1..1] to I_ProjectBillingElmntDueDate   as _ProjBillingDueDate          on  $projection.ProjectBillingElementUUID = _ProjBillingDueDate.ProjectBillingElementUUID

//    //on $projection.billingplan = _ProjBillingDueDate.BillingPlan

//  association [1..1] to I_Customer                     as _Customer                    on  $projection.Customer = _Customer.Customer

//

//  association [0..*] to I_PrjBlgElmEntrForPrepayment   as _PrjBlgElmEntrForPrepayment  on  $projection.ProjectBillingElementUUID                   = _PrjBlgElmEntrForPrepayment.ProjectBillingElementUUID

//                                                                                     //  and _PrjBlgElmEntrForPrepayment.PlndPrepaymentAmtInProjCrcy > 0 commenting to check the perfromance impact

//

//  association [0..1] to I_EngagementProjectSrvcOrgText as _ServiceOrganizationText     on  _ServiceOrganizationText.EngagementProjectServiceOrg = $projection.EngagementProjectServiceOrg

//                                                                                       and _ServiceOrganizationText.Language                    = $session.system_language

//

//  //Extensibility

//  association [0..1] to E_ProjectBillingElement        as _Extension                   on  $projection.ProjectBillingElementUUID = _Extension.ProjectBillingElementUUID

//

//  association [0..1] to I_PrjBlgElmPrepaymentAmount    as _PrjBlgElmPrepaymentAmount   on $projection.ProjectBillingElementUUID = _PrjBlgElmPrepaymentAmount.ProjectBillingElementUUID

//

//  association [0..1] to I_PrjBlgElmOverduePrepayment   as _PrjBlgElmOverduePrepayment  on $projection.ProjectBillingElementUUID = _PrjBlgElmOverduePrepayment.ProjectBillingElementUUID

//

//  // association [1..1] to C_BusinessPartner              as _BusinessPartner           on  $projection.Customer = _BusinessPartner.BusinessPartner

//

//  //association [1..1] to P_PrjBlgElmRevnAmount as _PrjBlgElmRevnAmount on  $projection.ProjectBillingElementUUID = _PrjBlgElmRevnAmount.ProjectBillingElementUUID

//

////  association [0..1] to P_PrjBlgElmBllbleRevnAmt as _PrjBlgElmBllbleRevnAmt on $projection.ProjectBillingElementUUID = _PrjBlgElmBllbleRevnAmt.ProjectBillingElementUUID

//

//  composition [0..*] of R_ProjectBillingElementEntryTP as _ProjectBillingElementEntry

//  composition [0..1] of R_ProjBillgElmObjectLinkTP     as _ProjBillgElmObjectLink

//  --association [1..1] to P_ProjBillgCustomerProjectDets as _CustomerProjectDets on $projection.ProjectInternalID = _CustomerProjectDets.ProjectInternalID

//{

//  key ProjectBillingElement.ProjectBillingElementUUID,

//      ProjectBillingElement.BillingWBSElementInternalID,

//      ProjectBillingElement.DocumentCurrency,

//      // ProjectBillingElement.OriginalRevenueAmtInDocCrcy,

//      ProjectBillingElement.BilledRevenueAmtInDocCrcy,

//      ProjectBillingElement.WrittenOffRevenueAmtInDocCrcy,

//      ProjectBillingElement.ProjBillingProfile            as ProjBillingProfile,

//      ProjectBillingElement.ProjectBillingCategory        as ProjectBillingCategory,

//      // Admin Fields data

//      @Semantics.user.createdBy: true

//      ProjectBillingElement.ProjBillgElmntCreatedByUser,

//      @Semantics.systemDateTime.createdAt: true

//      ProjectBillingElement.ProjBillgElmntCreatedAtDteTme,

//      @Semantics.user.lastChangedBy: true

//      ProjectBillingElement.ProjBillgElmntLastChgdByUser,

//      @Semantics.systemDateTime.lastChangedAt: true

//      ProjectBillingElement.ProjBillgElmntLastChgdAtDteTme,

//

//      // The below is referred in association for P_CUSTPROJSLSORDITMBYUSER(My billing elements) and hence cannot be moved up

//      // _WBSElement.WBSElementExternalID               as WBSElement,

//       _WBSData.WBSElementExternalID                                           as WBSElementExternalID, // WBSElement, //

//       -- { POC ToBill calculation

//       _ProjBillgElmntSalesDets.BillingWBSElementInternalID as DestinationWBSElement,

//       -- } POC ToBill calculation

//      --ProjectBillingElement._WBSElement.WBSElementExternalID                                           as WBSElementExternalID, // WBSElement, //

//      --cast( EnterpriseProjectElement.ProjectElement as ps_posid_edit preserving type ) as WBSElementExternalID ,

//      cast ( _WBSData.ProjectInternalID as ps_s4_proj_pspnr preserving type ) as ProjectInternalID,

//      --cast ( ProjectBillingElement._WBSElement.ProjectInternalID as ps_s4_proj_pspnr preserving type ) as ProjectInternalID,

//      --EnterpriseProjectElement.ProjectInternalID  as ProjectInternalID,

//      // The below field is referred in I_CostCenterText and I_ProfitCenterText ;hence cannot be moved up

//      //      EngProj.CostCenter,

//      // The below field is referred in I_CostCenterText and I_ProfitCenterText ;hence cannot be moved up

//      //      EngProj.ControllingArea,

//      // The below field is used in I_EngagementProject and hence cannot be moved up

//      //     EngProj.EngagementProject,

//      // The below field is referred in I_ProfitCenterText ;hence cannot be moved up

//      //      EngProj.ProfitCenter,

//      //Tried moving up,it threw error

//      //      EngProj.EngagementProjectStage                                                                                                                as EngagementProjectStage,

//      // The below field is used in I_EngagementProjectItem and hence cannot be moved up

//      //_WBSElement._Project.ProjectObject             as ProjectObject, //ProjectObject,

//      -- Don't find where it's used

//      -- _WBSData._Project.ProjectObject                                       as ProjectObject,

//

//      // The below field is used in I_EngagementProjectItem and hence cannot be moved up

//      //_Proj.Project,

////      _WBSData._Project.Project,

//      // The below is introduced to be used in asscoiation of view I_ProfitCenterText

//      //      _Proj.PlannedStartDate                                                                                                                        as PlannedStartDate,

//      // Exposed for my billing element dcl changes. Since its a inner join we cannot use it in dcl without exposing in tp view

//      //      EngProj.EngagementProjectServiceOrg,

//      // Customer field is moved in this view as the contact card view works on direct fetched fields from underlying view

//      //     EngProj.Customer                                                                                                                              as Customer,

//      // The below field is used in I_SlsDocItemBillingPlan and I_SlsDocItemBillingPlanDueDate ; hence cannot be moved up

//      --_SalesOrderItem.BillingPlan,

//      --_SalesOrderItem.SalesOrder, // 2208 | Partner Function changes

//      --_SalesOrderItem.SalesOrderItem, // 2208 | Partner Function changes

//      --_SalesOrderItem.TransactionCurrency as TransactionCurrency,

//      _ProjBillgElmntSalesDets.BillingPlan,

//      _ProjBillgElmntSalesDets.SalesOrder, // 2208 | Partner Function changes

//      _ProjBillgElmntSalesDets.SalesOrderItem, // 2208 | Partner Function changes

//      _ProjBillgElmntSalesDets.TransactionCurrency as TransactionCurrency,

//

//      // The below field is used in I_ProfitCenterText and hence cannot be moved up

//      //_WBSElement.ProfitCenter                       as WBSElementProfitCenter,

//      _WBSData.ProfitCenter                                                 as WBSElementProfitCenter,

//      --ProjectBillingElement._WBSElement.ProfitCenter                                                 as WBSElementProfitCenter,

//      --EnterpriseProjectElement.ProfitCenter                                                 as WBSElementProfitCenter,

//      // The below field cannot be removed as its being used in view : I_ProjectBillingElementEntryTP which inturn uses this view

//

//      --hierarchical value help for profit centre realization

//      cast('' as fis_prctr_hryid_42) as ProfitCenterHierarchy,

//      cast('' as fis_prctr_hrynid_50) as ProfitCenterHierarchyNode,

//

//      @Semantics.amount.currencyCode: 'DocumentCurrency'

//      --_SalesOrderItem.CappedNetAmount                                       as CappedNetAmount,

//      _ProjBillgElmntSalesDets.CappedNetAmount                              as CappedNetAmount,

//

//      //      _EnterpriseProject._ProjectElement.CostCenter,

//      --_EnterpriseProject.ResponsibleCostCenter,   //                        as CostCenter,

//      --_CustomerProjectDets.ResponsibleCostCenter,   //                        as CostCenter,

//      _EnterpriseProject.ControllingArea                                    as ControllingArea,

//      --EnterpriseProjectElement._Project.ControllingArea                                  as ControllingArea,

//      _EnterpriseProject.Project                                            as Project,

//      --EnterpriseProjectElement._Project.Project                                            as Project,

//      _EnterpriseProject.ProfitCenter,

//      --EnterpriseProjectElement._Project.ProfitCenter,

//      --_CustomerProjectDets.ProfitCenter,

//      _EnterpriseProject.ProcessingStatus,        //                        as EngagementProjectStage,

//      --EnterpriseProjectElement._Project.ProcessingStatus,        //                        as EngagementProjectStage,

////      _EnterpriseProject.PlannedStartDate,

//      _EnterpriseProject.ProjectStartDate,

//      --EnterpriseProjectElement._Project.ProjectStartDate,

////      _EnterpriseProject.PlannedEndDate,

//      _EnterpriseProject.ProjectEndDate,

//      --EnterpriseProjectElement._Project.ProjectEndDate,

//      -- _EnterpriseProject.ProjectDescription,

//

//      //     _EnterpriseProject.EnterpriseProjectServiceOrg as EngagementProjectServiceOrg,

//      -- Is needed is C-view for on-condition in association to the Customer contact card

//      --_SalesOrderItem._SalesOrder.SoldToParty                               as Customer,

//      _ProjBillgElmntSalesDets._SalesOrder.SoldToParty                               as Customer,

//      //       _Customer.CustomerName                        as CustomerName,

//      //     _SalesOrder.SalesOrganization,

//      //      _SalesOrder.DistributionChannel,

//      //

//

//      // My Billing element related changes

//      -- moved to consumption view

////      case

////      when _MyProjectBillingElements.UserID = $session.user

////       then cast ('X' as boolean)

////       else cast (''  as boolean)

////      end as IsMyProjectBillingElement,

//      --_MyProjectBillingElements,

//

//  //    _CUSTPROJSLSORDITMBYUSER.IsMyProjectBillingElement as IsMyProjectBillingElement,

//      //IsMyProjectBillingElement,

//      // This field cannot be moved to up view as this comes from P-view so association cannot be exposed and used

//      //_CUSTPROJSLSORDITMBYUSER.UserID,

//

//      _ProjBillgElmntSalesDets.UserID,

//

//      // All Revenue cube fields

//

//      _TmpProjectBillingRequest.ProjectBillingRequest,

//

//      _TmpProjectBillingRequest.ProjectBillingRequestUUID,

//      //  _ProjectBillgRequestRevnCube.ProjectBillingRequest, //Draft ID

//      //  _ProjectBillgRequestRevnCube.ProjectBillingRequestUUID,

//

//      -- not used

//      -- _WBSData._Project.ProjectCurrency,

//      // @Semantics.amount.currencyCode: 'ProjectCurrency'

//

//

//      --_SalesOrderItem.SalesOrder,

//      -- used in C-view in where clause BlockStatuses and Reasons

//      --_SalesOrderItem.BillingBlockStatus,

//      --_SalesOrderItem._SalesOrder.TotalBlockStatus,

//      --_SalesOrderItem.ItemBillingBlockReason as BillingBlockReason,

//      --_SalesOrderItem._SalesOrder.HeaderBillingBlockReason as HeaderBillingBlockReason,

//      --_SalesOrderItem.SalesDocumentRjcnReason as SalesDocumentRjcnReason,

//      _ProjBillgElmntSalesDets.BillingBlockStatus,

//      _ProjBillgElmntSalesDets._SalesOrder.TotalBlockStatus,

//      _ProjBillgElmntSalesDets._SalesOrder.OverallBillingBlockStatus,

////      _ProjBillgElmntSalesDets._SalesOrder.

//      _ProjBillgElmntSalesDets.BillingBlockReason as BillingBlockReason,

//      _ProjBillgElmntSalesDets._SalesOrder.HeaderBillingBlockReason as HeaderBillingBlockReason,

//      _ProjBillgElmntSalesDets.SalesDocumentRjcnReason as SalesDocumentRjcnReason,

//

////      _SalesOrderItem._ItemBillingBlockReason.BillingBlockReason as BillingBlockReason,

////      _SalesOrderItem._SalesOrder._HeaderBillingBlockReason.BillingBlockReason as HeaderBillingBlockReason,

//

//      _ProjectBillingDocDetails,

//      _ServiceOrganizationText,

//      _EnterpriseProject.EnterpriseProjectServiceOrg                        as EngagementProjectServiceOrg,

//      --EnterpriseProjectElement._Project.EnterpriseProjectServiceOrg                        as EngagementProjectServiceOrg,

//      --_ProfitCenterText,

//      _ProfitCenterName,

////      _EngProjItem1,

//     // _ProjBillingDueDate,

//      --_ProjBillingDueDate(P_BillingPlanItemUsage: '1').DueBillingDate as DueBillingDate,

//      --_ProjBillingDueDate(P_BillingPlanItemUsage: '').DueBillingDate as BillingPlanBillingDate,

//

//      --_ProjBillingDueDate.DueBillingDate,  //as BillingPlanBillingDate,

//      --_ProjBillgElmntDueDate.DueBillingDate,  //as BillingPlanBillingDate,

//

//      -- { POC ToBill calculation

//      --_ProjBillgElmntSalesDets.DueBillingDate,

//      DueBillingDate.DueBillingDate,

//      -- } POC ToBill calculation

////      case

////        when _ProjBillingDueDate(P_BillingPlanItemUsage: '1').DueBillingDate = '00000000' //is initial

////          then cast(_ProjBillingDueDate(P_BillingPlanItemUsage: '1').DueBillingDate as fkdat)

////        else cast(_ProjBillingDueDate(P_BillingPlanItemUsage: '1').DueBillingDate as fkdat)

////      end as DueBillingDate,

//

//      _PrjBlgElmEntrForPrepayment,

//      --_SalesDocItemBillPlan,

//      _ProjBillgElmntSalesDets._SalesDocItemBillPlan,

//      --_SalesOrderItem,

//      _ProjBillgElmntSalesDets._SalesOrderItem,

//      _ProjBillgElmntSalesDets._SalesOrder,

////      _SalesOrder, // 2208 | Partner Function changes

////      _SalesItemCompletePartner, // 2208 | Partner Function changes

//      -- used in C-view in where clause

//    //  _SalesOrderItem._BillingPlan.BillingPlanUsageCategory as BillingPlanUsageCategory,

//--      _SalesOrder,

//      _ProjectBillingElementEntry,

//      ProjectBillingElement._WBSElement,

//      _ProjectBillingRequestItemTP,

//      _Customer,

//      _EnterpriseProject,

//      --EnterpriseProjectElement.ProjectUUID,

//      --EnterpriseProjectElement._Project as _EnterpriseProject,

//      _EnterpriseProjectElement,

//      //_CostCenterText,

//      -- used in C-view in where clause

//      --_SalesOrderItem.SDDocumentRejectionStatus as SDDocumentRejectionStatus,

//      _ProjBillgElmntSalesDets.SDDocumentRejectionStatus as SDDocumentRejectionStatus,

//

//      _PrjBlgElmOverduePrepayment.PrjBlgElmPlndPrepaymentIsOvrd,

//      @Semantics.amount.currencyCode: 'DocumentCurrency'

//      _PrjBlgElmPrepaymentAmount.PlndPrepaymentAmtInProjCrcy,

//      _PrjBlgElmPrepaymentAmount,

//      _PrjBlgElmOverduePrepayment,

//      _ProjBillgElmObjectLink,

//

////      _PrjBlgElmBllbleRevnAmt.BillableRevenueAmtInDocCrcy   //POC

//      -- { POC ToBill calculation

//      @Semantics.amount.currencyCode: 'DocumentCurrency'

//      _PrjBlgElmBllbleRevnAmt.BillableRevenueAmtInDocCrcy

//      -- } POC ToBill calculation

//

////      _PrjBlgElmRevnAmount.BillableRevenueAmtInDocCrcy,   //POC

////      _PrjBlgElmRevnAmount.BillgReqdRevenueAmtInDocCrcy,  //POC

////      _PrjBlgElmPlndRevnAmt //.PlndRevnAmt                //POC

//

//      --_SalesOrderItemData.SalesOrder,    --BP bring back

//      --_SalesOrderItemData.SalesOrderItem --BP bring back

//      --_CustomerProjectDets

//      //ProjectBillingElement.RootDraftUUID

//      //_ProjectBillingElemAdminData

//      //_CostCenter

//}