P_ProjectBudgetItems

DDL: P_PROJECTBUDGETITEMS SQL: PPROJBDGTITM Type: view COMPOSITE

P_ProjectBudgetItems is a Composite CDS View in SAP S/4HANA. It reads from 7 data sources and exposes 82 fields with key fields SourceLedger, Ledger, CompanyCodeendasCompanyCode, FiscalYear, AccountingDocument. It has 1 association to related views.

Data Sources (7)

SourceAliasJoin Type
P_GetRlvtSemanticTagForProj _AllCost inner
I_ControllingArea _ContArea inner
I_ActualPlanJournalEntryItem _ProjCstLineItm inner
I_EnterpriseProject _ProjectSummary left_outer
P_PROJECTSEMTAGACC _SemTagGL inner
I_WBSElementBasicData _WBSElementBasicData left_outer
P_ProjectsWithProjCat6 Project from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_FiscalPeriodForVariant _FiscalPeriod $projection.LedgerFiscalYear = _FiscalPeriod.FiscalYear and $projection.FiscalPeriod = _FiscalPeriod.FiscalPeriod and $projection.FiscalYearVariant = _FiscalPeriod.FiscalYearVariant

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PPROJBDGTITM view
VDM.viewType #COMPOSITE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.buffering.status #NOT_ALLOWED view
Metadata.ignorePropagatedAnnotations true view
AbapCatalog.preserveKey true view

