@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":""
}
}*/