@AbapCatalog.sqlViewName : 'PFIRTPCOROPTQNTY'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #BASIC
@VDM.private:true
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XL
@AbapCatalog.preserveKey:true
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
define view P_RTPCOrderOutputQuantity
with parameters
P_FromFiscalYearPeriod : fis_jahrper,
P_ToFiscalYearPeriod : fis_jahrper
as select from I_JournalEntryItem
inner join I_Ledger as _Ledger on I_JournalEntryItem.Ledger = _Ledger.Ledger
and _Ledger.IsLeadingLedger = 'X'
{
key ControllingObject,
key OrderID,
key OrderItem,
key _Ledger.Ledger,
key PostingDate as PostingDate,
FiscalYearPeriod,
CompanyCode,
Plant,
ValuationArea,
Material,
InventorySpclStkSalesDocument as SalesOrder,
InventorySpclStkSalesDocItm as SalesOrderItem,
InvtrySpclStockWBSElmntIntID as WBSElementInternalID,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
sum(case when ValuationQuantity is not initial
then ValuationQuantity
else Quantity end ) as ActualOutputQuantity,
@Semantics.unitOfMeasure:true
BaseUnit
}
where
(
AccountAssignmentType = 'OR '
or AccountAssignmentType = 'OP'
)
and OriginCtrlgDebitCreditCode = 'L'
and TransactionTypeDetermination = 'GBB'
and BusinessTransactionCategory <> 'TBCS'
and Material is not null
and (
FiscalYearPeriod >= $parameters .P_FromFiscalYearPeriod
and FiscalYearPeriod <= $parameters .P_ToFiscalYearPeriod
)
group by
ControllingObject,
OrderID,
OrderItem,
_Ledger.Ledger,
CompanyCode,
Plant,
ValuationArea,
Material,
InventorySpclStkSalesDocument,
InventorySpclStkSalesDocItm,
InvtrySpclStockWBSElmntIntID,
BaseUnit,
PostingDate,
FiscalYearPeriod
// as select from I_COActivityTypeTotalsByPeriod
//{
// key ControllingObject,
//
// OrderID,
//
// FiscalYearPeriod,
//
// @Semantics.unitOfMeasure:true
// CostCtrActivityTypeQtyUnit,
// @DefaultAggregation: #SUM
// @Semantics: { quantity : {unitOfMeasure: 'CostCtrActivityTypeQtyUnit'} }
// sum(case when ControllingValueType = '01'
// then CostCtrActivityTypeQty
// else 0 end ) as PlanOutputQuantity,
//
// @DefaultAggregation: #SUM
// @Semantics: { quantity : {unitOfMeasure: 'CostCtrActivityTypeQtyUnit'} }
// sum(case when ControllingValueType = '04'
// then CostCtrActivityTypeQty
// else 0 end ) as ActualOutputQuantity
//}
//where
// (
// ControllingValueType = '04'
// or ControllingValueType = '01'
// )
// and ControllingObject <> ''
//group by
// ControllingObject,
// OrderID,
// CostCtrActivityTypeQtyUnit,
// FiscalYearPeriod
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_JOURNALENTRYITEM",
"I_LEDGER"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_RTPCOrderOutputQuantity view