@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName: 'ICOELTP'
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'G/L Account in CtrlgArea (Draft 2.0)'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel: {
semanticKey: ['ChartOfAccounts', 'GLAccount', 'ControllingArea'],
//transactionalProcessingEnabled: true,
writeDraftPersistence: 'CSKB_DRAFT_20',
createEnabled,
deleteEnabled,
updateEnabled,
usageType: {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #XL
}
}
@Search.searchable: true
@VDM.viewType: #TRANSACTIONAL
define view I_CostElementTP
as select from I_CostElement
left outer join P_GLAcctNotMarkForDeletion as _PostableGLAccount on I_CostElement.ChartOfAccounts = _PostableGLAccount.ChartOfAccounts
and I_CostElement.ControllingArea = _PostableGLAccount.ControllingArea
and I_CostElement.GLAccount = _PostableGLAccount.GLAccount
/* BO node associations */
association [1..1] to I_GLAcctInChtAcctsTP as _GLAcctInChtAcctsTP on $projection.ChartOfAccounts = _GLAcctInChtAcctsTP.ChartOfAccounts
and $projection.GLAccount = _GLAcctInChtAcctsTP.GLAccount
/* Associations */
association [0..1] to I_ControllingArea as _ControllingArea on $projection.ControllingAreaForEdit = _ControllingArea.ControllingArea
and $projection.ChartOfAccountsForEdit = _ControllingArea.ChartOfAccounts
association [0..1] to I_CostElementCategory as _CostElementCategory on $projection.CostElementCategory = _CostElementCategory.CostElementCategory
association [0..1] to I_UnitOfMeasure as _UnitOfMeasure on $projection.UnitOfMeasure = _UnitOfMeasure.UnitOfMeasure
association [0..1] to I_FunctionalArea as _FunctionalArea on $projection.FunctionalArea = _FunctionalArea.FunctionalArea
// association [0..*] to I_GLAcctTextTP as _Text on $projection.ChartOfAccounts = _Text.ChartOfAccounts
// and $projection.GLAccount = _Text.GLAccount
{
key I_CostElement.ChartOfAccounts,
// not readonly because when created we must copy value from parent
key I_CostElement.GLAccount,
@ObjectModel.readOnly: true
key I_CostElement.ControllingArea,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
//@ObjectModel.foreignKey.association: '_ControllingArea'
@ObjectModel.mandatory: true
I_CostElement.ControllingArea as ControllingAreaForEdit,
@ObjectModel.readOnly: true
_GLAcctInChtAcctsTP.ChartOfAccounts as ChartOfAccountsForEdit, // Alias of ChartOfAccounts for active; Value to be updated when root node updated for draft
@ObjectModel.readOnly: true
_GLAcctInChtAcctsTP.GLAccountForEdit, // Alias of GLAccount for active; Value to be updated when root node updated for draft (via BO determination triggered by UPDATE on root)
@Semantics.businessDate.from: true
@ObjectModel.readOnly: true // should not be editable by user
ValidityStartDate,
@Semantics.businessDate.to: true
@ObjectModel.readOnly: true
ValidityEndDate,
@ObjectModel.foreignKey.association: '_CostElementCategory'
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
CostElementCategory,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
ConsumptionQtyIsRecorded,
@ObjectModel.foreignKey.association: '_UnitOfMeasure'
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
UnitOfMeasure,
@Semantics.systemDate.createdAt: true
CreationDate,
@Semantics.user.createdBy: true
CreatedByUser,
@ObjectModel.foreignKey.association: '_FunctionalArea'
FunctionalArea,
//@ObjectModel.readOnly: 'EXTERNAL_CALCULATION' // dynamic field control
AcctAssignmentIsStatistical, // though value is calculated, the field must be updatable
@ObjectModel.readOnly: true
cast(case when _PostableGLAccount.AccountIsMarkedForDeletion is null then 'X'
else _PostableGLAccount.AccountIsMarkedForDeletion
end as xloev ) as AccountIsMarkedForDeletion,
//cast ('' as xloev ) as AccountIsMarkedForDeletion, // Always FALSE for active entity; For draft entity, TRUE if all relevant CompanyCode assignments are MarkedForDelete
/* Associations */
_ControllingArea,
_CostElementCategory,
_FunctionalArea,
//_Text,
_UnitOfMeasure,
@ObjectModel.association.type: [#TO_COMPOSITION_PARENT, #TO_COMPOSITION_ROOT]
_GLAcctInChtAcctsTP
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COSTELEMENT",
"I_GLACCTINCHTACCTSTP",
"P_GLACCTNOTMARKFORDELETION"
],
"ASSOCIATED":
[
"I_CONTROLLINGAREA",
"I_COSTELEMENTCATEGORY",
"I_FUNCTIONALAREA",
"I_GLACCTINCHTACCTSTP",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/