@VDM.viewType: #CONSUMPTION
@Analytics: { dataCategory: #CUBE }
@Analytics.internalName: #LOCAL
@ObjectModel.usageType:{ serviceQuality: #D,
sizeCategory: #M,
dataClass: #TRANSACTIONAL }
@AccessControl: { authorizationCheck: #MANDATORY,
personalData.blocking: #NOT_REQUIRED }
@EndUserText.label: 'PL SAFT Fixed Asset Values - Cube'
@Metadata.allowExtensions:true
define view entity C_PL_SAFTFixedAssetValueCube
with parameters
P_AssetAccountingKeyFigureSet : faa_key_figure_set,
P_FiscalYear : fis_gjahr,
P_ToFiscalPeriod : fis_period_to,
P_ReportingEndDate : srf_rpg_period_end_date,
P_SelectedCurrencyBranch : fis_selected_currency_branch,
P_BookDepreciationAreaLedger : saft_aa_pl_book_area_ledger,
P_ConfigurationKeyDate : fipl_sa_confign_key_date
as select from I_AssetBalanceCube( P_AssetAccountingKeyFigureSet: $parameters.P_AssetAccountingKeyFigureSet,
P_FiscalYear: $parameters.P_FiscalYear,
P_FiscalPeriod: $parameters.P_ToFiscalPeriod,
P_KeyDate: $parameters.P_ReportingEndDate ) as AstBal
inner join I_PL_SAFTAssetDepreciationArea as AstDprA
on AstDprA.CompanyCode = AstBal.CompanyCode
and AstDprA.AssetDepreciationArea = AstBal.AssetDepreciationArea
and AstDprA.ValidityEndDate >= $parameters.P_ConfigurationKeyDate
and AstDprA.ValidityStartDate <= $parameters.P_ConfigurationKeyDate
inner join I_FixedAssetForLedger as FxdAstLed on
FxdAstLed.CompanyCode = AstBal.CompanyCode and
FxdAstLed.MasterFixedAsset = AstBal.MasterFixedAsset and
FxdAstLed.FixedAsset = AstBal.FixedAsset and
FxdAstLed.Ledger = $parameters.P_BookDepreciationAreaLedger
association [0..1] to I_SubLedgerAccLineItemType as _SubledgerAccLineItemType on $projection.SubLedgerAcctLineItemType = _SubledgerAccLineItemType.SubLedgerAcctLineItemType
{
@ObjectModel.foreignKey.association: '_CompanyCode'
key AstBal.CompanyCode,
@ObjectModel.foreignKey.association: '_MasterFixedAsset'
key AstBal.MasterFixedAsset,
@ObjectModel.foreignKey.association: '_FixedAsset'
key AstBal.FixedAsset,
@ObjectModel.foreignKey.association: '_DepreciationArea'
key AstBal.AssetDepreciationArea,
@ObjectModel.foreignKey.association: '_Ledger'
key AstBal.Ledger,
@ObjectModel.foreignKey.association: '_FiscalYear'
key AstBal.FiscalYear,
//@ObjectModel.foreignKey.association: '_FiscalPeriodForVariant'
key AstBal.FiscalPeriod,
@ObjectModel.foreignKey.association: '_SubledgerAccLineItemType'
key AstBal.SubLedgerAcctLineItemType,
@ObjectModel.foreignKey.association: '_AssetAcctTransClassfctn'
key AstBal.AssetAcctTransClassfctn,
@ObjectModel.foreignKey.association: '_AssetKeyFigure'
key AstBal.AssetAccountingKeyFigure,
@ObjectModel.foreignKey.association: '_AssetKeyFigureSet'
key AstBal.AssetAccountingKeyFigureSet,
@ObjectModel.foreignKey.association: '_JournalEntry'
key AstBal.AccountingDocument,
key AstBal.TransactionSubitem,
key AstBal.DebitCreditCode,
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AstBal.AccountingDocumentType,
AstBal.AccountingDocumentCreationDate,
@ObjectModel.foreignKey.association: '_AssetTransactionType'
AstBal.AssetTransactionType,
AstBal.AssetValueDate,
AstBal.AssetClass,
@ObjectModel.foreignKey.association: '_BusinessTransactionCategory'
AstBal.BusinessTransactionCategory,
@ObjectModel.foreignKey.association: '_BusinessTransactionType'
AstBal.BusinessTransactionType,
AstBal.ChartOfDepreciation,
AstBal.DisplayCurrency,
AstBal.PostingDate,
AstBal.DocumentDate,
AstBal.SelectedCurrencyBranch,
AstBal.IsReversal,
AstBal.IsReversed,
FxdAstLed.AssetCapitalizationDate,
FxdAstLed.AssetDeactivationDate,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainTaxDeprArea ='X'
and AstBal.AssetAccountingKeyFigure = '0000700121' ) //700121 APC Including Reval. and Down Paym. FY Start, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_tax_acq_amt_fys)
else cast ('0' as fipl_sa_tax_acq_amt_fys )
end as FsclYrStartTaxAcqnAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( (AstDprA.TaxNdcblDepreciationAreaType = '+' or AstDprA.TaxNdcblDepreciationAreaType = '-')
and AstBal.AssetAccountingKeyFigure = '0000700121' ) //700121 APC Including Reval. and Down Paym. FY Start, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxndc_acq_amt_fys)
else cast ('0' as fipl_sa_taxndc_acq_amt_fys )
end as FYSTaxNdcblAcqnAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsTaxAcqnValDeprArea = 'X'
and AstBal.AssetAccountingKeyFigure = '0000700121' ) //700121 APC Including Reval. and Down Paym. FY Start, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxref_acq_amt_fys )
else cast ('0' as fipl_sa_taxref_acq_amt_fys )
end as FYSTaxRefAreaAcqnAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainBookDeprArea = 'X'
and AstBal.AssetAccountingKeyFigure = '0000700121' ) //700121 APC Including Reval. and Down Paym. FY Start, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_book_acq_amt_fys )
else cast ('0' as fipl_sa_book_acq_amt_fys )
end as FsclYrStartBookAcqnAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainTaxDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0001700000' //1700000 Acquisitions (gross) – APC
or AstBal.AssetAccountingKeyFigure = '0002700000' //2700000 Retirements – APC
or AstBal.AssetAccountingKeyFigure = '0003700000' //3700000 Transfer of APC
or AstBal.AssetAccountingKeyFigure = '0005700000' //5700000 Post-Capitalization – APC
or AstBal.AssetAccountingKeyFigure = '0006700200' //6700200 Investment Support
or AstBal.AssetAccountingKeyFigure = '0009700301' )) //9700301 Revaluation of APC, Current Year Total, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_tax_acq_dlt_amt )
else cast ('0' as fipl_sa_tax_acq_dlt_amt )
end as TaxAcquisitionDeltaAmountInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( (AstDprA.TaxNdcblDepreciationAreaType = '+' or AstDprA.TaxNdcblDepreciationAreaType = '-')
and (AstBal.AssetAccountingKeyFigure = '0001700000' //1700000 Acquisitions (gross) – APC
or AstBal.AssetAccountingKeyFigure = '0002700000' //2700000 Retirements – APC
or AstBal.AssetAccountingKeyFigure = '0003700000' //3700000 Transfer of APC
or AstBal.AssetAccountingKeyFigure = '0005700000' //5700000 Post-Capitalization – APC
or AstBal.AssetAccountingKeyFigure = '0006700200' //6700200 Investment Support
or AstBal.AssetAccountingKeyFigure = '0009700301' )) //9700301 Revaluation of APC, Current Year Total, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxndc_acq_dlt_amt )
else cast ('0' as fipl_sa_taxndc_acq_dlt_amt )
end as TaxNdcblAcqnDeltaAmountInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsTaxAcqnValDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0001700000' //1700000 Acquisitions (gross) – APC
or AstBal.AssetAccountingKeyFigure = '0002700000' //2700000 Retirements – APC
or AstBal.AssetAccountingKeyFigure = '0003700000' //3700000 Transfer of APC
or AstBal.AssetAccountingKeyFigure = '0005700000' //5700000 Post-Capitalization – APC
or AstBal.AssetAccountingKeyFigure = '0006700200' //6700200 Investment Support
or AstBal.AssetAccountingKeyFigure = '0009700301' )) //9700301 Revaluation of APC, Current Year Total, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxref_acq_dlt_amt )
else cast ('0' as fipl_sa_taxref_acq_dlt_amt )
end as TaxRefAreaAcqnDeltaAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainBookDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0001700000' //1700000 Acquisitions (gross) – APC
or AstBal.AssetAccountingKeyFigure = '0002700000' //2700000 Retirements – APC
or AstBal.AssetAccountingKeyFigure = '0003700000' //3700000 Transfer of APC
or AstBal.AssetAccountingKeyFigure = '0005700000' //5700000 Post-Capitalization – APC
or AstBal.AssetAccountingKeyFigure = '0006700200' //6700200 Investment Support
or AstBal.AssetAccountingKeyFigure = '0009700301' )) //9700301 Revaluation of APC, Current Year Total, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_book_acq_dlt_amt )
else cast ('0' as fipl_sa_book_acq_dlt_amt )
end as BookAcqnDeltaAmountInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainTaxDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0007700401' //7700401 Revaluation of Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700501' //7700501 Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700601' //7700601 Special Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700701' //7700701 Unplanned Depreciation, Current Value Depr.
or AstBal.AssetAccountingKeyFigure = '0007700801' //7700801 Transfer of Reserves, Planned
or AstBal.AssetAccountingKeyFigure = '0009790600' )) //9790600 Write-Up Current Year
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_tax_depr_amt )
else cast ('0' as fipl_sa_tax_depr_amt )
end as TaxDepreciationAmount,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( (AstDprA.TaxNdcblDepreciationAreaType = '+' or AstDprA.TaxNdcblDepreciationAreaType = '-')
and (AstBal.AssetAccountingKeyFigure = '0007700401' //7700401 Revaluation of Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700501' //7700501 Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700601' //7700601 Special Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700701' //7700701 Unplanned Depreciation, Current Value Depr.
or AstBal.AssetAccountingKeyFigure = '0007700801' //7700801 Transfer of Reserves, Planned
or AstBal.AssetAccountingKeyFigure = '0009790600' )) //9790600 Write-Up Current Year
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxndc_depr_amt )
else cast ('0' as fipl_sa_taxndc_depr_amt )
end as TaxNdcblDepreciationAmountInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainBookDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0007700401' //7700401 Revaluation of Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700501' //7700501 Ordinary Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700601' //7700601 Special Depreciation, Planned
or AstBal.AssetAccountingKeyFigure = '0007700701' //7700701 Unplanned Depreciation, Current Value Depr.
or AstBal.AssetAccountingKeyFigure = '0007700801' //7700801 Transfer of Reserves, Planned
or AstBal.AssetAccountingKeyFigure = '0009790600' )) //9790600 Write-Up Current Year
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_book_depr_amt )
else cast ('0' as fipl_sa_book_depr_amt )
end as BookDepreciationAmount,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainTaxDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0010700401' //10700401 Revaluation Ordinary Depreciation at Reporting Date
or AstBal.AssetAccountingKeyFigure = '0010700501' //10700501 Ordinary Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700601' //10700601 Special Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700701' )) //10700701 Unplanned Depreciation at Reporting Date, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_tax_acc_depr_amt )
else cast ('0' as fipl_sa_tax_acc_depr_amt )
end as AccmltdTaxDepreciationAmtInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( (AstDprA.TaxNdcblDepreciationAreaType = '+' or AstDprA.TaxNdcblDepreciationAreaType = '-')
and (AstBal.AssetAccountingKeyFigure = '0010700401' //10700401 Revaluation Ordinary Depreciation at Reporting Date
or AstBal.AssetAccountingKeyFigure = '0010700501' //10700501 Ordinary Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700601' //10700601 Special Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700701' )) //10700701 Unplanned Depreciation at Reporting Date, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_taxndc_acc_depr_amt )
else cast ('0' as fipl_sa_taxndc_acc_depr_amt )
end as AccmltdTaxNdcblDeprAmountInDC,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'DisplayCurrency'
case when ( AstDprA.PL_SAFTIsMainBookDeprArea = 'X'
and (AstBal.AssetAccountingKeyFigure = '0010700401' //10700401 Revaluation Ordinary Depreciation at Reporting Date
or AstBal.AssetAccountingKeyFigure = '0010700501' //10700501 Ordinary Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700601' //10700601 Special Depreciation at Reporting Date, Planned
or AstBal.AssetAccountingKeyFigure = '0010700701' )) //10700701 Unplanned Depreciation at Reporting Date, Planned
then cast(AstBal.AmountInDisplayCurrency as fipl_sa_book_acc_depr_amt )
else cast ('0' as fipl_sa_book_acc_depr_amt )
end as AccumulatedBookDeprAmountInDC,
// Associations
AstBal._AssetAcctTransClassfctn,
AstBal._AssetKeyFigure,
AstBal._AssetKeyFigureSet,
AstBal._AssetClass,
AstBal._AssetTransactionType,
AstBal._AccountingDocumentType,
AstBal._BusinessTransactionCategory,
AstBal._BusinessTransactionType,
AstBal._CompanyCode,
AstBal._ChartOfDepreciation,
AstBal._DepreciationArea,
AstBal._FixedAsset,
AstBal._FiscalYear,
AstBal._JournalEntry,
AstBal._MasterFixedAsset,
AstBal._Ledger,
_SubledgerAccLineItemType,
AstBal._SelectedCurrencyBranch
}
where
AstBal.SelectedCurrencyBranch = $parameters.P_SelectedCurrencyBranch