P_RO_SAFTFixedAsset

DDL: P_RO_SAFTFIXEDASSET SQL: PROSAFASSET Type: view_entity COMPOSITE Package: GLO_FIN_IS_SAFT_AA_RO

RO SAFT Fixed Asset Master Data

P_RO_SAFTFixedAsset is a Composite CDS View that provides data about "RO SAFT Fixed Asset Master Data" in SAP S/4HANA. It reads from 3 data sources (I_AssetValuationForLedger, I_FixedAsset, I_FixedAssetForLedger) and exposes 17 fields with key fields CompanyCode, MasterFixedAsset, FixedAsset. Part of development package GLO_FIN_IS_SAFT_AA_RO.

Data Sources (3)

SourceAliasJoin Type
I_AssetValuationForLedger AssetValuationForLedger inner
I_FixedAsset FixedAsset from
I_FixedAssetForLedger FixedAssetForLedger inner

Parameters (4)

NameTypeDefault
P_KeyDate fagl_keydate
P_ReportingStartDate srf_rpg_period_start_date
P_AstLeadingDepreciationArea saft_aa_ro_depr_area
P_AstLdngDeprAreaLedger saft_aa_ro_depr_area_ledger

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label RO SAFT Fixed Asset Master Data view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MASTER view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_FixedAsset CompanyCode
KEY MasterFixedAsset I_FixedAsset MasterFixedAsset
KEY FixedAsset I_FixedAsset FixedAsset
Inventory I_FixedAsset Inventory
FixedAssetDescription I_FixedAsset FixedAssetDescription
AssetAdditionalDescription
AssetClass I_FixedAsset AssetClass
AssetAccountDetermination I_FixedAsset AssetAccountDetermination
FixedAssetOrderDate I_FixedAsset FixedAssetOrderDate
AssetCapitalizationDate I_FixedAssetForLedger AssetCapitalizationDate
AssetDeactivationDate I_FixedAssetForLedger AssetDeactivationDate
AcquisitionValueDate I_FixedAssetForLedger AcquisitionValueDate
PlannedUsefulLifeInYears I_AssetValuationForLedger PlannedUsefulLifeInYears
PlannedUsefulLifeInPeriods I_AssetValuationForLedger PlannedUsefulLifeInPeriods
DepreciationKey I_AssetValuationForLedger DepreciationKey
LeadingCompanyCode
RO_SAFTAstIsInvestmentSupport
//@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_AssetIdentifierSourceFields    : /ceecv/ro_sa_asset_id_src_flds,
 P_ReportingStartDate             : srf_rpg_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 //Later we expect to use in joins with I_RO_SAFTAssetDefinitionKey


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
{

  //I_FixedAsset

  key FixedAsset.CompanyCode,
  key FixedAsset.MasterFixedAsset,
  key FixedAsset.FixedAsset,

  FixedAsset.Inventory,

  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
              when '3' then AssetValuationForLedger.AssetOpgReadinessDate
              when '4' then AssetValuationForLedger.DepreciationStartDate
              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,

  cast( case $parameters.P_AssetIdentifierSourceFields
              when '2' then concat(concat(FixedAsset.CompanyCode,'_'),FixedAsset.Inventory)
              else concat(concat(concat(concat(FixedAsset.CompanyCode,'_'),FixedAsset.MasterFixedAsset),'_'),FixedAsset.FixedAsset)  //It is option 1 or anything else than 2

              end as /ceecv/ro_sa_asset_id ) as RO_SAFTAssetID,

  //I_FixedAssetForLedger

  FixedAssetForLedger.AssetCapitalizationDate,
  FixedAssetForLedger.AssetDeactivationDate,
  FixedAssetForLedger.AcquisitionValueDate,

  //I_AssetValuationForLedger

  AssetValuationForLedger.PlannedUsefulLifeInYears,
  AssetValuationForLedger.PlannedUsefulLifeInPeriods,
  AssetValuationForLedger.DepreciationKey,

  $parameters.P_LeadingCompanyCode as LeadingCompanyCode, //Parameter must be used

  cast( ' ' as /ceecv/ro_sa_ast_is_invmt_supp ) as RO_SAFTAstIsInvestmentSupport //Field is currently always empty for UPA On


} where
      ( FixedAssetForLedger.AssetDeactivationDate >= $parameters.P_ReportingStartDate or FixedAssetForLedger.AssetDeactivationDate = '00000000' )
    and FixedAssetForLedger.AssetCapitalizationDate <> '00000000'
    and FixedAssetForLedger.AcquisitionValueDate <> '00000000' and FixedAssetForLedger.AcquisitionValueDate <= $parameters.P_KeyDate