@AbapCatalog.sqlViewName: 'PASSTBALTMPVAL'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel: { usageType.serviceQuality: #D,
usageType.sizeCategory: #XXL,
usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_AssetBalanceWithTmpPlanVal
with parameters
P_CreationDateTime : timestampl,
P_UserID : username
as select from I_FixedAssetTmpPlanVal
{
key I_FixedAssetTmpPlanVal.CompanyCode,
// I_FixedAssetTmpPlanVal returns only representative ledger, which is no longer valid for new asset master data model
key _DepreciationArea.AssetDepreciationArea,
key MasterFixedAsset,
key FixedAsset,
key I_FixedAssetTmpPlanVal.Ledger,
key FiscalYear,
key FiscalPeriod,
key SubLedgerAcctLineItemType,
key AssetAcctTransClassfctn,
LedgerGroup,
I_FixedAssetTmpPlanVal.PlannedValueIsInclusive,
ChartOfDepreciation,
@Semantics.currencyCode: true
CompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInCompanyCodeCurrency
else 0
end as fins_vhcur12) as PlanAmountInCompanyCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInCompanyCodeCurrency
else 0
end as fins_vhcur12 ) as ActualAmountInCompanyCodeCrcy,
@Semantics.currencyCode: true
GlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInGlobalCurrency
else 0
end as fins_vhcur12 ) as PlanAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInGlobalCurrency
else 0
end as fins_vhcur12 ) as ActualAmountInGlobalCurrency,
@Semantics.currencyCode: true
FreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency1
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency1
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy1,
@Semantics.currencyCode: true
FreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency2
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency2
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy2,
@Semantics.currencyCode: true
FreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency3
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency3
else 0
end as fins_vhcur12) as ActualAmountInFreeDfndCrcy3,
@Semantics.currencyCode: true
FreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency4
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency4
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy4,
@Semantics.currencyCode: true
FreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency5
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency5
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy5,
@Semantics.currencyCode: true
FreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency6
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency6
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy6,
@Semantics.currencyCode: true
FreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency7
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency7
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy7,
@Semantics.currencyCode: true
FreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
cast(
case
when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency8
else 0
end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
cast(
case
when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency8
else 0
end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy8
}
where
//Due values
(
I_FixedAssetTmpPlanVal.PlannedValueIsInclusive = '2'
and I_FixedAssetTmpPlanVal.CreatedByUser = :P_UserID
and I_FixedAssetTmpPlanVal.CreationDateTime = :P_CreationDateTime
)
//Carry forward values
or(
I_FixedAssetTmpPlanVal.PlannedValueIsInclusive = '1'
and I_FixedAssetTmpPlanVal.AssetAcctTransClassfctn = '00'
and I_FixedAssetTmpPlanVal.CreatedByUser = :P_UserID
and I_FixedAssetTmpPlanVal.CreationDateTime = :P_CreationDateTime
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEPRECIATIONAREAFORLEDGER",
"I_FIXEDASSETTMPPLANVAL"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/