C_ProjectBillingElementTP

DDL: C_PROJECTBILLINGELEMENTTP Type: view_entity CONSUMPTION Package: ODATA_PROJBILLINGELEMENT_LIST

Details of Billing Element

C_ProjectBillingElementTP is a Consumption CDS View that provides data about "Details of Billing Element" in SAP S/4HANA. It reads from 1 data source (R_ProjectBillingElementTP) and exposes 86 fields with key field ProjectBillingElementUUID. It has 11 associations to related views. It is exposed through 1 OData service (PROJECTBILLINGELEMENT_SD). Part of development package ODATA_PROJBILLINGELEMENT_LIST.

Data Sources (1)

SourceAliasJoin Type
R_ProjectBillingElementTP R_ProjectBillingElementTP projection

Associations (11)

CardinalityTargetAliasCondition
[1..1] C_ProjBillgCustomerProjectDets _ProjBillgCustomerProjectDets $projection.CustomerProject = _ProjBillgCustomerProjectDets.Project
[1..1] C_ProjectBillingCustomerCard _CustomerContactCard $projection.Customer = _CustomerContactCard.Customer
[1..1] C_ProjectBillingCustomerCard _ShipToContactCard $projection.ShipToParty = _ShipToContactCard.Customer
[1..1] C_ProjectBillingCustomerCard _BillToContactCard $projection.BillToParty = _BillToContactCard.Customer
[1..1] C_ProjectBillingCustomerCard _PayerContactCard $projection.PayerParty = _PayerContactCard.Customer
[1..*] C_ProjBillgSlsItmBillgPlnDuDte _ProjBillgSlsItmBillgPlnDuDte $projection.BillingPlan = _ProjBillgSlsItmBillgPlnDuDte.BillingPlan
[1..*] C_ProjBillingInProcessDetails _ProjBillingInProcessDetails $projection.ProjectBillingElementUUID = _ProjBillingInProcessDetails.ProjectBillingElementUUID
[1..*] C_ProjBillgElmntPartnerDetails _ProjBillgElmntPartnerDetails $projection.SalesOrder = _ProjBillgElmntPartnerDetails.SalesOrder and $projection.SalesOrderItem = _ProjBillgElmntPartnerDetails.SalesOrderItem --used only in profit centre hierarchy filtering
[0..*] C_HierRuntimeRprstnDplLeafNode _ProfitCenterHierLeafNode $projection.ProfitCenter = _ProfitCenterHierLeafNode.UnivHierarchyBusinessEntity and $projection.ControllingArea = _ProfitCenterHierLeafNode.HierarchyNodeClass and _ProfitCenterHierLeafNode.ValidityStartDate <= $session.system_date and _ProfitCenterHierLeafNode.ValidityEndDate >= $session.system_date and _ProfitCenterHierLeafNode.HierarchyType = '0106' -- 2408 moved from R_ProjectBillingElementTP - UI Adaptation changes
[0..*] C_PrjBlgElmEntrForPrepayment _PrjBlgElmEntrForPrepayment $projection.ProjectBillingElementUUID = _PrjBlgElmEntrForPrepayment.ProjectBillingElementUUID -- 2408 moved from R_ProjectBillingElementTP - UI Adaptation changes
[0..*] C_ProjectBillingDocDetails _ProjectBillingDocDetails $projection.BillingWBSElementInternalID = _ProjectBillingDocDetails.WBSElementInternalID

Annotations (11)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
VDM.viewType #CONSUMPTION view
Search.searchable true view
ObjectModel.representativeKey ProjectBillingElementUUID view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
UI.headerInfo.typeName Billing Element view
UI.headerInfo.typeNamePlural Billing Elements view
UI.headerInfo.title.type #STANDARD view
UI.headerInfo.title.value WBSElementExternalID view

OData Services (1)

ServiceBindingVersionContractRelease
PROJECTBILLINGELEMENT_SD UI_PROJBILLGELMNT_SB_V2 V2 C1 NOT_TO_BE_RELEASED_STABLE

Fields (86)

