@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName: 'IGLACOCDTP'
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'G/L Account in Company Code (Draft 2.0)'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel: {
semanticKey: ['ChartOfAccounts', 'GLAccount', 'CompanyCode'],
//Only root need
//transactionalProcessingEnabled: true,
writeDraftPersistence: 'SKB1_DRAFT_20',
createEnabled,
deleteEnabled,
updateEnabled,
usageType: {
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #XL
}
}
@Search.searchable: true
@VDM.viewType: #TRANSACTIONAL
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
define view I_GLAcctInCoCodeTP
as select from I_GLAcctInCoCode
//Changed from Left outer join to Assocation becasue of ATC CHECK : association missing
//association [0..1] to I_ChartOfAccounts as chtaccts on $projection.ChartOfAccounts = chtaccts.ChartOfAccounts
left outer to one join I_ChartOfAccounts as chtaccts on I_GLAcctInCoCode.ChartOfAccounts = chtaccts.ChartOfAccounts
left outer to one join ska1 as _GroupAccount on CountryChartOfAccounts = _GroupAccount.ktopl
and AlternativeGLAccount = _GroupAccount.saknr
/* BO nodes 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_CompanyCode as _CompanyCode on $projection.CompanyCodeForEdit = _CompanyCode.CompanyCode // Use *ForEdit fields, because the association
//and $projection.ChartOfAccountsForEdit = _CompanyCode.ChartOfAccounts // serves as Value-help on some field
association [1..1] to I_User as _User on $projection.CreatedByUser = _User.UserID
association [0..1] to I_InflationKey as _InflationKey on $projection.country = _InflationKey.Country
and $projection.GLAcctInflationKey = _InflationKey.GLAcctInflationKey
association [0..1] to I_PlanningLevel as _PlanningLevel on $projection.PlanningLevel = _PlanningLevel.PlanningLevel
association [0..1] to I_Housebank as _HouseBank on $projection.CompanyCodeForEdit = _HouseBank.CompanyCode
and $projection.HouseBank = _HouseBank.HouseBank
association [0..1] to I_HouseBankAccount as _HouseBankAccount on $projection.CompanyCodeForEdit = _HouseBankAccount.CompanyCode
and $projection.HouseBank = _HouseBankAccount.HouseBank
and $projection.HouseBankAccount = _HouseBankAccount.HouseBankAccount
association [0..1] to I_Reconciliationaccttype as _Reconciliationaccttype on $projection.ReconciliationAccountType = _Reconciliationaccttype.ReconciliationAccountType
association [0..1] to I_InterestCalculationCode as _InterestCalculationCode on $projection.InterestCalculationCode = _InterestCalculationCode.InterestCalculationCode
association [0..1] to I_AcctgDocItmDspSqncRule as _AcctgDocItmDspSqncRule on $projection.AcctgDocItmDisplaySequenceRule = _AcctgDocItmDspSqncRule.AcctgDocItmDisplaySequenceRule
// association [0..1] to I_CashPlanningGroup as _CashPlanningGroup on $projection.CashPlanningGroup = _CashPlanningGroup.CashPlanningGroup
association [0..1] to I_GLAccountToleranceGroup as _GLAccountToleranceGroup on $projection.CompanyCodeForEdit = _GLAccountToleranceGroup.CompanyCode
and $projection.APARToleranceGroup = _GLAccountToleranceGroup.APARToleranceGroup
association [0..1] to I_JointVentureRecovery as _JointVentureRecovery on $projection.JointVentureRecoveryCode = _JointVentureRecovery.JointVentureRecoveryCode
and $projection.CompanyCodeForEdit = _JointVentureRecovery.CompanyCode
association [0..1] to I_FieldStatusGroup as _FieldStatusGroup on $projection.fieldstatusvariant = _FieldStatusGroup.FieldStatusVariant
and $projection.FieldStatusGroup = _FieldStatusGroup.FieldStatusGroup
association [0..1] to I_MultiCurrencyAccounting as _MultiCurrencyAccounting on $projection.MultiCurrencyAccountingCode = _MultiCurrencyAccounting.MultiCurrencyAccountingCode
association [0..1] to I_Currency as _GLAccountCurrency on $projection.GLAccountCurrency = _GLAccountCurrency.Currency
association [0..1] to I_TaxCategory as _TaxCategory on $projection.CompanyCodeForEdit = _TaxCategory.CompanyCode
and $projection.TaxCategory = _TaxCategory.TaxCategory
association [0..1] to I_GLAccountInChartOfAccounts as _AlternativeGLAccount on $projection.CountryChartOfAccounts = _AlternativeGLAccount.ChartOfAccounts
and $projection.AlternativeGLAccount = _AlternativeGLAccount.GLAccount
// association [0..*] to I_GLAcctTextTP as _Text on $projection.ChartOfAccounts = _Text.ChartOfAccounts
// and $projection.GLAccount = _Text.GLAccount
association [0..1] to I_GLAcctInDefaultLanguageText as _GLAcctTxtInMaintLang on $projection.ChartOfAccounts = _GLAcctTxtInMaintLang.ChartOfAccounts //I_GLAccountText
and $projection.GLAccount = _GLAcctTxtInMaintLang.GLAccount
and $projection.MaintenanceLanguage = _GLAcctTxtInMaintLang.Language
association [0..1] to I_FieldStatusVariant as _FieldStatusVariant on $projection.fieldstatusvariant = _FieldStatusVariant.FieldStatusVariant
association [0..1] to I_ChartOfAccounts as _ChartOfAccounts on $projection.CountryChartOfAccounts = _ChartOfAccounts.ChartOfAccounts
association [0..1] to I_GLAccount as _GLAccount on $projection.CompanyCode = _GLAccount.CompanyCode
and $projection.GLAccount = _GLAccount.GLAccount
{
// not readonly because when created we must copy value from parent
key I_GLAcctInCoCode.ChartOfAccounts,
// not readonly because when created we must copy value from parent
key GLAccount,
@ObjectModel.readOnly: true
key CompanyCode,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
@ObjectModel.foreignKey.association: '_CompanyCode'
@ObjectModel.mandatory: true
@ObjectModel.text.element: [ 'CompanyCodeName' ]
I_GLAcctInCoCode.CompanyCode as CompanyCodeForEdit,
// I_GLAcctInCoCodeLayerForTP.CompanyCodeForEdit, // Alias of CompanyCode for active; Value to be provided by user
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
AuthorizationGroup,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
AccountingClerk,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@Semantics.businessDate.at: true
LastInterestCalcRunDate,
@Semantics.systemDate.createdAt: true
CreationDate,
@Semantics.user.id: true
CreatedByUser,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_PlanningLevel'
PlanningLevel,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_HouseBank'
HouseBank,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_HouseBankAccount'
HouseBankAccount,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
ExchRateDifferencesAccountDetn,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_Reconciliationaccttype'
ReconciliationAccountType,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_TaxCategory'
TaxCategory,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_InterestCalculationCode'
InterestCalculationCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_GLAccountCurrency'
GLAccountCurrency,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
IsManagedExternally,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
IsAutomaticallyPosted,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
LineItemDisplayIsEnabled,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
SupplementIsAllowed,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
IsOpenItemManaged,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
InterestCalculationDate,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
IntrstCalcFrequencyInMonths,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_AcctgDocItmDspSqncRule'
AcctgDocItmDisplaySequenceRule,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_AlternativeGLAccount'
AlternativeGLAccount,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
//For special case: Rmove Country COA after Maintained AlternativeGLAccount
case when AlternativeGLAccount is not null and _GroupAccount.sakan is null
then cast ( AlternativeGLAccount as sakan )
else _GroupAccount.sakan end as AlternativeGLAccountExternal,
//_GroupAccount.sakan as AlternativeGLAccountExternal,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_JointVentureRecovery'
JointVentureRecoveryCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
CommitmentItem,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
TaxCodeIsRequired,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
BalanceHasLocalCurrency,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
ValuationGroup,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_GLAccountToleranceGroup'
APARToleranceGroup,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
AccountIsBlockedForPosting,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
AccountIsMarkedForDeletion,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
ClearingIsLedgerGroupSpecific,
/*remove cashplanninggroup field*/
// @ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
// @ObjectModel.foreignKey.association: '_CashPlanningGroup'
// CashPlanningGroup,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
IsCashFlowAccount,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_InflationKey'
GLAcctInflationKey,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_FieldStatusGroup'
FieldStatusGroup,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
@ObjectModel.foreignKey.association: '_MultiCurrencyAccounting'
MultiCurrencyAccountingCode,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
ReconciliationAcctIsChangeable,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
I_GLAcctInCoCode.IsExtendedOpenItemManaged as IsExtendedOpenItemManaged,
@ObjectModel.readOnly: true
chtaccts.MaintenanceLanguage, // Value to be derived from 'ROOT~ChartOfAccountsForEdit' for draft (via BO determination triggered by UPDATE on root)
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
case
when I_GLAcctInCoCode._GLAcctInCoCodeStatus.GLAcctCoCodeImplementStatus is null then
cast ( 'I' as glaccount_imst) //in process for SAP Delivered Content after Migration
else
I_GLAcctInCoCode._GLAcctInCoCodeStatus.GLAcctCoCodeImplementStatus
end as GLAcctCoCodeImplementStatus,
@ObjectModel.mandatory: 'EXTERNAL_CALCULATION'
case
when I_GLAcctInCoCode._GLAcctInCoCodeStatus.GLAcctCoCodeImplementStatus is null then
'X' //in process for SAP Delivered Content after Migration
else
I_GLAcctInCoCode._GLAcctInCoCodeStatus.GLAccountCoCodIsDeliveredBySAP
end as GLAccountCoCodIsDeliveredBySAP,
/* Fields expanded along associations, due to a limitation that we cannot introduce new fields in BO consumption view (@ObjectModel.type: #CONSUMPTION) */
@ObjectModel.readOnly: true
@ObjectModel.text.element: [ 'GLAccountName', 'GLAccountLongName' ]
I_GLAcctInCoCode.GLAccount as GLAccountForEdit,
// I_GLAcctInCoCodeLayerForTP.GLAccountForEdit, // Alias of GLAccount for active; Value to be updated when root node updated for draft (via BO determination triggered by UPDATE on root)
@ObjectModel.readOnly: true
_GLAcctTxtInMaintLang.GLAccountName, // Updated when TEXT updated, value comes from TEXT node
@ObjectModel.readOnly: true
_GLAcctTxtInMaintLang.GLAccountLongName, // Updated when TEXT updated, value comes from TEXT node
@ObjectModel.readOnly: true
I_GLAcctInCoCode.ChartOfAccounts as ChartOfAccountsForEdit,
// I_GLAcctInCoCodeLayerForTP.ChartOfAccountsForEdit, // Alias of ChartOfAccounts for active; Value to be updated when root node updated for draft
@ObjectModel.readOnly: true
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
CountryChartOfAccounts, // Value to be derived for draft
@ObjectModel.readOnly: true
_CompanyCode.Country, // Value to be derived for draft
@ObjectModel.readOnly: true
_CompanyCode.ControllingArea, // Value to be derived for draft
@ObjectModel.readOnly: true
@ObjectModel.foreignKey.association: '_FieldStatusVariant'
_CompanyCode.FieldStatusVariant, // Value to be derived for draft
@ObjectModel.readOnly: true
_CompanyCode.CompanyCodeName,
/* Associations */
_AcctgDocItmDspSqncRule,
_AlternativeGLAccount,
// _CashPlanningGroup,
_CompanyCode,
_FieldStatusGroup,
_GLAccountCurrency,
_GLAccountToleranceGroup,
_GLAcctTxtInMaintLang,
_HouseBank,
_HouseBankAccount,
_InflationKey,
_InterestCalculationCode,
_JointVentureRecovery,
_MultiCurrencyAccounting,
_PlanningLevel,
_Reconciliationaccttype,
_TaxCategory,
//_Text,
_User,
_FieldStatusVariant,
_ChartOfAccounts,
@ObjectModel.association.type: [#TO_COMPOSITION_PARENT, #TO_COMPOSITION_ROOT]
_GLAcctInChtAcctsTP,
_GLAccount
}