Fields (82)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger SourceLedger
KEY Ledger Ledger
KEY CompanyCodeendasCompanyCode
KEY FiscalYear FiscalYear
KEY AccountingDocument AccountingDocument
KEY FinancialPlanningReqTransSqnc FinancialPlanningReqTransSqnc
KEY FinancialPlanningDataPacket FinancialPlanningDataPacket
KEY ActualPlanJournalEntryItem ActualPlanJournalEntryItem
LedgerFiscalYear LedgerFiscalYear
LedgerGLLineItem LedgerGLLineItem
FinancialPlanningEntryItem FinancialPlanningEntryItem
GLAccount I_ActualPlanJournalEntryItem GLAccount
ChartOfAccounts I_ActualPlanJournalEntryItem ChartOfAccounts
AccountingDocCreatedByUser AccountingDocCreatedByUser
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
BusinessArea BusinessArea
CostCenter I_ActualPlanJournalEntryItem CostCenter
BudgetProcess I_ActualPlanJournalEntryItem BudgetProcess
PartnerOrder I_ActualPlanJournalEntryItem PartnerOrder_2
PartnerOrderCategory PartnerOrderCategory
PartnerWBSElement I_ActualPlanJournalEntryItem PartnerWBSElementExternalID
PartnerProject I_ActualPlanJournalEntryItem PartnerProjectExternalID
BusinessTransactionType BusinessTransactionType
DebitCreditCode DebitCreditCode
ControllingDebitCreditCode ControllingDebitCreditCode
ProfitCenterendasProfitCenter
WBSElementProfitCenter I_WBSElementBasicData ProfitCenter
WBSDescription I_WBSElementBasicData WBSDescription
ProjectObjectNode I_WBSElementBasicData WBSElementObject
WBSElement I_ActualPlanJournalEntryItem WBSElementExternalID
ResponsibleCostCenter I_WBSElementBasicData ResponsibleCostCenter
ProjectType I_EnterpriseProject EnterpriseProjectType
WBSElementInternalID I_ActualPlanJournalEntryItem WBSElementInternalID
ControllingArea P_ProjectsWithProjCat6 ControllingArea
Project I_ActualPlanJournalEntryItem ProjectExternalID
ProjectInternalID I_ActualPlanJournalEntryItem ProjectInternalID
ProjectExternalID I_ActualPlanJournalEntryItem ProjectExternalID
ProjectDescription P_ProjectsWithProjCat6 ProjectDescription
ProjectProfileCode P_ProjectsWithProjCat6 ProjectProfileCode
ProjectObject P_ProjectsWithProjCat6 ProjectObject
AvailabilityControlProfile P_ProjectsWithProjCat6 AvailabilityControlProfile
AvailabilityControlIsActive P_ProjectsWithProjCat6 AvailabilityControlIsActive
ParentSemanticTag
AvailyCtrlTimeRangeType
BudgetCurrencyRole
ProjectCurrency P_ProjectsWithProjCat6 ProjectCurrency
ProjectSummaryTaskUUID I_EnterpriseProject ProjectSummaryTaskUUID
ProjectCategory
ProjectUUID I_EnterpriseProject ProjectUUID
ProcessingStatus I_EnterpriseProject ProcessingStatus
TaskUUID I_EnterpriseProject ProjectSummaryTaskUUID
CreationDate I_ActualPlanJournalEntryItem CreationDate
FunctionalArea I_ActualPlanJournalEntryItem FunctionalArea
CostCtrActivityType CostCtrActivityType
ControllingObjectCurrency ControllingObjectCurrency
AmountInObjectCurrency AmountInObjectCurrency
TransactionCurrency TransactionCurrency
AmountInTransactionCurrency AmountInTransactionCurrency
CompanyCodeCurrency CompanyCodeCurrency
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency
GlobalCurrency GlobalCurrency
AmountInGlobalCurrency AmountInGlobalCurrency
FunctionalCurrency I_ActualPlanJournalEntryItem FunctionalCurrency
AmountInFunctionalCurrency I_ActualPlanJournalEntryItem AmountInFunctionalCurrency
PostingDate PostingDate
DocumentDate DocumentDate
FiscalPeriod FiscalPeriod
FiscalYearPeriod FiscalYearPeriod
FiscalYearVariant I_ActualPlanJournalEntryItem FiscalYearVariant
ProjectthenelseXendasIsSettled
SourceReferenceDocumentType SourceReferenceDocumentType
SourceLogicalSystem SourceLogicalSystem
SourceReferenceDocumentCntxt SourceReferenceDocumentCntxt
SourceReferenceDocument SourceReferenceDocument
SourceReferenceDocumentItem SourceReferenceDocumentItem
SourceReferenceDocSubitem SourceReferenceDocSubitem
IsCommitment IsCommitment
SemanticTag P_PROJECTSEMTAGACC SemanticTag
SemanticTagIsBudgetRelevant P_GetRlvtSemanticTagForProj SemanticTagIsBudgetRelevant
ObjectIsBudgeted P_GetRlvtSemanticTagForProj SemanticTagIsBudgetRelevant
ProjectIsBudgetRelevant P_GetRlvtSemanticTagForProj ProjectIsBudgetRelevant
_FiscalPeriod _FiscalPeriod
@AbapCatalog.sqlViewName: 'PPROJBDGTITM'
@VDM.viewType: #COMPOSITE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.preserveKey:true
define view P_ProjectBudgetItems
  as select from    P_ProjectsWithProjCat6       as Project
  //  as select from    I_ActualPlanJournalEntryItem as _ProjCstLineItm

    inner join      I_ActualPlanJournalEntryItem as _ProjCstLineItm      on _ProjCstLineItm.ProjectInternalID = Project.ProjectInternalID
    inner join      I_ControllingArea            as _ContArea            on _ContArea.ControllingArea = _ProjCstLineItm.ControllingArea
  //  inner join      R_ProjectSemTagGLAccount     as _SemTagGL            on  _SemTagGL.HierarchyNodeVal      = _ProjCstLineItm.GLAccount

  //                                                                         and _ProjCstLineItm.ChartOfAccounts = _SemTagGL.HierarchyNodeClass

    inner join      P_PROJECTSEMTAGACC           as _SemTagGL            on  _ProjCstLineItm.ControllingArea = _SemTagGL.ControllingArea
                                                                         and _ProjCstLineItm.GLAccount       = _SemTagGL.HierarchyNodeVal
                                                                         and _ProjCstLineItm.ChartOfAccounts = _SemTagGL.HierarchyNodeClass
    inner join      P_GetRlvtSemanticTagForProj  as _AllCost             on _AllCost.ProjectInternalID = _ProjCstLineItm.ProjectInternalID
  //    left outer join I_ProjectBasicData           as _ProjectBasicData    on _ProjCstLineItm.ProjectInternalID = _ProjectBasicData.ProjectInternalID

    left outer join I_WBSElementBasicData        as _WBSElementBasicData on _ProjCstLineItm.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
    left outer join I_EnterpriseProject          as _ProjectSummary      on _ProjectSummary.ProjectInternalID = _ProjCstLineItm.ProjectInternalID
  association [0..1] to I_FiscalPeriodForVariant as _FiscalPeriod on  $projection.LedgerFiscalYear  = _FiscalPeriod.FiscalYear
                                                                  and $projection.FiscalPeriod      = _FiscalPeriod.FiscalPeriod
                                                                  and $projection.FiscalYearVariant = _FiscalPeriod.FiscalYearVariant

