//@AbapCatalog.sqlViewName: 'PROSAFASSET'
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'RO SAFT Fixed Asset Master Data'
@Metadata.ignorePropagatedAnnotations: true
@VDM.private:true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType:{
serviceQuality: #D,
sizeCategory: #XXL,
dataClass: #MASTER
}
define view entity P_RO_SAFTFixedAsset
with parameters
P_KeyDate : fagl_keydate,
P_NationalClsfctnSourceField : /ceecv/ro_sa_natl_clfn_src_fld,
P_UtilznStartDateSourceField : /ceecv/ro_sa_util_strt_src_fld,
P_ReportingStartDate : fis_rep_period_start_date,
P_AcquisitionDateSourceCode : /ceecv/ro_sa_acqn_date_src_fld,
P_AstLeadingDepreciationArea : saft_aa_ro_depr_area,
P_AstLdngDeprAreaLedger : saft_aa_ro_depr_area_ledger,
P_LeadingCompanyCode : /ceecv/ro_sa_ldng_comp_code
as select from I_FixedAsset as FixedAsset
inner join I_FixedAssetForLedger as FixedAssetForLedger on FixedAssetForLedger.CompanyCode = FixedAsset.CompanyCode
and FixedAssetForLedger.MasterFixedAsset = FixedAsset.MasterFixedAsset
and FixedAssetForLedger.FixedAsset = FixedAsset.FixedAsset
and FixedAssetForLedger.Ledger = $parameters.P_AstLdngDeprAreaLedger
inner join I_AssetValuationForLedger as AssetValuationForLedger on AssetValuationForLedger.CompanyCode = FixedAsset.CompanyCode
and AssetValuationForLedger.MasterFixedAsset = FixedAsset.MasterFixedAsset
and AssetValuationForLedger.FixedAsset = FixedAsset.FixedAsset
and AssetValuationForLedger.Ledger = $parameters.P_AstLdngDeprAreaLedger
and AssetValuationForLedger.AssetRealDepreciationArea = $parameters.P_AstLeadingDepreciationArea
and AssetValuationForLedger.ValidityEndDate >= $parameters.P_KeyDate
and AssetValuationForLedger.ValidityStartDate <= $parameters.P_KeyDate
left outer to one join I_RO_SAFTAssetDefinitionKey as ValKeyIIS //IIS = Is Investment Support
on ValKeyIIS.LeadingCompanyCode = $parameters.P_LeadingCompanyCode
and ValKeyIIS.AssetDefinitionKey = 'IS_INV_SUP'
and ValKeyIIS.SequenceNumber = '000'
{
//I_FixedAsset
key FixedAsset.CompanyCode,
key FixedAsset.MasterFixedAsset,
key FixedAsset.FixedAsset,
FixedAsset.FixedAssetDescription,
'' as AssetAdditionalDescription,
FixedAsset.AssetClass,
FixedAsset.AssetAccountDetermination,
FixedAsset.FixedAssetOrderDate,
//Calculated fields
cast( case $parameters.P_AcquisitionDateSourceCode
when '1' then FixedAssetForLedger.AssetCapitalizationDate
when '2' then FixedAssetForLedger.AcquisitionValueDate
else '' end as datum ) as AcquisitionDate,
cast( case $parameters.P_UtilznStartDateSourceField
when '1' then FixedAssetForLedger.AssetCapitalizationDate
when '2' then AssetValuationForLedger.AssetOpgReadinessDate
when '3' then AssetValuationForLedger.DepreciationStartDate
else '' end as datum ) as UtilizationStartDate,
cast( case $parameters.P_NationalClsfctnSourceField
when '0' then FixedAsset._FixedAssetCountryData.NationalClassification
when '1' then FixedAsset.Group1AssetEvaluationKey
when '2' then FixedAsset.Group2AssetEvaluationKey
when '3' then FixedAsset.Group3AssetEvaluationKey
when '4' then FixedAsset.Group4AssetEvaluationKey
when '5' then FixedAsset.Group5AssetEvaluationKey
when '6' then FixedAsset.FixedAssetGroup
else FixedAsset._FixedAssetCountryData.NationalClassification end as /ceecv/ro_sa_asset_valn_class ) as NationalClassification,
//I_FixedAssetForLedger
FixedAssetForLedger.AssetCapitalizationDate,
FixedAssetForLedger.AssetDeactivationDate,
FixedAssetForLedger.AcquisitionValueDate,
//I_AssetValuationForLedger
AssetValuationForLedger.PlannedUsefulLifeInYears,
AssetValuationForLedger.PlannedUsefulLifeInPeriods,
AssetValuationForLedger.DepreciationKey,
//Investment Support Evaluation Based on Configured Fieldname
cast( case ValKeyIIS.AssetDefinitionKeyField
when 'Group1AssetEvaluationKey' then
case substring(FixedAsset.Group1AssetEvaluationKey,ValKeyIIS.AssetDefinitionKeyOffsetValue+1,ValKeyIIS.AssetDefinitionKeyLengthValue)
when ValKeyIIS.AssetDefinitionKeyContentValue then 'X' else ' ' end
when 'Group2AssetEvaluationKey' then
case substring(FixedAsset.Group2AssetEvaluationKey,ValKeyIIS.AssetDefinitionKeyOffsetValue+1,ValKeyIIS.AssetDefinitionKeyLengthValue)
when ValKeyIIS.AssetDefinitionKeyContentValue then 'X' else ' ' end
when 'Group3AssetEvaluationKey' then
case substring(FixedAsset.Group3AssetEvaluationKey,ValKeyIIS.AssetDefinitionKeyOffsetValue+1,ValKeyIIS.AssetDefinitionKeyLengthValue)
when ValKeyIIS.AssetDefinitionKeyContentValue then 'X' else ' ' end
when 'Group4AssetEvaluationKey' then
case substring(FixedAsset.Group4AssetEvaluationKey,ValKeyIIS.AssetDefinitionKeyOffsetValue+1,ValKeyIIS.AssetDefinitionKeyLengthValue)
when ValKeyIIS.AssetDefinitionKeyContentValue then 'X' else ' ' end
when 'PropertyClass' then
case substring(FixedAsset.PropertyClass,ValKeyIIS.AssetDefinitionKeyOffsetValue+1,ValKeyIIS.AssetDefinitionKeyLengthValue)
when ValKeyIIS.AssetDefinitionKeyContentValue then 'X' else ' ' end
else ' '
end as /ceecv/ro_sa_ast_is_invmt_supp preserving type ) as RO_SAFTAstIsInvestmentSupport
} where
( FixedAssetForLedger.AssetDeactivationDate >= $parameters.P_ReportingStartDate or FixedAssetForLedger.AssetDeactivationDate = '00000000' )
and FixedAssetForLedger.AssetCapitalizationDate <> '00000000'
and FixedAssetForLedger.AcquisitionValueDate <> '00000000' and FixedAssetForLedger.AcquisitionValueDate <= $parameters.P_KeyDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ASSETVALUATIONFORLEDGER",
"I_FIXEDASSET",
"I_FIXEDASSETCOUNTRYDATA",
"I_FIXEDASSETFORLEDGER",
"I_RO_SAFTASSETDEFINITIONKEY"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/