CDS批注@ ObjectModel.alternativeKey不会影响BOPF对象

时间:2019-04-12 20:20:45

标签: sap abap business-objects cds

我正在使用CDS视图来生成业务对象。我需要使用AlternativeKeys,所以我要使用@ ObjectModel.alternativeKey。但是,它不会将AlternativeKey添加到Business对象节点。我需要在BOBX事务中手动添加它。

我应该如何进行?

@AbapCatalog.sqlViewName: 'ZIFOOTPROM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Foo Tp'
@VDM.viewType: #TRANSACTIONAL
@ObjectModel: {
  modelCategory: #BUSINESS_OBJECT,
  createEnabled: true,
  updateEnabled: true,
  deleteEnabled: true,
  compositionRoot: true,
  transactionalProcessingEnabled: true,
  writeActivePersistence: 'ZFOO_ROM',
  alternativeKey: [{
    id: 'chave_ext',
    element: ['chave_ext'],
    uniqueness: #UNIQUE
  }],
  draftEnabled: true,
  writeDraftPersistence: 'ZDFOO_ROM'
}
@OData.publish: true
define view ZI_FOO_TP_ROM as select from zfoo_rom {
  key uma_chave,
  @ObjectModel.mandatory: true
  nao_chave,
  chave_ext
}

0 个答案:

没有答案