P_PurchaseReqnCommitment

DDL: P_PURCHASEREQNCOMMITMENT SQL: PPURREQNCOMMIT Type: view COMPOSITE

P_PurchaseReqnCommitment is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_GLAccountLineItem, I_PurchaseReqn) and exposes 33 fields with key fields PurchaseRequisition, PurchaseRequisitionItem, AccountAssignmentNumber, SourceReferenceDocSubitem, GLAccount.

Data Sources (2)

SourceAliasJoin Type
I_GLAccountLineItem I_GLAccountLineItem from
I_PurchaseReqn PurchaseReqn inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PPURREQNCOMMIT view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY PurchaseRequisition SourceReferenceDocument
KEY PurchaseRequisitionItem
KEY AccountAssignmentNumber AccountAssignmentNumber
KEY SourceReferenceDocSubitem SourceReferenceDocSubitem
KEY GLAccount GLAccount
KEY ControllingArea ControllingArea
KEY FunctionalArea FunctionalArea
KEY PostingDate PostingDate
KEY CompanyCode I_GLAccountLineItem CompanyCode
KEY CashLedgerAccount CashLedgerAccount
KEY Fund Fund
KEY GrantID GrantID
KEY BudgetPeriod BudgetPeriod
KEY PubSecBudgetAccount PubSecBudgetAccount
KEY PubSecBudgetAccountCoCode PubSecBudgetAccountCoCode
KEY PubSecBudgetIsRelevant PubSecBudgetIsRelevant
KEY PubSecBudgetCnsmpnType PubSecBudgetCnsmpnType
KEY CostCenter CostCenter
KEY ProfitCenter ProfitCenter
KEY Segment Segment
KEY WBSElementInternalID WBSElementInternalID
KEY AccountAssignmentType AccountAssignmentType
KEY AccountAssignment AccountAssignment
Ledger Ledger
IsCommitment IsCommitment
TransactionCurrency TransactionCurrency
CompanyCodeCurrency CompanyCodeCurrency
GlobalCurrency GlobalCurrency
CashLedgerCompanyCode CashLedgerCompanyCode
_FunctionalArea _FunctionalArea
_CashLedgerAccount _CashLedgerAccount
_PubSecBudgetAccount _PubSecBudgetAccount
_PubSecBudgetCnsmpnType _PubSecBudgetCnsmpnType
@AbapCatalog.sqlViewName: 'PPURREQNCOMMIT'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY

@VDM.private: true
@VDM.viewType: #COMPOSITE

@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL

define view P_PurchaseReqnCommitment as select from I_GLAccountLineItem

    inner join   I_PurchaseReqn as PurchaseReqn on I_GLAccountLineItem.SourceReferenceDocument = PurchaseReqn.PurchaseRequisition
    association[0..1] to I_PredictionLedger as _PredictionLedger on $projection.Ledger = _PredictionLedger.PredictionLedger
{

  key SourceReferenceDocument as PurchaseRequisition,
  key right(SourceReferenceDocumentItem, 5 ) as PurchaseRequisitionItem,
  key AccountAssignmentNumber,
  key SourceReferenceDocSubitem,
  key GLAccount,
  key ControllingArea,
  key FunctionalArea,
  key PostingDate,
  key I_GLAccountLineItem.CompanyCode,
  key CashLedgerAccount,
  key Fund,
  key GrantID,
  key BudgetPeriod,
  key PubSecBudgetAccount,
  key PubSecBudgetAccountCoCode,
  key PubSecBudgetIsRelevant,
  key PubSecBudgetCnsmpnType,
  key CostCenter,
  key ProfitCenter,
  key Segment,
  key WBSElementInternalID,
  key AccountAssignmentType,
  key AccountAssignment,
      
      Ledger,
      IsCommitment,

      // ------------------AGGREGATIONS----------------------


      // aggregation of amounts in transaction currency is commited amount

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      sum (
        AmountInTransactionCurrency
      ) as AmountInTransactionCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      sum (
        AmountInCompanyCodeCurrency
      ) as AmountInCompanyCodeCurrency,


      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'GlobalCurrency'
      sum (
        AmountInGlobalCurrency
      ) as AmountInGlobalCurrency,

      @Semantics.currencyCode: true
      TransactionCurrency,
      
      @Semantics.currencyCode: true
      CompanyCodeCurrency,
      
      @Semantics.currencyCode: true
      GlobalCurrency,
      
      CashLedgerCompanyCode,

      _FunctionalArea,
      _CashLedgerAccount,
      _PubSecBudgetAccount,
      _PubSecBudgetCnsmpnType

}
where
      SourceReferenceDocumentType = 'PREQ'
  and IsCommitment                = 'X'
  and _PredictionLedger.LedgerIsRelevantForAvailyCtrl = 'X'
  
group by
  SourceReferenceDocument,
  SourceReferenceDocumentItem,
  AccountAssignmentNumber,
  SourceReferenceDocSubitem,
  IsCommitment,
  GLAccount,
  ControllingArea,
  FunctionalArea,
  TransactionCurrency,
  CompanyCodeCurrency,
  GlobalCurrency,
  ControllingObjectCurrency,
  PostingDate,
  SourceLedger,
  I_GLAccountLineItem.CompanyCode,
  FiscalYear,
  Ledger,
  CashLedgerAccount,
  Fund,
  GrantID,
  BudgetPeriod,
  PubSecBudgetAccount,
  PubSecBudgetAccountCoCode,
  PubSecBudgetIsRelevant,
  PubSecBudgetCnsmpnType,
  CostCenter,
  ProfitCenter,
  Segment,
  WBSElementInternalID,
  AccountAssignmentType,
  AccountAssignment,
  CashLedgerCompanyCode
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GLACCOUNTLINEITEM",
"I_PREDICTIONLEDGER",
"I_PURCHASEREQN"
],
"ASSOCIATED":
[
"I_FUNCTIONALAREA",
"I_GLACCOUNTINCOMPANYCODE",
"I_PREDICTIONLEDGER",
"I_PUBSECBDGTCNSMPNTYPE",
"I_PUBSECBUDGETACCOUNT"
],
"BASE":
[
"I_GLACCOUNTLINEITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/