KeyFieldSource TableSource FieldDescription
KEY ProjectBillingElementUUID ProjectBillingElementUUID
WBSElementExternalID Billing Element
ProjectBillingRequest ProjectBillingRequest Project Billing Request
ProjectBillingRequestUUID ProjectBillingRequestUUID
virtualIsActiveEntityboolean
virtualDraftIsCreatedByMeboolean Draft Created By Me
char12 Last Change By
char20 Last Change By Desc
virtualLastChangeDateTimeedms_changed_at Last Change Time
char12 In Process
virtualHasDraftEntityboolean
virtualHasActiveEntityboolean
dats8 Billing Due Date
DueBillingDate DueBillingDate
BillingWBSElementInternalID BillingWBSElementInternalID
curr232 To Bill
virtualIsMyProjectBillingElementboolean My Billing Elements
Customer Customer Customer
CustomerName _Customer CustomerName Customer
OrganizationBPName1 _Customer OrganizationBPName1
OrganizationBPName2 _Customer OrganizationBPName2
CustomerProject Project Project
ShipToParty ShipToParty Ship-to Party
ShipToPartyName _ShipToParty CustomerName Ship To Party
BillToParty BillToParty Bill-to Party
BillToPartyName _BillToParty CustomerName Bill To Party
PayerParty PayerParty Payer
PayerPartyName _PayerParty CustomerName Payer Party
virtualPartnerFunctionparvw_unv Partner Function
virtualPersonnelNumberpernr_d Personnel Number
char100 Partner
char1333 Partner Descr
ProjectDescription ProjectDescription Project
BillingPlanUsageCategory _SalesDocItemBillPlan BillingPlanUsageCategory
DocumentCurrency DocumentCurrency Document Currency
TransactionCurrency TransactionCurrency
BilledRevenueAmtInDocCrcy BilledRevenueAmtInDocCrcy Billed
curr232 Unbilled
char1
curr232 Billing in Process
ProfitCenter WBSElementProfitCenter Profit Center
ProfitCenterText _ProfitCenterName ProfitCenterName
curr232 Planned Revenue
CappedNetAmount CappedNetAmount Cap
WrittenOffRevenueAmtInDocCrcy WrittenOffRevenueAmtInDocCrcy Written Off
curr232 Down Payment Requested
curr232 Down Payment Received
WBSElementDescription _SalesOrderItem SalesDocumentItemText Billing Item Description
ServiceOrganizationUnit ServiceOrganizationUnit
ResponsibleCostCenter ResponsibleCostCenter
CostCenterProfitCenter ProfitCenter
EngagementProjectServiceOrg EngagementProjectServiceOrg Service Organization
dats8 Last Billing Date
char1
PlndPrepaymentAmtInProjCrcy PlndPrepaymentAmtInProjCrcy Planned PrePayment
curr232 Estimated Actuals
BillingPlan BillingPlan
virtualUICT_SalesOrdervbeln_va
virtualUICT_SalesOrderItemposnr_va
SalesOrder SalesOrder
SalesOrderItem SalesOrderItem
ProjBillgElmntCreatedByUser ProjBillgElmntCreatedByUser Created By User
ProjBillgElmntCreatedAtDteTme ProjBillgElmntCreatedAtDteTme Created At Time
ProjBillgElmntLastChgdByUser ProjBillgElmntLastChgdByUser Last Changed By User
ProjBillgElmntLastChgdAtDteTme ProjBillgElmntLastChgdAtDteTme Last Changed At Time
PrjBlgElmPlndPrepaymentIsOvrd PrjBlgElmPlndPrepaymentIsOvrd
virtualProjBillingReqIsAuthorizedboolean
ProjBillingProfile ProjBillingProfile
ProjectBillingCategory ProjectBillingCategory
usedinassociationControllingArea
EngmtProjectServiceOrgName _ServiceOrganizationText EngmtProjectServiceOrgName Organization Description
ProjectElementUUID ProjectElementUUID
_ProjectBillingDocDetails _ProjectBillingDocDetails
_WBSElement _WBSElement
_PrjBlgElmEntrForPrepayment _PrjBlgElmEntrForPrepayment
_MyProjectBillingElements
_CustomerContactCard _CustomerContactCard
_ShipToContactCard _ShipToContactCard
_BillToContactCard _BillToContactCard
_PayerContactCard _PayerContactCard
_ProjBillgElmntPartnerDetails _ProjBillgElmntPartnerDetails
_ProjBillgCustomerProjectDets _ProjBillgCustomerProjectDets
_ProjBillgSlsItmBillgPlnDuDte _ProjBillgSlsItmBillgPlnDuDte
_ProjBillingInProcessDetails _ProjBillingInProcessDetails
_ProjBillgElmObjectLink _ProjBillgElmObjectLink
_EnterpriseProjectElement _EnterpriseProjectElement
@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: ['_ProjBillgSlsItmBillgPlnDuDte', '_ProjBillingInProcessDetails']
@VDM.viewType: #CONSUMPTION
@VDM.usage.type: [ #TRANSACTIONAL_PROCESSING_SERVICE ]
//@Metadata.allowExtensions: true

@Search.searchable: true
@ObjectModel: {
   semanticKey:       [ 'WBSElementExternalID' ],
   representativeKey: 'ProjectBillingElementUUID'
}
@ObjectModel.usageType: {
    sizeCategory: #XL,
    dataClass:  #TRANSACTIONAL,
    serviceQuality: #C
}
@UI.headerInfo: {
  typeName:         'Billing Element',
  typeNamePlural:   'Billing Elements',
  title:            { type: #STANDARD, value: 'WBSElementExternalID' }
}
--@UI.presentationVariant: [{sortOrder: [{by: 'DueBillingDate' , direction: #DESC}], requestAtLeast: [ 'HasDraftEntity', 'IsActiveEntity', 'DraftIsCreatedByMe', 'LastChangedByUser', 'LastChangedByUserDescription', 'LastChangeDateTime', 'InProcessByUser', 'HasActiveEntity' ] }]
@UI.presentationVariant: [{sortOrder: [{by: 'DueBillingDate' , direction: #ASC}], requestAtLeast: [ 'DueBillingDate' ]}] //ASC


@Consumption.dbHints: ['USE_HEX_PLAN','NO_SUBPLAN_SHARING'] --  Performance testing
// @EndUserText.label: 'Details of Billing Element' //for filter grouping name

define root view entity C_ProjectBillingElementTP
  provider contract transactional_query
  as projection on R_ProjectBillingElementTP as ProjectBillingElement // Alias was added as it is necessary for configuration in scfd_registry


  association [1..1] to C_ProjBillgCustomerProjectDets as _ProjBillgCustomerProjectDets on  $projection.CustomerProject = _ProjBillgCustomerProjectDets.Project

  association [1..1] to C_ProjectBillingCustomerCard   as _CustomerContactCard          on  $projection.Customer = _CustomerContactCard.Customer
  association [1..1] to C_ProjectBillingCustomerCard   as _ShipToContactCard            on  $projection.ShipToParty = _ShipToContactCard.Customer
  association [1..1] to C_ProjectBillingCustomerCard   as _BillToContactCard            on  $projection.BillToParty = _BillToContactCard.Customer
  association [1..1] to C_ProjectBillingCustomerCard   as _PayerContactCard             on  $projection.PayerParty = _PayerContactCard.Customer

  association [1..*] to C_ProjBillgSlsItmBillgPlnDuDte as _ProjBillgSlsItmBillgPlnDuDte on  $projection.BillingPlan = _ProjBillgSlsItmBillgPlnDuDte.BillingPlan
  //                                                                                        and _ProjBillgSlsItmBillgPlnDuDte.BillingPlanRelatedBillgStatus = 'A' //POC ToBill


  association [1..*] to C_ProjBillingInProcessDetails  as _ProjBillingInProcessDetails  on  $projection.ProjectBillingElementUUID = _ProjBillingInProcessDetails.ProjectBillingElementUUID

  association [1..*] to C_ProjBillgElmntPartnerDetails as _ProjBillgElmntPartnerDetails on  $projection.SalesOrder     = _ProjBillgElmntPartnerDetails.SalesOrder
                                                                                        and $projection.SalesOrderItem = _ProjBillgElmntPartnerDetails.SalesOrderItem

  --used only in profit centre hierarchy filtering
  association [0..*] to C_HierRuntimeRprstnDplLeafNode as _ProfitCenterHierLeafNode     on  $projection.ProfitCenter                    = _ProfitCenterHierLeafNode.UnivHierarchyBusinessEntity
                                                                                        and $projection.ControllingArea                 = _ProfitCenterHierLeafNode.HierarchyNodeClass
                                                                                        and _ProfitCenterHierLeafNode.ValidityStartDate <= $session.system_date
                                                                                        and _ProfitCenterHierLeafNode.ValidityEndDate   >= $session.system_date
                                                                                        and _ProfitCenterHierLeafNode.HierarchyType     = '0106'
  -- 2408 moved from R_ProjectBillingElementTP - UI Adaptation changes
  association [0..*] to C_PrjBlgElmEntrForPrepayment   as _PrjBlgElmEntrForPrepayment   on  $projection.ProjectBillingElementUUID = _PrjBlgElmEntrForPrepayment.ProjectBillingElementUUID
  -- 2408 moved from R_ProjectBillingElementTP - UI Adaptation changes
  association [0..*] to C_ProjectBillingDocDetails     as _ProjectBillingDocDetails     on  $projection.BillingWBSElementInternalID = _ProjectBillingDocDetails.WBSElementInternalID

{

                        @UI.hidden: true
  key                   ProjectBillingElementUUID,
                        @Semantics.text: true
                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ], lineItem: [ { position: 10, importance: #HIGH } ] }
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        @EndUserText.label: 'Billing Element'
                        @EndUserText.quickInfo: 'Billing Element'
                        @Consumption.valueHelpDefinition: [{ entity: { name: 'I_BillingWBSBasicDataStdVH', element: 'WBSElementExternalID'}}]
                        cast( _EnterpriseProjectElement.ProjectElement as ps_posid_edit preserving type )  as WBSElementExternalID,

                        @EndUserText.label: 'Project Billing Request'
                        @EndUserText.quickInfo: 'Project Billing Request'
                        @Consumption.filter.hidden: true
                        ProjectBillingRequest,
                        //@ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'

                        //virtual ProjectBillingRequest : pbr_extid,


                        @UI.hidden: true
                        ProjectBillingRequestUUID,
                        //@ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'

                        //virtual ProjectBillingRequestUUID : pbr_uuid,



                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               IsActiveEntity                : boolean,

                        @UI.hidden: true
                        @EndUserText.label: 'Draft Created By Me'
                        @EndUserText.quickInfo: 'Draft Created By Me'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               DraftIsCreatedByMe            : boolean,

                        @UI.hidden: true
                        @EndUserText.label: 'Last Change By'
                        @EndUserText.quickInfo: 'Last Change By'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               LastChangedByUser             : abap.char( 12 ),

                        @UI.hidden: true
                        @EndUserText.label: 'Last Change By Desc'
                        @EndUserText.quickInfo: 'Last Change By Desc'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               LastChangedByUserDescription  : abap.char( 20 ),

                        @UI.hidden: true
                        @EndUserText.label: 'Last Change Time'
                        @EndUserText.quickInfo: 'Last Change Time'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               LastChangeDateTime            : edms_changed_at,

                        @UI.hidden: true
                        @EndUserText.label: 'In Process'
                        @EndUserText.quickInfo: 'In Process'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               InProcessByUser               : abap.char(12),

                        @UI.hidden: true
                        @ObjectModel.virtualElement: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               HasDraftEntity                : boolean,

                        @UI.hidden: true
                        @ObjectModel.virtualElement: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               HasActiveEntity               : boolean,


                        @EndUserText.label: 'Billing Due Date'
                        @EndUserText.quickInfo: 'Billing Due Date'
                        @Consumption.filter.hidden: false
                        @ObjectModel.filter.enabled: true
                        @Consumption.filter : {selectionType:#INTERVAL,multipleSelections: false}
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
                        @ObjectModel.sort.enabled: true
                        @ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'
                        @UI: { selectionField: [{ position: 200 }] }
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               BillingPlanBillingDate        : abap.dats(8), //Billing date for T&E



                        @UI.hidden: true
                        DueBillingDate, //from billing plan: max past, min future else 99991231


                        @UI.hidden: true
                        BillingWBSElementInternalID,

                        -- { POC ToBill calculation
                        -- the field is used in the filter logic for BillableRevenueAmtInDocCrcy
//                        @UI.hidden: true

//                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }

//                        _MyPrjBillgElmntBllbleRevnAmt.BillableRevenueAmtInDocCrcy                          as BllbleRevnAmtInDocCrcyFoFltr,

                        -- } POC ToBill calculation

                        @UI: { lineItem: [ { position: 110, importance: #HIGH, exclude: true } ] }
                        @EndUserText.label: 'To Bill'
                        @EndUserText.quickInfo: 'To Bill'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
//                        @ObjectModel.filter.enabled: true

//                        @ObjectModel.sort.enabled: true

                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
//                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'

//                        @ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               BillableRevenueAmtInDocCrcy   : abap.curr( 23 , 2 ),


                        -- the field is used in the filter logic for IsMyProjectBillingElement
                        @UI.hidden: true
                        UserID,

                        @Consumption.filter.hidden: false
                        @ObjectModel.filter.enabled: true
                        @Consumption.filter.selectionType: #SINGLE
                        @Consumption.filter.multipleSelections: false
                        @EndUserText.label: 'My Billing Elements'
                        @EndUserText.quickInfo: 'My Billing Elements'
                        @UI: { selectionField: [{ position: 210 }] }
                        @Consumption.filter.defaultValue: 'X'
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               IsMyProjectBillingElement     : boolean,

                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                         //@UI: { lineItem: [{position: 30, type: #AS_CONTACT, value: '_CustomerContactCard', label: 'Customer' }] ,  selectionField: [{ position: 10 }] }

                        @UI: { lineItem: [{position: 30, importance: #HIGH }], selectionField: [{ position: 10 }] }
                        @EndUserText.label: 'Customer'
                        @EndUserText.quickInfo: 'Customer'
                        @Consumption.valueHelpDefinition: [ { entity: { name : 'D_CustomerCVH', element: 'Customer' } } ]
                        @ObjectModel: { foreignKey.association: '_CustomerContactCard'}
                        @Consumption: { valueHelp: '_CustomerContactCard' }
                        @Consumption.semanticObject: 'Customer'
                        @ObjectModel.text.element: ['CustomerName']
                        //@UI.hidden: true //custom column will be used on UI

                        Customer,




                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        @EndUserText.label: 'Customer'
                        @EndUserText.quickInfo: 'Customer'
                        _Customer.CustomerName,

                        @UI.hidden: true
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        _Customer.OrganizationBPName1                                                      as OrganizationBPName1, //-- text search for Customer


                        @UI.hidden: true
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        _Customer.OrganizationBPName2                                                      as OrganizationBPName2, //-- text search for Customer


                        @EndUserText.label: 'Project'
                        @EndUserText.quickInfo: 'Project'
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        @UI: { selectionField: [{ position: 20 }] }
                        @ObjectModel.text.element: [ 'ProjectDescription' ]
                        @Consumption.valueHelpDefinition: [{ entity: { name:'C_ProjBillgCustProjBillableVH',element: 'Project' } }]
                        @ObjectModel: { foreignKey.association: '_ProjBillgCustomerProjectDets'}
                        @Consumption: { valueHelp: '_ProjBillgCustomerProjectDets' }
                        @Consumption.semanticObject: 'EngagementProject'
                        //@Consumption.semanticObject: 'CustomerProject'

                        //@Consumption.semanticObjectMapping: {element: 'CustomerProject' }

                        //_EngProjItem1._EngagementProject.EngagementProject                                 as CustomerProject,

                        //EngagementProject                                                                  as CustomerProject,

                        //@Consumption.semanticObjectMapping.additionalBinding: [{element: 'CustomerProject'}, {localElement: 'Project'}]

                        Project                                                                            as CustomerProject,

                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        @UI: { fieldGroup: [ { groupLabel: 'Partners', qualifier: 'PartnerDetailsFilter' } ] }
                        @EndUserText.label: 'Ship-to Party'
                        @EndUserText.quickInfo: 'Ship-to Party'
                        @Consumption.valueHelpDefinition: [ { entity: { name : 'D_CustomerCVH', element: 'Customer' } } ]
                        @ObjectModel: { foreignKey.association: '_ShipToContactCard'}
                        @Consumption: { valueHelp: '_ShipToContactCard' }
                        @Consumption.semanticObject: 'Customer'
                        @ObjectModel.text.element: ['ShipToPartyName']
                        ShipToParty                                                                        as ShipToParty,



                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        @EndUserText.label: 'Ship To Party'
                        @EndUserText.quickInfo: 'Ship To Party'
                        _ShipToParty.CustomerName                                                          as ShipToPartyName,

                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        @UI: { fieldGroup: [ { groupLabel: 'Partners', qualifier: 'PartnerDetailsFilter' } ] }
                        @EndUserText.label: 'Bill-to Party'
                        @EndUserText.quickInfo: 'Bill-to Party'
                        @Consumption.valueHelpDefinition: [ { entity: { name : 'D_CustomerCVH', element: 'Customer' } } ]
                        @ObjectModel: { foreignKey.association: '_BillToContactCard'}
                        @Consumption: { valueHelp: '_BillToContactCard' }
                        @Consumption.semanticObject: 'Customer'
                        @ObjectModel.text.element: ['BillToPartyName']
                        BillToParty                                                                        as BillToParty,


                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        @EndUserText.label: 'Bill To Party'
                        @EndUserText.quickInfo: 'Bill To Party'
                        _BillToParty.CustomerName                                                          as BillToPartyName,


                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        @UI: { fieldGroup: [ { groupLabel: 'Partners', qualifier: 'PartnerDetailsFilter' } ] }
                        @EndUserText.label: 'Payer'
                        @EndUserText.quickInfo: 'Payer'
                        @Consumption.valueHelpDefinition: [ { entity: { name : 'D_CustomerCVH', element: 'Customer' } } ]
                        @ObjectModel: { foreignKey.association: '_PayerContactCard'}
                        @Consumption: { valueHelp: '_PayerContactCard' }
                        @Consumption.semanticObject: 'Customer'
                        @ObjectModel.text.element: ['PayerPartyName']
                        PayerParty                                                                         as PayerParty,



                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        @EndUserText.label: 'Payer Party'
                        @EndUserText.quickInfo: 'Payer Party'
                        _PayerParty.CustomerName                                                           as PayerPartyName,

                        @EndUserText.label: 'Partner Function'
                        @EndUserText.quickInfo: 'Partner Function'
                        @UI: { fieldGroup: [ { groupLabel: 'Partners', qualifier: 'PartnerDetailsFilter' } ] }
                        @Consumption.valueHelpDefinition: [{ entity:  { name:'C_PrjBlgElmPartnerFunctionVH', element: 'PartnerFunction' }}]
                        @Consumption.filter: { defaultValue : '', selectionType : #SINGLE, multipleSelections : false }
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS' //POC ToBill

  virtual               PartnerFunction               : parvw_unv, // 2208 Partner Function | Enabling Partner Function filter


                        @EndUserText.label: 'Personnel Number'
                        @EndUserText.quickInfo: 'Personnel Number'
                        --@Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 1.0}
                        @UI: { fieldGroup: [ { groupLabel: 'Partners', qualifier: 'PartnerDetailsFilter' } ] }
                        --@Consumption.valueHelpDefinition: [{ entity:  { name: 'I_WorkForcePersonMappings', element: 'WorkforceAssignment' }}]
                        @Consumption.valueHelpDefinition: [{ entity:  { name: 'I_PersWrkAgrmtSrchHelp_1', element: 'PersonWorkAgreement' }}]
                        @Consumption.filter.defaultValue: ''  //, selectionType : #SINGLE, multipleSelections : false }

                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS' //POC ToBill

  virtual               PersonnelNumber               : pernr_d, // 2208 Partner Function | Enabling Personnel filter


                        @Consumption.filter.hidden: true
                        @EndUserText.label: 'Partner'
                        @EndUserText.quickInfo: 'Partner'
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               AdditionalPartnerName         : abap.char( 100 ), // 2208 Partner Function | Adding Partner Name field to list report



                        @Consumption.filter.hidden: true
                        @UI.hidden: true
                        @EndUserText.label: 'Partner Descr'
                        @EndUserText.quickInfo: 'Partner Descr'
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               AdditionalPartnerDetailText   : abap.char( 1333 ),

                        @EndUserText.label: 'Project'
                        @Semantics.text: true
                        @Consumption.filter.hidden: true
                        @UI.hidden: true
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        ProjectDescription,

                        @UI: { lineItem: [{position: 40, importance: #HIGH }], selectionField: [{ position: 30 }] }
                        @EndUserText.label: 'Billing Method'
                        @EndUserText.quickInfo: 'Billing Method'
                        @Consumption.valueHelpDefinition: [{ entity:{ name:'C_BillingMethodVH',element: 'BillingPlanUsageCategoryName' }}]
                        _SalesDocItemBillPlan._BillingPlanUsageCategory._Text.BillingPlanUsageCategoryName as BillingPlanUsageCategoryName : localized,

                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        _SalesDocItemBillPlan.BillingPlanUsageCategory                                     as BillingPlanUsageCategory,
                        //BillingPlanUsageCategory,


                        @EndUserText.label: 'Document Currency'
                        @UI.hidden: true
                        @Semantics.currencyCode: true
                        @Consumption.filter.hidden: true
                        DocumentCurrency,

                        @UI.hidden: true
                        @Consumption.filter.hidden: true
                        TransactionCurrency                                                                as TransactionCurrency,

                        //@UI.hidden: true

                        @EndUserText.label: 'Billed'
                        @EndUserText.quickInfo: 'Billed'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        BilledRevenueAmtInDocCrcy,

                        //@UI.hidden: true

                        @UI: { lineItem: [ { position: 90, importance: #HIGH } ] }
                        @EndUserText.label: 'Unbilled'
                        @EndUserText.quickInfo: 'Unbilled'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               UnbilledRevnAmtInDocCrcy      : abap.curr( 23, 2 ),

                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.filter.transformedBy: 'ABAP:ZTMP_VIRTUALFIELDS_FILTER'

                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               ProjBillgElmntEntrIsCancelled : abap.char( 1 ),

                        //@UI: { lineItem: [ { position: 100, importance: #HIGH } ] }

                        @UI.hidden: true
                        @EndUserText.label: 'Billing in Process'
                        @EndUserText.quickInfo: 'Billing in Process'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               BillgReqdRevenueAmtInDocCrcy  : abap.curr( 23, 2 ),
                        //BillgReqdRevenueAmtInDocCrcy,


                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ], lineItem: [ { position: 50, importance: #HIGH } ] }
                        @EndUserText.label: 'Profit Center'
                        @EndUserText.quickInfo: 'Profit Center'
                        @Consumption.valueHelpDefinition: [{entity: {name: 'C_PrftCtrValHelp', element:'ProfitCenter'}}]
                        @ObjectModel.text.element : ['ProfitCenterText']
                        @Consumption.semanticObject: 'ProfitCenter'
                        WBSElementProfitCenter                                                             as ProfitCenter,

                        @UI.hidden: true
                        _ProfitCenterName.ProfitCenterName                                                 as ProfitCenterText,

                        @UI: { lineItem: [ { position: 60, importance: #HIGH } ] }
                        @EndUserText.label: 'Planned Revenue'
                        @EndUserText.quickInfo: 'Planned Revenue'
                        @Semantics.amount.currencyCode: 'TransactionCurrency'
                        @Consumption.filter.hidden: false
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               PlndRevnAmt                   : abap.curr( 23, 2 ),
                        //_PrjBlgElmPlndRevnAmt.PlndRevnAmt,


                        @UI: { lineItem: [ { position: 70, importance: #HIGH } ] }
                        @EndUserText.label: 'Cap'
                        @EndUserText.quickInfo: 'Cap'
                        @Consumption.filter.hidden: true
                        @Semantics.amount.currencyCode: 'TransactionCurrency'
                        CappedNetAmount,

                        @UI: { lineItem: [ { position: 140, importance: #HIGH } ] }
                        @EndUserText.label: 'Written Off'
                        @EndUserText.quickInfo: 'Written Off'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        WrittenOffRevenueAmtInDocCrcy,

                        @Feature: 'SD_PROJ_BILLG_DOWN_PAYMENT'
                        //@UI: { lineItem: [ { position: 150, importance: #HIGH, exclude: true } ] }

                        @EndUserText.label: 'Down Payment Requested'
                        @EndUserText.quickInfo: 'Down Payment Requested'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               RequestedDownPaytAmtInDocCrcy : abap.curr( 23, 2 ),

                        @Feature: 'SD_PROJ_BILLG_DOWN_PAYMENT'
                        //@UI: { lineItem: [ { position: 160, importance: #HIGH, exclude: true } ] }

                        @EndUserText.label: 'Down Payment Received'
                        @EndUserText.quickInfo: 'Down Payment Received'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               ReceivedDownPaytAmtInDocCrcy  : abap.curr( 23, 2 ),


                        @EndUserText.label: 'Billing Item Description'
                        @EndUserText.quickInfo: 'Billing Item Description'
                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ] }
                        @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.85}
                        _SalesOrderItem.SalesDocumentItemText                                              as WBSElementDescription,

                        @UI.hidden: true
                        ServiceOrganizationUnit,

                        @UI.hidden: true
                        ResponsibleCostCenter,

                        @UI.hidden: true
                        ProfitCenter                                                                       as CostCenterProfitCenter,

                        --hierarchical value help for profit centre realization
                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ] }
                        @Consumption.valueHelpDefinition: [{ entity:{ name: 'I_ProfitCenterHierarchyVH', element: 'ProfitCenterHierarchy' } }]
                        @Consumption.filter.selectionType: #SINGLE
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS' --dummy calculation
  virtual               ProfitCenterHierarchy         : fis_prctr_hryid_42, //POC ToBill


                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ] }
                        @Consumption.filter.hidden: true
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_FINS_HIER_VH_FLTR_TRANSFORM'
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS' --dummy calculation
  virtual               ProfitCenterHierarchyNode     : fis_prctr_hrynid_50, //POC ToBill



                        //@UI.hidden: true

                        @EndUserText.label: 'Service Organization'
                        @EndUserText.quickInfo: 'Service Organization'
                        @UI: { fieldGroup: [ { groupLabel: 'Details of Billing Element', qualifier: 'BillingItemInfo' } ] }
                        @Consumption.valueHelpDefinition: [
                          { entity:  { name:    'I_EngmntProjSrvcOrgStdVH',
                                       element: 'EngagementProjectServiceOrg' }
                          }]
                        @ObjectModel.text.element : ['EngmtProjectServiceOrgName']
                        @Consumption.semanticObject: 'ServiceOrganization'
                        //@UI.textArrangement: #TEXT_ONLY                         "Commenting to solve UI inconsistency issue

                        EngagementProjectServiceOrg,


                        @EndUserText.label: 'Last Billing Date'
                        @EndUserText.quickInfo: 'Last Billing Date'
                        @Consumption.filter.selectionType: #INTERVAL
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               BillingDate                   : abap.dats(8),

                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               BillingPlanItemUsage          : abap.char( 1 ),

                        @EndUserText.label: 'Planned PrePayment'
                        @EndUserText.quickInfo: 'Planned PrePayment'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden:true
                        PlndPrepaymentAmtInProjCrcy,

                        @EndUserText.label: 'Estimated Actuals'
                        @EndUserText.quickInfo: 'Estimated Actuals'
                        @Semantics: { amount : {currencyCode: 'DocumentCurrency'} }
                        @Consumption.filter.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
                        //@ObjectModel.sort.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS_SORT'

  virtual               NetValueAmountInDocCurrency   : abap.curr( 23 , 2 ),


                        @UI.hidden: true
                        BillingPlan,

                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               UICT_SalesOrder               : vbeln_va,

                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               UICT_SalesOrderItem           : posnr_va,

                        @UI.hidden: true // 2208 Partner Function | expose SalesOrder

                        SalesOrder,

                        @UI.hidden: true
                        SalesOrderItem, // 2208 Partner Function | expose SalesOrderItem


                        // Adding Admin Fields

                        @UI.hidden: true
                        @EndUserText.label: 'Created By User'
                        @EndUserText.quickInfo: 'Created By User'
                        ProjBillgElmntCreatedByUser,

                        @UI.hidden: true
                        @EndUserText.label: 'Created At Time'
                        @EndUserText.quickInfo: 'Created At Time'
                        ProjBillgElmntCreatedAtDteTme,

                        @UI.hidden: true
                        @EndUserText.label: 'Last Changed By User'
                        @EndUserText.quickInfo: 'Last Changed By User'
                        ProjBillgElmntLastChgdByUser,

                        @UI.hidden: true
                        @EndUserText.label: 'Last Changed At Time'
                        @EndUserText.quickInfo: 'Last Changed At Time'
                        ProjBillgElmntLastChgdAtDteTme,

                        @Consumption.filter.selectionType: #SINGLE
                        @EndUserText.label: 'Planned Prepayments'
                        @EndUserText.quickInfo: 'Planned Prepayments'
                        @UI: { selectionField: [{ position: 220 }] }
                        @Consumption.valueHelpDefinition: [
                          { entity:  { name:    'C_PrjBlgElmPlndPpaytFilterVH',
                                       element: 'DomainValueLow' }
                          }]
                        @Consumption.filter.defaultValue: ''
                        @ObjectModel.filter.transformedBy: 'ABAP:CL_PBE_VIRTUALFIELDS'
                        @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_PBE_VIRTUALFIELDS' //POC

  virtual               PrjBlgElmPlndPpaytFilter      : pbe_prepaymentfilter,

                        @UI.hidden: true
                        PrjBlgElmPlndPrepaymentIsOvrd,

                        @UI.hidden: true
                        @ObjectModel.virtualElementCalculatedBy:'ABAP:CL_PBE_VIRTUALFIELDS'
  virtual               ProjBillingReqIsAuthorized    : boolean,

                        @UI.hidden: true
                        ProjBillingProfile                                                                 as ProjBillingProfile,
                        @UI.hidden: true
                        ProjectBillingCategory                                                             as ProjectBillingCategory,
                        @UI.hidden: true --used in association
                        ControllingArea,

                        @UI.hidden: true
                        @EndUserText.label: 'Organization Description'
                        @EndUserText.quickInfo: 'Organization Description'
                        @Consumption.filter.hidden: true
                        _ServiceOrganizationText.EngmtProjectServiceOrgName                                as EngmtProjectServiceOrgName,

                        @UI.hidden: true
                        ProjectElementUUID,

                        //Associations

                        _ProjectBillingElementEntry : redirected to composition child C_ProjectBillingElementEntryTP,
                        _ProjectBillingDocDetails,
                        _WBSElement,
                        _PrjBlgElmEntrForPrepayment,

                        --used in profit center hierarchy filters
                        _ProfitCenterHierLeafNode,

                        --@Consumption.filter.hidden: true
                        --_MyProjectBillingElements,
                        @Consumption.filter.hidden: true
                        _CustomerContactCard,
                        @Consumption.filter.hidden: true
                        _ShipToContactCard,
                        @Consumption.filter.hidden: true
                        _BillToContactCard,
                        @Consumption.filter.hidden: true
                        _PayerContactCard,

                        @Consumption.filter.hidden: true
                        _ProjBillgElmntPartnerDetails,

                        @Consumption.filter.hidden: true
                        _ProjBillgCustomerProjectDets,

                        @Consumption.filter.hidden: true
                        _ProjBillgSlsItmBillgPlnDuDte,

                        @Consumption.filter.hidden: true
                        _ProjBillingInProcessDetails,

                        @UI.hidden: true
                        _ProjBillgElmObjectLink,

                        @UI.hidden: true
                        _EnterpriseProjectElement

}
where
       BillingBlockStatus        <> 'C'
  and  BillingBlockReason        is initial
  and  SalesDocumentRjcnReason   is initial


  and(
       ProcessingStatus          =  '10'
    or ProcessingStatus          =  '40'
  )

  and  SDDocumentRejectionStatus <> 'C'
  and  OverallBillingBlockStatus <> 'C'
  and  HeaderBillingBlockReason  is initial

  and  ProjectBillingCategory    = 'PSBL' // Excluding ICO PBEs