无效的键谓词类型。 预期类型为" Edm.String"

2020-08-18 13:07发布

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

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


我创建了一个拆分应用程序,并命名为OData以在母版页中显示列表。

现在,我正在尝试从母版页列表项导航至其详细信息。

这是代码:

MasterView.contoller.js

 onListItemPress:function(evt){
     var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
     var selectedSwapN = evt.getSource()。getBindingContext()
                 .getProperty(" Swapn");
     oRouter.navTo(" DetailView",{
         交换:selectedSwapN
     });
     sap.m.MessageToast.show(evt.getSource()。getBindingContext()
                 .getProperty(" Swapn"));
 }
 

DetailView.controller.js

 onInit:函数(){
             var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
             oRouter.getRoute(" DetailView")。attachMatched(this._onRouteMatched,this);
            
            
         },
         _onRouteMatched:函数(oEvent){
             var oArgs,oView;
             oArgs = oEvent.getParameter(" arguments");
             oView = this.getView();
             oView.bindElement({
                 路径:"/img/ET_SWAPSet(" + oArgs.Swapn +")",
                 事件:{
                     dataRequested:function(){
                         oView.setBusy(true);
                     },
                     dataReceived:function(){
                         oView.setBusy(false);
                     }
                 }
             });
         } 

Manifest.json

"路由":{
             " config":{
                 " viewType":" XML",
                 " viewPath":" ZMOB_BDJS_PENDING_APPROVAL.view",
                 " targetAggregation":" detailPages",
                 " clearTarget":false
             },
             "路线":[{
                 " pattern":"",
                 "名称": "",
                 " view":" MasterView",
                 " targetAggregation":" masterPages",
                 " targetControl":" splitapp",
                 "子路线":[{
                     " pattern":" DetailView/{Swapn}",
                     " name":" DetailView",
                     " view":" DetailView",
                     " targetAggregation":" detailPages"
                 }]
             }]
         } 

我能够获得所选项目,但是在显示详细信息时遇到问题。

我遇到的错误是我在子路由中添加的模式。

"样式":" DetailView/{Swapn}" 

这是错误:

发生以下问题:HTTP请求失败400,错误请求,{"错误":{"代码":" 005056A509B11EE1B9A8FEC11C22778E","消息":{" lang":" en","值":" " Swapn"的键谓词类型无效。期望的类型为" Edm.String""}," innererror":{" transactionid":" 325456E77FEFF15E811700505680552C"," timestamp":" 20170621073530.0200000"," Error_Resolution":{" SAP_Transaction": "在SAP Gateway集线器系统上运行事务/IWFND/ERROR_LOG并使用上面的时间戳搜索条目以了解更多详细信息"," SAP_Note":"请参阅SAP Note 1797736进行错误分析( https://service.sap.com/sap/support/notes/1797736 )"}}}} < br>

我已经检查了OData中的密钥类型Swapn,它是Edm.String

如何解决此问题?

谢谢

(1.4 kb)

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

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


我创建了一个拆分应用程序,并命名为OData以在母版页中显示列表。

现在,我正在尝试从母版页列表项导航至其详细信息。

这是代码:

MasterView.contoller.js

 onListItemPress:function(evt){
     var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
     var selectedSwapN = evt.getSource()。getBindingContext()
                 .getProperty(" Swapn");
     oRouter.navTo(" DetailView",{
         交换:selectedSwapN
     });
     sap.m.MessageToast.show(evt.getSource()。getBindingContext()
                 .getProperty(" Swapn"));
 }
 

DetailView.controller.js

 onInit:函数(){
             var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
             oRouter.getRoute(" DetailView")。attachMatched(this._onRouteMatched,this);
            
            
         },
         _onRouteMatched:函数(oEvent){
             var oArgs,oView;
             oArgs = oEvent.getParameter(" arguments");
             oView = this.getView();
             oView.bindElement({
                 路径:"/img/ET_SWAPSet(" + oArgs.Swapn +")",
                 事件:{
                     dataRequested:function(){
                         oView.setBusy(true);
                     },
                     dataReceived:function(){
                         oView.setBusy(false);
                     }
                 }
             });
         } 

Manifest.json

"路由":{
             " config":{
                 " viewType":" XML",
                 " viewPath":" ZMOB_BDJS_PENDING_APPROVAL.view",
                 " targetAggregation":" detailPages",
                 " clearTarget":false
             },
             "路线":[{
                 " pattern":"",
                 "名称": "",
                 " view":" MasterView",
                 " targetAggregation":" masterPages",
                 " targetControl":" splitapp",
                 "子路线":[{
                     " pattern":" DetailView/{Swapn}",
                     " name":" DetailView",
                     " view":" DetailView",
                     " targetAggregation":" detailPages"
                 }]
             }]
         } 

我能够获得所选项目,但是在显示详细信息时遇到问题。

我遇到的错误是我在子路由中添加的模式。

"样式":" DetailView/{Swapn}" 

这是错误:

发生以下问题:HTTP请求失败400,错误请求,{"错误":{"代码":" 005056A509B11EE1B9A8FEC11C22778E","消息":{" lang":" en","值":" " Swapn"的键谓词类型无效。期望的类型为" Edm.String""}," innererror":{" transactionid":" 325456E77FEFF15E811700505680552C"," timestamp":" 20170621073530.0200000"," Error_Resolution":{" SAP_Transaction": "在SAP Gateway集线器系统上运行事务/IWFND/ERROR_LOG并使用上面的时间戳搜索条目以了解更多详细信息"," SAP_Note":"请参阅SAP Note 1797736进行错误分析( https://service.sap.com/sap/support/notes/1797736 )"}}}} < br>

我已经检查了OData中的密钥类型Swapn,它是Edm.String

如何解决此问题?

谢谢

(1.4 kb)
付费偷看设置
发送
2条回答
我是小鹏鹏啊
1楼 · 2020-08-18 14:01.采纳回答

我通过在DetailView.controller.js的路径中添加单个qoute解决了该问题

 onInit:函数(){
             var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
             oRouter.getRoute(" DetailView")。attachMatched(this._onRouteMatched,this);
    
         },
         _onRouteMatched:函数(oEvent){
             var oArgs,oView;
             oArgs = oEvent.getParameter(" arguments");
             oView = this.getView();
             oView.bindElement({
                 路径:"/img/ET_SWAPSet('" + oArgs.Swapn +"')",
                 事件:{
                     dataRequested:function(){
                         oView.setBusy(true);
                     },
                     dataReceived:function(){
                         oView.setBusy(false);
                     }
                 }
            
             });
         } 
我是小鹏鹏啊
2楼-- · 2020-08-18 14:09

谢谢,这解决了我同样的问题!

一周热门 更多>