@AbapCatalog.sqlViewName: 'PASSETASSGMT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM: {
private: true,
viewType: #COMPOSITE }
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XXL
define view P_AssetAssignment
as select from I_FixedAssetAssgmt
association [1..1] to I_AssetTP as _AssetTP on $projection.CompanyCode = _AssetTP.CompanyCode
and $projection.MasterFixedAsset = _AssetTP.MasterFixedAsset
and $projection.FixedAsset = _AssetTP.FixedAsset
association [0..1] to I_Fund as _Fund on $projection.Fund = _Fund.Fund
and $projection.FinancialManagementArea = _Fund.FinancialManagementArea
association [0..*] to I_FundsCenter as _FundsCenter on $projection.FundsCenter = _FundsCenter.FundsCenter
and $projection.FinancialManagementArea = _FundsCenter.FinancialManagementArea
and (
(
$projection.ValidityEndDate > _FundsCenter.ValidityStartDate
and $projection.ValidityEndDate <= _FundsCenter.ValidityEndDate
)
or(
$projection.ValidityStartDate <= _FundsCenter.ValidityEndDate
and $projection.ValidityStartDate >= _FundsCenter.ValidityStartDate
)
or(
$projection.ValidityEndDate >= _FundsCenter.ValidityEndDate
and $projection.ValidityStartDate <= _FundsCenter.ValidityStartDate
and _FundsCenter.ValidityStartDate <= $session.system_date
and _FundsCenter.ValidityEndDate >= $session.system_date
)
)
association [0..1] to I_WBSElementBasicData as _WBSElementBasicData on $projection.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
association [0..1] to I_BudgetPeriod as _BudgetPeriod on $projection.BudgetPeriod = _BudgetPeriod.BudgetPeriod
association [0..1] to I_Grant as _Grant on $projection.GrantID = _Grant.GrantID
// association [1..1] to E_FixedAssetAssgmt as _Extension on $projection.CompanyCode = _Extension.CompanyCode
// and $projection.MasterFixedAsset = _Extension.MasterFixedAsset
// and $projection.FixedAsset = _Extension.FixedAsset
// and $projection.ValidityEndDate = _Extension.ValidityEndDate
{
@ObjectModel.foreignKey.association: '_CompanyCode'
key I_FixedAssetAssgmt.CompanyCode as CompanyCode,
@ObjectModel.foreignKey.association: '_MasterFixedAsset'
key I_FixedAssetAssgmt.MasterFixedAsset,
key I_FixedAssetAssgmt.FixedAsset,
key I_FixedAssetAssgmt.ValidityEndDate,
I_FixedAssetAssgmt.ValidityStartDate,
@ObjectModel.foreignKey.association: '_ControllingArea'
I_FixedAssetAssgmt.ControllingArea,
I_FixedAssetAssgmt._CompanyCode.FinancialManagementArea as FinancialManagementArea,
@ObjectModel.foreignKey.association: '_BusinessArea'
I_FixedAssetAssgmt.BusinessArea,
cast (cast (''as abap.char(30))as farp_gtext preserving type) as BusinessAreaName,
@ObjectModel.foreignKey.association: '_CostCenter'
I_FixedAssetAssgmt.CostCenter,
cast (cast (''as abap.char(20))as fis_kostl_name preserving type) as CostCenterName,
@ObjectModel.foreignKey.association: '_CostCenterActivityType'
I_FixedAssetAssgmt.CostCtrActivityType,
cast (cast (''as abap.char(20))as ktext preserving type) as CostCtrActivityTypeName,
@ObjectModel.foreignKey.association: '_InternalOrder'
I_FixedAssetAssgmt.InternalOrder,
cast (cast (''as abap.char(40))as fis_internalorder_text preserving type) as InternalOrderDescription,
@ObjectModel.foreignKey.association: '_Fund'
I_FixedAssetAssgmt.Fund,
cast (cast (''as abap.char(20))as fmis_fund_name preserving type) as FundName,
@ObjectModel.foreignKey.association:'_Grant'
I_FixedAssetAssgmt.GrantID,
cast (cast (''as abap.char(20))as gm_short_description preserving type) as GrantName,
@ObjectModel.foreignKey.association: '_FunctionalArea'
I_FixedAssetAssgmt.FunctionalArea,
cast (cast (''as abap.char(25))as fkbtx preserving type) as FunctionalAreaName,
@ObjectModel.foreignKey.association: '_FundsCenter'
I_FixedAssetAssgmt.FundsCenter,
cast (cast (''as abap.char(20))as fmis_fc_name preserving type) as FundsCenterName,
@ObjectModel.foreignKey.association: '_WBSElementBasicData'
I_FixedAssetAssgmt.WBSElementInternalID,
cast (cast('' as abap.char(24)) as ps_posid_edit preserving type) as WBSElementExternalID,
//_WBSElementBasicData.WBSElementExternalID as WBSElementExternalID,
cast (cast (''as abap.char(40))as ps_s4_post1 preserving type) as WBSElementDescription,
I_FixedAssetAssgmt.TaxJurisdiction,
I_FixedAssetAssgmt.RealEstateObject,
@ObjectModel.foreignKey.association: '_Segment'
I_FixedAssetAssgmt.Segment,
cast (cast (''as abap.char(50))as fis_segment_name preserving type) as SegmentName,
@ObjectModel.foreignKey.association: '_ProfitCenter'
I_FixedAssetAssgmt.ProfitCenter,
cast (cast (''as abap.char(20))as fis_prctr_shorttext preserving type) as ProfitCenterName,
@ObjectModel.foreignKey.association: '_BudgetPeriod'
I_FixedAssetAssgmt.BudgetPeriod,
@ObjectModel.foreignKey.association: '_ResponsibleCostCenter'
I_FixedAssetAssgmt.ResponsibleCostCenter,
cast (cast (''as abap.char(20))as fis_kostl_name preserving type) as ResponsibleCostCenterName,
I_FixedAssetAssgmt.Room,
@ObjectModel.foreignKey.association: '_Plant'
I_FixedAssetAssgmt.Plant,
cast (cast (''as abap.char(30))as werks_name preserving type) as PlantName,
//_Plant.PlantName,
// PlantName,
@ObjectModel.foreignKey.association: '_AssetLocation'
I_FixedAssetAssgmt.AssetLocation,
//_Location.LocationName as AssetLocationName,
//I_FixedAssetAssgmt._AssetLocation.LocationName as AssetLocationName,
cast (cast (''as abap.char(40))as locationname preserving type) as AssetLocationName,
I_FixedAssetAssgmt.VehicleLicensePlateNumber,
I_FixedAssetAssgmt.PersonnelNumber,
I_FixedAssetAssgmt.BusinessPlace,
I_FixedAssetAssgmt.ReferenceDocumentType,
I_FixedAssetAssgmt.LogicalSystem,
I_FixedAssetAssgmt.ReferenceDocumentContext,
I_FixedAssetAssgmt.ReferenceDocument,
cast ('' as abap.char(512) ) as LongText,
@Consumption.hidden: true
I_FixedAssetAssgmt.AssetAuthorizationContext,
_AssetTP,
@ObjectModel.association.type:null
_FixedAsset, // For inheritence use in access control
_Grant,
_Fund,
_FundsCenter,
_WBSElementBasicData,
_BudgetPeriod,
_MasterFixedAsset,
I_FixedAssetAssgmt._CompanyCode,
I_FixedAssetAssgmt._CostCenter,
I_FixedAssetAssgmt._ResponsibleCostCenter,
I_FixedAssetAssgmt._CostCenterActivityType,
I_FixedAssetAssgmt._Plant,
I_FixedAssetAssgmt._BusinessArea,
I_FixedAssetAssgmt._InternalOrder,
I_FixedAssetAssgmt._ProfitCenter,
I_FixedAssetAssgmt._Segment,
I_FixedAssetAssgmt._FunctionalArea,
I_FixedAssetAssgmt._ControllingArea,
I_FixedAssetAssgmt._AssetLocation,
I_FixedAssetAssgmt._Employment
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_FIXEDASSETASSGMT"
],
"ASSOCIATED":
[
"I_ASSETTP",
"I_BUDGETPERIOD",
"I_BUSINESSAREA",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_COSTCENTER",
"I_COSTCENTERACTIVITYTYPE",
"I_EMPLOYMENT",
"I_FIXEDASSET",
"I_FUNCTIONALAREA",
"I_FUND",
"I_FUNDSCENTER",
"I_GRANT",
"I_INTERNALORDER",
"I_LOCATION",
"I_MASTERFIXEDASSET",
"I_PLANT",
"I_PROFITCENTER",
"I_SEGMENT",
"I_WBSELEMENTBASICDATA"
],
"BASE":
[
"I_FIXEDASSETASSGMT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/