{

  key SourceLedger,
  key Ledger,
  key case
      when _ProjCstLineItm.CompanyCode is initial or _ProjCstLineItm.CompanyCode is null
      then _WBSElementBasicData.CompanyCode
      else _ProjCstLineItm.CompanyCode end                      as CompanyCode,
  key FiscalYear,
  key AccountingDocument,
  key FinancialPlanningReqTransSqnc,
  key FinancialPlanningDataPacket,
  key ActualPlanJournalEntryItem,
      LedgerFiscalYear,
      LedgerGLLineItem,
      FinancialPlanningEntryItem,
      _ProjCstLineItm.GLAccount,
      _ProjCstLineItm.ChartOfAccounts,
      AccountingDocCreatedByUser,
      _SemTagGL.GLAccountHierarchy,
      BusinessArea,
      _ProjCstLineItm.CostCenter,
      _ProjCstLineItm.BudgetProcess, // S/4 Hana- CE2108- Inclusion of Budget Process


      // S/4 Hana CE2302- Field Deprecation - Begin

      //PartnerOrder,

      _ProjCstLineItm.PartnerOrder_2                            as PartnerOrder,
      // S/4 Hana CE2302- Field Deprecation - Begin


      PartnerOrderCategory,

      // S/4 Hana CE2302- Field Deprecation - Begin

      //PartnerWBSElement,

      _ProjCstLineItm.PartnerWBSElementExternalID               as PartnerWBSElement,

      //PartnerProject,

      _ProjCstLineItm.PartnerProjectExternalID                  as PartnerProject,
      // S/4 Hana CE2302- Field Deprecation - End


      BusinessTransactionType,
      DebitCreditCode,
      ControllingDebitCreditCode,
      case
      when _ProjCstLineItm.ProfitCenter is initial or _ProjCstLineItm.ProfitCenter is null
      then _WBSElementBasicData.ProfitCenter
      else _ProjCstLineItm.ProfitCenter end                     as ProfitCenter,

      _WBSElementBasicData.ProfitCenter                         as WBSElementProfitCenter,
      _WBSElementBasicData.WBSDescription,
      //_WBSElementBasicData.WBSElementInternalID, //Commented in CE1908

      _WBSElementBasicData.WBSElementObject                     as ProjectObjectNode,
      //_WBSElementBasicData.WBSElement,


      // S/4 Hana CE2302- Field Deprecation - Begin

      //_ProjCstLineItm.WBSElement,

      _ProjCstLineItm.WBSElementExternalID                      as WBSElement,
      // S/4 Hana CE2302- Field Deprecation - end


      _WBSElementBasicData.ResponsibleCostCenter,
      // CE2005 Project type as filter

      //      _WBSElementBasicData.ProjectType,

      _ProjectSummary.EnterpriseProjectType                     as ProjectType,
      _ProjCstLineItm.WBSElementInternalID, //CE1908


      Project.ControllingArea,
      //Project.Project,


      // S/4 Hana CE2302- Field Deprecation - Begin

      //_ProjCstLineItm.Project,

      _ProjCstLineItm.ProjectExternalID                         as Project,
      // S/4 Hana CE2302- Field Deprecation - end



      _ProjCstLineItm.ProjectInternalID,
      _ProjCstLineItm.ProjectExternalID, // added for testing : Architecture changes for conversion exit

      Project.ProjectDescription,
      Project.ProjectProfileCode,
      Project.ProjectObject,
      Project.AvailabilityControlProfile,
      Project.AvailabilityControlIsActive,
      Project._AvailabilityCtrlProfile._SemanticTag.SemanticTag as ParentSemanticTag,
      Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
      Project._AvailabilityCtrlProfile.BudgetCurrencyRole,
      Project.ProjectCurrency, //Ce1911 changes add project currency field

      _ProjectSummary.ProjectSummaryTaskUUID,
      '6'                                                       as ProjectCategory,
      _ProjectSummary.ProjectUUID,
      _ProjectSummary.ProcessingStatus,
      _ProjectSummary.ProjectSummaryTaskUUID                    as TaskUUID, //CE1911

      _ProjCstLineItm.CreationDate,
      _ProjCstLineItm.FunctionalArea,
      CostCtrActivityType,

      @Semantics.currencyCode: true
      ControllingObjectCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'ControllingObjectCurrency'
      AmountInObjectCurrency,

      @Semantics.currencyCode:true
      TransactionCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      AmountInTransactionCurrency,

      @Semantics.currencyCode:true
      CompanyCodeCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      AmountInCompanyCodeCurrency,

      @Semantics.currencyCode:true
      GlobalCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      AmountInGlobalCurrency,

      // S/4 HANA -CE2108- INCLUSION OF FUNCTIONAL CURRENCY- BEGIN

      @Semantics.currencyCode:true
      _ProjCstLineItm.FunctionalCurrency,

      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      @DefaultAggregation: #SUM
      _ProjCstLineItm.AmountInFunctionalCurrency,
      // S/4 HANA -CE2108- INCLUSION OF FUNCTIONAL CURRENCY- END


      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      case
       when  PlanningCategory = 'ACT01' and IsCommitment != 'X'
        then AmountInGlobalCurrency
      end                                                       as ActualAmountInGlobalCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
      case
       when  PlanningCategory = 'ACT01' and IsCommitment != 'X'
        then AmountInObjectCurrency
      end                                                       as ActlCostInProjCrcy,

      case
       when IsCommitment = 'X'
        then 'CMTMT'
       else  PlanningCategory
      end                                                       as PlanningCategory,
      PostingDate,
      DocumentDate,
      FiscalPeriod,
      FiscalYearPeriod,
      _ProjCstLineItm.FiscalYearVariant,

      case
        when ControllingDebitCreditCode  = 'A'
            then ''
        when ControllingDebitCreditCode = 'S' and
           (BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
           ( PartnerProject = ' '  and PartnerOrder = ' ' and PartnerSalesDocument = ' ' and PartnerProjectNetwork = ' '  and PartnerProjectNetworkActivity = ' ' and PartnerBusinessProcess = ' ' and PartnerCostObject = ' ')

            then ''

        when ControllingDebitCreditCode = 'S' and (BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
        (PartnerProject = _ProjCstLineItm.Project)
        then ''
        else 'X'
      end                                                       as IsSettled,

      SourceReferenceDocumentType,
      SourceLogicalSystem,
      SourceReferenceDocumentCntxt,
      SourceReferenceDocument,
      SourceReferenceDocumentItem,
      SourceReferenceDocSubitem,
      IsCommitment,

      _SemTagGL.SemanticTag,
      _AllCost.SemanticTagIsBudgetRelevant,
      _AllCost.SemanticTagIsBudgetRelevant                      as ObjectIsBudgeted, //This is for the new column to be added in PBRLI

      _AllCost.ProjectIsBudgetRelevant,
      //CE1911 memory allocation dump

      //_Project,

      //_WBSElement,

      _FiscalPeriod

}

where
           _SemTagGL.GLAccountHierarchy          =  _ContArea.CtrlgStdFinStatementVersion
  //added for memory allocation exception and for perfo rmance improovement: 1911 fix

  and      _ContArea.CtrlgStdFinStatementVersion is not initial
  and(
           _ProjCstLineItm.Ledger                =  _ProjCstLineItm.SourceLedger
    or     _ProjCstLineItm.SourceLedger          =  '' // needed for plan data

  )
  and(
           _Ledger.IsLeadingLedger               =  'X'
    or     IsCommitment                          =  'X'
  )
  and      Project.Project != ''
  and(
           _SemTagGL.ValidityStartDate           <= $session.system_date
    and    _SemTagGL.ValidityEndDate             >= $session.system_date
  )
  and      _SemTagGL.SemanticTag                 =  _AllCost.SemanticTag
  and      _AllCost.FinancialStatementVariant    =  _ContArea.CtrlgStdFinStatementVersion
  and      Project.ProjectProfileCode            <> 'YP01'
  and      _ProjectSummary.ProjectInternalID     =  _ProjCstLineItm.ProjectInternalID
  and(
    (
           _WBSElementBasicData.CompanyCode      =  _ProjCstLineItm.CompanyCode
      and(
           PlanningCategory                      =  'ACT01'
        or IsCommitment                          =  'X'
      )
    )
    or(
           PlanningCategory != 'ACT01'
      or   IsCommitment != 'X'
    )
  )
  //S/4HANA CE2108 - Excluding Maintenance Order records-Begin

  and      _ProjCstLineItm.AccountAssignmentType != 'OR'
  //S/4HANA CE2108 - Excluding Maintenance Order records-End


  // S/4 HANA - CE2108 - EXCLUSION OF cutback costs in budget calculation for JVA customers - BEGIN

  and      _ProjCstLineItm.JointVentureAccountingActivity != 'CI'
// S/4 HANA - CE2108 - EXCLUSION OF cutback costs in budget calculation for JVA customers - END

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACTUALPLANJOURNALENTRYITEM",
"I_AVAILABILITYCTRLPROFILE",
"I_AVAILYCTRLPROFILESEMANTICTAG",
"I_CONTROLLINGAREA",
"I_ENTERPRISEPROJECT",
"I_LEDGER",
"I_WBSELEMENTBASICDATA",
"P_GETRLVTSEMANTICTAGFORPROJ",
"P_PROJECTSEMTAGACC",
"P_PROJECTSWITHPROJCAT6"
],
"ASSOCIATED":
[
"I_FISCALPERIODFORVARIANT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/