CDS OData.publish错误:没有从ABAP字典中检索到实体的数据... [OData暴露]

2020-08-16 19:28发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

我正在尝试创建一个具有根节点(标头)和子节点(任务)的新CDS(基于BOPF):

 @ AbapCatalog.sqlViewName:'ZTRMI_HEADER'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"任务请求标头"

 @ Search.searchable:是

 @ObjectModel:{
     modelCategory:#BUSINESS_OBJECT,
     compositionRoot:正确,
     RepresentativeKey:"请求",
     语义关键字:'request',
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingEnabled:是的,
     writeActivePersistence:" ZTRM_HEADER"
 }


 定义视图ZTRM_I_HEADER
     从ztrm_header中选择
     将[0 .. *]与_tasks关联到ZTRM_I_TASKS
         在$ projection.request = _tasks.request上
 
 @ AbapCatalog.sqlViewName:'ZTRMI_TASKS'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"传输请求任务"

 @ Search.searchable:是

 @ObjectModel:{
     modelCategory:#BUSINESS_OBJECT,
     transactionalProcessingDelegated:true,
     RepresentativeKey:"代码",
     语义关键字:['request','code'],
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     writeActivePersistence:'ZTRM_TASKS'
 }

 定义视图ZTRM_I_TASKS
     从ztrm_tasks中选择
     将[1]与_header关联到ZTRM_I_HEADER
         在_header.request = $ projection.request上
 

直到完美为止,BOPF都会生成。

问题是当我尝试为它们两个创建消费CDS时:

 @ AbapCatalog.sqlViewName:'ZTRMC_HEADER'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"消费:标题"

 @ Search.searchable:是

 @ OData.publish:正确

 @ObjectModel:{
     RepresentativeKey:"请求",
     语义关键字:'request',
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingDelegated:true
 }

 @ UI.headerInfo:
 {
     typeName:'运输请求',
     typeNamePlural:'运输请求',
     title.value:'请求',
     title.label:"运输请求"
 }

 定义视图ZTRM_C_HEADER
     从ZTRM_I_HEADER中选择
     将[0 .. *]与ZTRM_C_TASKS关联为_tasks
         在$ projection.request = _tasks.request上
  
 @ AbapCatalog.sqlViewName:'ZTRMC_TASKS'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"消费:任务"

 @ Search.searchable:是

 @ObjectModel:{
     RepresentativeKey:"代码",
     语义关键字:['request','code'],
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingDelegated:true,
     writeActivePersistence:'ZTRM_TASKS'
 }

 @ UI.headerInfo:
 {
     typeName:'任务',
     typeNamePlural:'任务',
     title.value:'代码',
     title.label:'任务'
 }

 定义视图ZTRM_C_TASKS
     从ZTRM_I_TASKS中选择
     将[1]与ZTRM_C_HEADER关联为_header
         在_header.request = $ projection.reques上
 

ZTRM_C_HEADER已保存并激活,但是注释OData.publish引发错误:没有从ABAP字典中检索到实体ZTRM_TASKS [OData Exposure]的数据


有人可以帮助解决该错误吗?

谢谢。

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

我正在尝试创建一个具有根节点(标头)和子节点(任务)的新CDS(基于BOPF):

 @ AbapCatalog.sqlViewName:'ZTRMI_HEADER'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"任务请求标头"

 @ Search.searchable:是

 @ObjectModel:{
     modelCategory:#BUSINESS_OBJECT,
     compositionRoot:正确,
     RepresentativeKey:"请求",
     语义关键字:'request',
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingEnabled:是的,
     writeActivePersistence:" ZTRM_HEADER"
 }


 定义视图ZTRM_I_HEADER
     从ztrm_header中选择
     将[0 .. *]与_tasks关联到ZTRM_I_TASKS
         在$ projection.request = _tasks.request上
 
 @ AbapCatalog.sqlViewName:'ZTRMI_TASKS'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"传输请求任务"

 @ Search.searchable:是

 @ObjectModel:{
     modelCategory:#BUSINESS_OBJECT,
     transactionalProcessingDelegated:true,
     RepresentativeKey:"代码",
     语义关键字:['request','code'],
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     writeActivePersistence:'ZTRM_TASKS'
 }

 定义视图ZTRM_I_TASKS
     从ztrm_tasks中选择
     将[1]与_header关联到ZTRM_I_HEADER
         在_header.request = $ projection.request上
 

直到完美为止,BOPF都会生成。

问题是当我尝试为它们两个创建消费CDS时:

 @ AbapCatalog.sqlViewName:'ZTRMC_HEADER'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"消费:标题"

 @ Search.searchable:是

 @ OData.publish:正确

 @ObjectModel:{
     RepresentativeKey:"请求",
     语义关键字:'request',
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingDelegated:true
 }

 @ UI.headerInfo:
 {
     typeName:'运输请求',
     typeNamePlural:'运输请求',
     title.value:'请求',
     title.label:"运输请求"
 }

 定义视图ZTRM_C_HEADER
     从ZTRM_I_HEADER中选择
     将[0 .. *]与ZTRM_C_TASKS关联为_tasks
         在$ projection.request = _tasks.request上
  
 @ AbapCatalog.sqlViewName:'ZTRMC_TASKS'
 @ AbapCatalog.compiler.compareFilter:是
 @ AbapCatalog.preserveKey:是
 @ AccessControl.authorizationCheck:#NOT_REQUIRED
 @ EndUserText.label:"消费:任务"

 @ Search.searchable:是

 @ObjectModel:{
     RepresentativeKey:"代码",
     语义关键字:['request','code'],
     createEnabled:是的,
     updateEnabled:是,
     deleteEnabled:是,
     transactionalProcessingDelegated:true,
     writeActivePersistence:'ZTRM_TASKS'
 }

 @ UI.headerInfo:
 {
     typeName:'任务',
     typeNamePlural:'任务',
     title.value:'代码',
     title.label:'任务'
 }

 定义视图ZTRM_C_TASKS
     从ZTRM_I_TASKS中选择
     将[1]与ZTRM_C_HEADER关联为_header
         在_header.request = $ projection.reques上
 

ZTRM_C_HEADER已保存并激活,但是注释OData.publish引发错误:没有从ABAP字典中检索到实体ZTRM_TASKS [OData Exposure]的数据


有人可以帮助解决该错误吗?

谢谢。

付费偷看设置
发送
2条回答
N-Moskvin
1楼 · 2020-08-16 19:54.采纳回答

消费视图不得使用@ ObjectModel.writeActivePersistence进行注释。

作为次要点,事务视图ZTRM_I_TASKS不应使用transactionalProcessingDelegated进行注释,因为这表示使用情况视图。

请对照用于SAP Fiori的ABAP编程模型的官方文档中的示例再次检查您的模型。

何必丶何苦呢
2楼-- · 2020-08-16 20:01

谢谢! 这样就解决了问题。

我知道注释transactionalProcessingDelegated是用于子CDS的,但是很明显,它仅用于消费视图

一周热门 更多>