@AbapCatalog: {sqlViewName: 'PFASSETTMPPV', preserveKey: true, compiler.compareFilter: true}
@VDM.viewType: #BASIC
@VDM.private: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel: { usageType.serviceQuality: #X,
usageType.sizeCategory: #XXL,
usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.buffering.status: #NOT_ALLOWED
define view P_FixedAssetTmpPlanVal
as select from faat_d_pv_hdr as Header
inner join faat_d_pv_values as Values on Header.db_key = Values.root_key
inner join I_DepreciationAreaForLedger on Values.bukrs = I_DepreciationAreaForLedger.CompanyCode
and Values.afabe = I_DepreciationAreaForLedger.AssetDepreciationArea
association [0..*] to I_LedgerGroupAssignment as _LedgerGroupAssignment on $projection.LedgerGroup = _LedgerGroupAssignment.LedgerGroup
{
key Header.timestamp as CreationDateTime,
key Header.usera as CreatedByUser,
key Values.afabe as AssetDepreciationArea,
key Values.bukrs as CompanyCode,
key Values.gjahr as FiscalYear,
key Values.anln1 as MasterFixedAsset,
key Values.anln2 as FixedAsset,
key Values.slalittype as SubLedgerAcctLineItemType,
key Values.poper as FiscalPeriod,
//Carry balance forward values
case when Values.movcat = '00' then cast ( '1' as faa_use_val_ty)
//Planned values
else cast ('2' as faa_use_val_ty)
end as PlannedValueIsInclusive,
// Values.faa_use_val_ty as PlannedValueIsInclusive,
I_DepreciationAreaForLedger.Ledger,
I_DepreciationAreaForLedger.IsRepresentativeLedger,
//case when Values.ldgrp is initial
// then Values.ledger
// else _LedgerGroupAssignment[1: IsRepresentativeLedger = 'X' ].Ledger
//end as Ledger,
//_LedgerGroupAssignment[1: IsRepresentativeLedger = 'X' ].Ledger as Ledger,
Values.ldgrp as LedgerGroup,
Values.anlgr as GroupMasterFixedAsset,
Values.anlgr2 as GroupFixedAsset,
Values.movcat as AssetAcctTransClassfctn,
cast('A' as fis_koart preserving type) as FinancialAccountType,
@Semantics.currencyCode:true
cast(Values.rhcur as fis_hwaer preserving type) as CompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast(Values.hsl as fis_hsl preserving type) as AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
cast(Values.rkcur as fis_rkcur preserving type) as GlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(Values.ksl as fis_ksl preserving type) as AmountInGlobalCurrency,
@Semantics.currencyCode:true
cast(rocur as fis_rocur preserving type) as FreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
cast(osl as fis_osl preserving type) as AmountInFreeDefinedCurrency1,
@Semantics.currencyCode:true
cast(rvcur as fis_rvcur preserving type) as FreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
cast(vsl as fis_vsl preserving type) as AmountInFreeDefinedCurrency2,
@Semantics.currencyCode:true
rbcur as FreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
cast(bsl as fis_bsl preserving type) as AmountInFreeDefinedCurrency3,
@Semantics.currencyCode:true
rccur as FreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
cast(csl as fis_csl preserving type) as AmountInFreeDefinedCurrency4,
@Semantics.currencyCode:true
rdcur as FreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
cast(dsl as fis_dsl preserving type) as AmountInFreeDefinedCurrency5,
@Semantics.currencyCode:true
recur as FreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
cast(esl as fis_esl preserving type) as AmountInFreeDefinedCurrency6,
@Semantics.currencyCode:true
cast(rfcur as fis_rfcur preserving type) as FreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
cast(fsl as fis_fsl preserving type) as AmountInFreeDefinedCurrency7,
@Semantics.currencyCode:true
rgcur as FreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
cast(gsl as fis_gsl preserving type) as AmountInFreeDefinedCurrency8,
Values.anlkl as AssetClass,
Values.ktogr as AssetAccountDetermination,
Values.xanlgr as IsGroupAsset,
Values.recid as JointVentureCostRecoveryCode
}
where
(
hsl <> 0.00
or ksl <> 0.00
or osl <> 0.00
or vsl <> 0.00
or bsl <> 0.00
or csl <> 0.00
or csl <> 0.00
or dsl <> 0.00
or esl <> 0.00
or fsl <> 0.00
or gsl <> 0.00
)
and(
Values.movcat = '00'
or Values.movcat = '06'
or Values.movcat = '46'
or Values.movcat = '61'
or movcat = '65'
or movcat = '66'
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEPRECIATIONAREAFORLEDGER",
"FAAT_D_PV_HDR",
"FAAT_D_PV_VALUES"
],
"ASSOCIATED":
[
"I_LEDGERGROUPASSIGNMENT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/