@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'G/L Account in ChtAccts (Draft 2.0)'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel: {
semanticKey: ['ChartOfAccounts', 'GLAccount'],
transactionalProcessingEnabled: true,
writeDraftPersistence: 'SKA1_DRAFT_20',
draftEnabled: true,
modelCategory: #BUSINESS_OBJECT,
compositionRoot: true,
createEnabled,
deleteEnabled,
updateEnabled,
usageType: {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #XL
}
}
@Search.searchable: true
@VDM.viewType: #TRANSACTIONAL
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
define view entity I_GLAcctInChtAcctsTP
as select from I_GLAccountInChartOfAccounts
left outer to one join I_ChartOfAccounts as chtaccts on I_GLAccountInChartOfAccounts.ChartOfAccounts = chtaccts.ChartOfAccounts
left outer to one join ska1 as _GroupAccount on chtaccts.CorporateGroupChartOfAccounts = _GroupAccount.ktopl
and I_GLAccountInChartOfAccounts.CorporateGroupAccount = _GroupAccount.saknr
/* BO node associations */
association [0..*] to I_GLAcctTextTP as _Text on $projection.ChartOfAccounts = _Text.ChartOfAccounts
and $projection.GLAccount = _Text.GLAccount
association [0..*] to I_GLAcctInCoCodeTP as _GLAcctInCoCodeTP on $projection.ChartOfAccounts = _GLAcctInCoCodeTP.ChartOfAccounts
and $projection.GLAccount = _GLAcctInCoCodeTP.GLAccount
association [0..*] to I_CostElementTP as _CostElementTP on $projection.ChartOfAccounts = _CostElementTP.ChartOfAccounts
and $projection.GLAccount = _CostElementTP.GLAccount
association [0..1] to I_GLAccountForPublicSectorTP as _PublicSectorTP on $projection.ChartOfAccounts = _PublicSectorTP.ChartOfAccounts and $projection.GLAccount = _PublicSectorTP.GLAccount
/* Associations */
association [0..1] to I_ChartOfAccounts as _ChartOfAccounts on $projection.ChartOfAccountsForEdit = _ChartOfAccounts.ChartOfAccounts
association [1] to I_User as _User on $projection.CreatedByUser = _User.UserID
association [0..1] to I_GLAccountType as _Glaccounttype on $projection.GLAccountType = _Glaccounttype.GLAccountType
association [0..1] to I_GLAccountSubtype as _GLAccountSubtype on $projection.GLAccountSubtype = _GLAccountSubtype.GLAccountSubtype
association [0..1] to I_BankRecnclnAccount as _BankRecnclnAcct on $projection.ChartOfAccountsForEdit = _BankRecnclnAcct.ChartOfAccounts
and $projection.BankReconciliationAccount = _BankRecnclnAcct.BankReconciliationAccount
association [1..1] to I_Globalcompany as _Globalcompany on $projection.PartnerCompany = _Globalcompany.Company
association [0..1] to I_GLAccountGroup as _Glaccountgroup on $projection.GLAccountGroup = _Glaccountgroup.GLAccountGroup
and $projection.ChartOfAccountsForEdit = _Glaccountgroup.ChartOfAccounts
association [0..1] to I_FunctionalArea as _FunctionalArea on $projection.FunctionalArea = _FunctionalArea.FunctionalArea
association [0..1] to I_GLAccountInChartOfAccounts as _CorporateGroupAccount on $projection.corporategroupchartofaccounts = _CorporateGroupAccount.ChartOfAccounts
and $projection.CorporateGroupAccount = _CorporateGroupAccount.GLAccount
association [0..1] to I_ProfitLossAccountType_Vh as _ProfitLossAccountType_Vh on $projection.ChartOfAccountsForEdit = _ProfitLossAccountType_Vh.ChartOfAccounts
and $projection.ProfitLossAccountType = _ProfitLossAccountType_Vh.ProfitLossAccountType
association [0..1] to I_ChartOfAccounts as _CorpGroupChartOfAccounts on $projection.corporategroupchartofaccounts = _CorpGroupChartOfAccounts.ChartOfAccounts
association [0..1] to I_GLAcctInDefaultLanguageText as _GLAcctTxtInMaintLang on $projection.ChartOfAccounts = _GLAcctTxtInMaintLang.ChartOfAccounts
and $projection.GLAccount = _GLAcctTxtInMaintLang.GLAccount
and $projection.MaintenanceLanguage = _GLAcctTxtInMaintLang.Language
association [0..1] to I_RetainedEarningsGLAccount as _RetainedEarningsGLAccount on $projection.ChartOfAccountsForEdit = _RetainedEarningsGLAccount.ChartOfAccounts
and $projection.ProfitLossAccountType = _RetainedEarningsGLAccount.ProfitLossAccountType
{
@ObjectModel.readOnly: true
key I_GLAccountInChartOfAccounts.ChartOfAccounts,
@ObjectModel.readOnly: true
key I_GLAccountInChartOfAccounts.GLAccount,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 1.0
@Search.ranking: #MEDIUM
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
@ObjectModel.mandatory: true
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION') // dynamic field control required by authorization control at UI level, hereinafter
I_GLAccountInChartOfAccounts.ChartOfAccounts as ChartOfAccountsForEdit, // Alias of ChartOfAccounts for active; Value to be provided by user for draft
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
@ObjectModel.mandatory: true
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.GLAccount as GLAccountForEdit, // Alias of GLAccount for active; Value to be provided by user for draft
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.IsBalanceSheetAccount,
@ObjectModel.mandatory: true
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_Glaccountgroup'
I_GLAccountInChartOfAccounts.GLAccountGroup,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_CorporateGroupAccount'
I_GLAccountInChartOfAccounts.CorporateGroupAccount,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@Consumption.valueHelp: '_ProfitLossAccountType_Vh'
I_GLAccountInChartOfAccounts.ProfitLossAccountType,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.SampleGLAccount,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.AccountIsMarkedForDeletion,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.AccountIsBlockedForCreation,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.AccountIsBlockedForPosting,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts.AccountIsBlockedForPlanning,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_Globalcompany'
I_GLAccountInChartOfAccounts.PartnerCompany,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_FunctionalArea'
I_GLAccountInChartOfAccounts.FunctionalArea,
@ObjectModel.readOnly: true
@Semantics.systemDate.createdAt: true
I_GLAccountInChartOfAccounts.CreationDate,
@ObjectModel.readOnly: true
@Semantics.user.id: true
I_GLAccountInChartOfAccounts.CreatedByUser,
@ObjectModel.mandatory: true
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_Glaccounttype'
I_GLAccountInChartOfAccounts.GLAccountType,
@ObjectModel.mandatory: #('EXTERNAL_CALCULATION')
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_GLAccountSubtype'
I_GLAccountInChartOfAccounts.GLAccountSubtype,
@ObjectModel.mandatory: #('EXTERNAL_CALCULATION')
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
@ObjectModel.foreignKey.association: '_BankRecnclnAcct'
I_GLAccountInChartOfAccounts.BankReconciliationAccount, //Account with sub-type B
@ObjectModel.readOnly: true
I_GLAccountInChartOfAccounts.GLAccountExternal,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
I_GLAccountInChartOfAccounts._GLAcctInChartOfAcctsProdn.GLAccountIsNotProdnRelevant,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
case
when I_GLAccountInChartOfAccounts._GLAcctInChartOfAcctsStatus.GLAcctCOAImplementStatus is null then
cast ( 'I' as glaccount_imst) //in process for SAP Delivered Content after Migration
else
I_GLAccountInChartOfAccounts._GLAcctInChartOfAcctsStatus.GLAcctCOAImplementStatus
end as GLAcctCOAImplementStatus,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
case
when I_GLAccountInChartOfAccounts._GLAcctInChartOfAcctsStatus.GLAcctCOAImplementStatus is null then
'X'
else
I_GLAccountInChartOfAccounts._GLAcctInChartOfAcctsStatus.GLAccountCOAIsDeliveredBySAP
end as GLAccountCOAIsDeliveredBySAP,
@ObjectModel.readOnly: true
chtaccts.MaintenanceLanguage, // Value to be derived from 'ChartOfAccountsForEdit' for draft (via BO determination triggered by UPDATE)
// The existing OData client requires at least read access for both fields
cast ('' as ktopl) as DraftReferenceChartOfAccounts, // Value to be set when COPY
cast ('' as saknr) as DraftReferenceGLAccount, // Value to be set when COPY
/**
* Open Question: Check below:
* Read: it should read both active and draft text
* Write: it should write through to the persistence table of I_GLAcctTextTP
*/
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #LOW
@ObjectModel.mandatory: true
_GLAcctTxtInMaintLang.GLAccountName, // Write through to TEXT node when field updated by user, or updated when TEXT updated
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #LOW
_GLAcctTxtInMaintLang.GLAccountLongName, // Write through to TEXT node when field updated by user, or updated when TEXT updated
@ObjectModel.readOnly: true
@ObjectModel.foreignKey.association: '_CorpGroupChartOfAccounts'
_ChartOfAccounts.CorporateGroupChartOfAccounts,
@ObjectModel.readOnly: #('EXTERNAL_CALCULATION')
//for special case: Remove Group COA after maintained Group COA Account
case when I_GLAccountInChartOfAccounts.CorporateGroupAccount is not null and _GroupAccount.sakan is null
then cast ( I_GLAccountInChartOfAccounts.CorporateGroupAccount as sakan )
else _GroupAccount.sakan end as CorporateGroupAccountExternal,
//_GroupAccount.sakan as CorporateGroupAccountExternal,
/* Associations */
_ChartOfAccounts,
_CorporateGroupAccount,
_FunctionalArea,
_Glaccountgroup,
_Glaccounttype,
_GLAccountSubtype,
_BankRecnclnAcct, //G/L Account with Sub-type B
_GLAcctTxtInMaintLang,
_Globalcompany,
_ProfitLossAccountType_Vh,
_RetainedEarningsGLAccount,
_CorpGroupChartOfAccounts,
_User,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_GLAcctInCoCodeTP,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_CostElementTP,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_PublicSectorTP,
@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_Text
}