SAP Cloud Platform:无法在v4目录服务上扩展

2020-09-03 11:15发布

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

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


1)我已经使用业务应用程序模板data-model.cds文件定义了父+子实体集:

(遵循 CDS协会上的SAP文档

实体用户{
 密钥电子邮件:Common.DataKey;
 名字:Common.DataKey;
 姓氏:Common.DataKey;
 密码:Common.DataKey;
 ToAuthorizations:与许多Data.Authorization关联到ToAuthorizations.User = $ self;
 }


 实体授权{
 关键用户:与Data.User的关联;
 密钥ID:Common.DataKey10;
 

2)并通过目录服务公开实体:

 service CatalogService {

 实体用户@(
 能力:{
 InsertRestrictions:{Insertable:true},
 UpdateRestrictions:{可更新:true},
 DeleteRestrictions:{可删除:true}
 }
 )作为Data.User的投影;

 实体授权@(
 能力:{
 InsertRestrictions:{Insertable:true},
 UpdateRestrictions:{可更新:true},
 DeleteRestrictions:{可删除:true}
 }
 )作为对Data.Authorization的投影;
 

/ToAuthorizations可以正常工作

请求网址:
 https:// -approuter.cfapps.eu10.hana.ondemand.com/odata/v4/CatalogService/Users('email')/ToAuthorizations
 请求方法:
 得到
 状态码:
 200 OK
 远端地址:
 35.157.43.191:443
 推荐人政策:
 降级时无推荐人
 

?$ expand = ToAuthoriations失败"错误:列的定义不明确:"

请求网址:
 https:// -approuter.cfapps.eu10.hana.ondemand.com/odata/v4/CatalogService/Users('email')?$ expand = ToAuthorizations
 请求方法:
 得到
 状态码:
 500内部服务器错误
 远端地址:
 18.185.232.121:443
 推荐人政策:
 降级时无推荐人
 
 rootCause:
    {[错误:定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_USER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9。  USER_EMAIL AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.User_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS的电子邮件Data_User  tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.User_Email = filterExpand.Email)te9b38c6d385f0f9f9f9f9f9f954f9f954f994f9f954f9f954f9f954f9f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9e  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`]
      消息:"定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_USER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.User_Email  AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.User_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS的电子邮件Data_User  tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.User_Email = filterExpand.Email)te9b38c6d385f0f9f9f9f9f9f954f9f954f994f9f954f9f954f9f954f9f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9e  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`',
      码:" 268",
      sqlState:" HY000",
      1级,
      位置:0}}
 75xBkbD2wWSvaoQGion-execution-srv.cfapps.eu10.hana.ondemand.com-[2019-08-15T15:32:16.084 + 0000]" GET/odata/v4/CatalogService/Users('austin.kloske@contax.com')  ?$ expand = ToAuthorizations HTTP/1.1" 500 0 154"-"" Mozilla/5.0(X11; CrOS x86_64 12239.67.0)AppleWebKit/537.36(KHTML,如Gecko)Chrome/76.0.3809.102 Safari/537.36""-""  10.0.138.254:61013" x_forwarded_for:"-" x_forwarded_proto:" https" vcap_request_id:" 47ccda5c-0e52-4e49-6195-998a9e7fa5dc" response_time:0.093576791 app_id:" 480109c9-3023-4363-be92-2a0_bad_index"  x_correlationid:" 3ce7b0ab-c98a-4ced-4428-2cb743e1b1b3" tenantid:"-" x_b3_traceid:" c8eaa1f7f0a389dc" x_b3_spanid:" c8eaa1f7f0a389dcdc" x_b3_parentspanid7-f1a7f0aaf1a7f0aaf1a7f0aaf1a7f0aaf0aaf7af0aaf1af7af0a-f1af7af0b-faaf7af0b-e

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

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


1)我已经使用业务应用程序模板data-model.cds文件定义了父+子实体集:

(遵循 CDS协会上的SAP文档

实体用户{
 密钥电子邮件:Common.DataKey;
 名字:Common.DataKey;
 姓氏:Common.DataKey;
 密码:Common.DataKey;
 ToAuthorizations:与许多Data.Authorization关联到ToAuthorizations.User = $ self;
 }


 实体授权{
 关键用户:与Data.User的关联;
 密钥ID:Common.DataKey10;
 

2)并通过目录服务公开实体:

 service CatalogService {

 实体用户@(
 能力:{
 InsertRestrictions:{Insertable:true},
 UpdateRestrictions:{可更新:true},
 DeleteRestrictions:{可删除:true}
 }
 )作为Data.User的投影;

 实体授权@(
 能力:{
 InsertRestrictions:{Insertable:true},
 UpdateRestrictions:{可更新:true},
 DeleteRestrictions:{可删除:true}
 }
 )作为对Data.Authorization的投影;
 

/ToAuthorizations可以正常工作

请求网址:
 https:// -approuter.cfapps.eu10.hana.ondemand.com/odata/v4/CatalogService/Users('email')/ToAuthorizations
 请求方法:
 得到
 状态码:
 200 OK
 远端地址:
 35.157.43.191:443
 推荐人政策:
 降级时无推荐人
 

?$ expand = ToAuthoriations失败"错误:列的定义不明确:"

请求网址:
 https:// -approuter.cfapps.eu10.hana.ondemand.com/odata/v4/CatalogService/Users('email')?$ expand = ToAuthorizations
 请求方法:
 得到
 状态码:
 500内部服务器错误
 远端地址:
 18.185.232.121:443
 推荐人政策:
 降级时无推荐人
 
 rootCause:
    {[错误:定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_USER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9。  USER_EMAIL AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.User_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS的电子邮件Data_User  tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.User_Email = filterExpand.Email)te9b38c6d385f0f9f9f9f9f9f954f9f954f994f9f954f9f954f9f954f9f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9e  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`]
      消息:"定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_USER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.User_Email  AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,te9b38c6d385050b954d0fca6b994b1f9.User_Email AS te9b38c6d385050b954d0fca6b994b1f9_User_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.User_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS的电子邮件Data_User  tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.User_Email = filterExpand.Email)te9b38c6d385f0f9f9f9f9f9f954f9f954f994f9f954f9f954f9f954f9f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9f954f9e  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`',
      码:" 268",
      sqlState:" HY000",
      1级,
      位置:0}}
 75xBkbD2wWSvaoQGion-execution-srv.cfapps.eu10.hana.ondemand.com-[2019-08-15T15:32:16.084 + 0000]" GET/odata/v4/CatalogService/Users('austin.kloske@contax.com')  ?$ expand = ToAuthorizations HTTP/1.1" 500 0 154"-"" Mozilla/5.0(X11; CrOS x86_64 12239.67.0)AppleWebKit/537.36(KHTML,如Gecko)Chrome/76.0.3809.102 Safari/537.36""-""  10.0.138.254:61013" x_forwarded_for:"-" x_forwarded_proto:" https" vcap_request_id:" 47ccda5c-0e52-4e49-6195-998a9e7fa5dc" response_time:0.093576791 app_id:" 480109c9-3023-4363-be92-2a0_bad_index"  x_correlationid:" 3ce7b0ab-c98a-4ced-4428-2cb743e1b1b3" tenantid:"-" x_b3_traceid:" c8eaa1f7f0a389dc" x_b3_spanid:" c8eaa1f7f0a389dcdc" x_b3_parentspanid7-f1a7f0aaf1a7f0aaf1a7f0aaf1a7f0aaf0aaf7af0aaf1af7af0a-f1af7af0b-faaf7af0b-e  
付费偷看设置
发送
4条回答
SC_Yao
1楼-- · 2020-09-03 12:16

这似乎是一个别名问题(基于呈现的SQL)。

您是否曾尝试对Authorization实体中的User属性使用其他别名?

类似的东西:

实体授权{
 关键AuthorizedUser:与Data.User的关联;
 密钥ID:Common.DataKey10; 
哎,真难
2楼-- · 2020-09-03 12:13

Abdel,

我正在使用在SAP Cloud Platform生产环境中运行的HDI容器。 该数据库是HANA 2.0 SP03。

为了详细说明,我在尝试使用JS提取执行深度插入时注意到了这个问题。 开源文档说,我应该能够发布与GET?$ expand返回的有效载荷结构相同的内容。

SAP已确认此问题为事件446601,并表示他们将在一周内提供更新。 如果您自己尝试使用该插件,那么我的真正问题是无法将深层插入POST到v4 OData服务,而$ expand问题是一个上游问题。 您将如何尝试发布深层插入?

 var url ='../odata/v4/CatalogService/Users';
             var userData =
                 {
                     电子邮件:sEmail,
                     名:sFirstName,
                     姓:sLastName,
                     密码:sPassword,
                     ToUserAuthorizations:[
                         {电子邮件:sEmail,授权:" BASIC"},
                         {电子邮件:sEmail,授权:"高级"}
                     ]
                 };
            
            
             this._postData(url,userData).then(function(response){
                 if(response.ok){
                     返回response.json();
                 }
                 抛出新的错误("网络响应不正常。");
             })。then(function(myjson){
                 MessageToast.show(myjson.Email +"创建成功!");
             })
             .catch(错误=> console.error(错误));
 
半个程序猿
3楼-- · 2020-09-03 11:54

我已按照您的回复中的说明重命名了我的授权密钥,并重建了项目,但仍然收到相同的错误。 我对SQL没有经验,所以如果安静就很难进行故障排除。

实体用户{
 密钥电子邮件:Common.DataKey;
 名字:Common.DataKey;
 姓氏:Common.DataKey;
 密码:Common.DataKey;
 ToAuthorizations:与许多Data.Authorization关联到ToAuthorizations.AuthorizedUser = $ self;
 }

 实体授权{
 关键AuthorizedUser:与Data.User的关联;
 密钥ID:Common.DataKey10;
 }

 请求:/odata/v4/CatalogService/Users('austin.kloske@contax.com')?$expand=ToAuthorizations

 SQL错误:
 [cds]-在/odata/v4/CatalogService/中提供CatalogService
 错误:[2019-08-20T17:45:16.918Z | 错误|  1496663]:发生错误:发生意外的SQL错误,
 Stacktrace:SqlError:发生意外的SQL错误
 在_dbc.prepare(/home/vcap/app/node_modules/@sap/cds/node_modules/@sap/cds-hana/lib/client/Client.js:234:25)
 在Statement.handle(/home/vcap/app/node_modules/hdb/lib/protocol/Statement.js:82:12)
 在handleReply(/home/vcap/app/node_modules/hdb/lib/Client.js:228:15)
 在接收时(/home/vcap/app/node_modules/hdb/lib/util/Queue.js:113:18)
 在Connection.receive(/home/vcap/app/node_modules/hdb/lib/protocol/Connection.js:365:3)
 在TLSSocket.ondata(/home/vcap/app/node_modules/hdb/lib/protocol/Connection.js:223:12)
 在emitOne(events.js:116:13)
 在TLSSocket.emit(events.js:211:7)
 在addChunk(_stream_visible.js:263:12)
 在可读AddChunk(_stream_visible.js:250:11)
 在TLSSocket.Readable.push(_stream_visible.js:208:10)
 在TLSWrap.onread(net.js:601:20){SqlError:发生意外的SQL错误
 在_dbc.prepare(/home/vcap/app/node_modules/@sap/cds/node_modules/@sap/cds-hana/lib/client/Client.js:234:25)
 在Statement.handle(/home/vcap/app/node_modules/hdb/lib/protocol/Statement.js:82:12)
 在handleReply(/home/vcap/app/node_modules/hdb/lib/Client.js:228:15)
 在接收时(/home/vcap/app/node_modules/hdb/lib/util/Queue.js:113:18)
 在Connection.receive(/home/vcap/app/node_modules/hdb/lib/protocol/Connection.js:365:3)
 在TLSSocket.ondata(/home/vcap/app/node_modules/hdb/lib/protocol/Connection.js:223:12)
 在emitOne(events.js:116:13)
 在TLSSocket.emit(events.js:211:7)
 在addChunk(_stream_visible.js:263:12)
 在可读AddChunk(_stream_visible.js:250:11)
 在TLSSocket.Readable.push(_stream_visible.js:208:10)
 在TLSWrap.onread(net.js:601:20)
 名称:" SqlError",
 根本原因:
 {[错误:定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_AUTHORIZEDUSER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9。  AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b  954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS电子邮件FROM Data_User tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email = filterExpand.Email)te9b38c6d385050b954d0fca6b994b1f9 WHERE te9b38c6d385050b954d0fca6b994b1f9.rowNumber>?  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`]
 消息:"定义的含糊柱:TE9B38C6D385050B954D0FCA6B994B1F9_AUTHORIZEDUSER_EMAIL:行1个栏120(在pos 119):`SELECT te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,te9b38c6d385050b954d0fca6b994b1f9.te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email FROM(SELECT te9b38c6d385050b954d0fca6b994b1f9.ID AS te9b38c6d385050b954d0fca6b994b1f9_ID,te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email  AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email AS te9b38c6d385050b954d0fca6b994b1f9_AuthorizedUser_Email,ROW_NUMBER()OVER(PARTITION BY te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email)AS ROWNUMBER FROM Data_Authorization te9b38c6d385050b  954d0fca6b994b1f9 INNER JOIN(SELECT tee4a5c246a800bcdc8128aa48309fa01.Email AS电子邮件FROM Data_User tee4a5c246a800bcdc8128aa48309fa01 WHERE tee4a5c246a800bcdc8128aa48309fa01.Email =?)filterExpand ON te9b38c6d385050b954d0fca6b994b1f9.AuthorizedUser_Email = filterExpand.Email)te9b38c6d385050b954d0fca6b994b1f9 WHERE te9b38c6d385050b954d0fca6b994b1f9.rowNumber>?  AND te9b38c6d385050b954d0fca6b994b1f9.rowNumber <?`',
 码:" 268",
 sqlState:" HY000",
 1级,
 位置:0}}



 
天桥码农
4楼-- · 2020-09-03 12:15

您好,奥斯丁,

从错误堆栈跟踪中可以看出,您正在使用NodeJS运行时。

最好的问候,

Kranti

一周热门 更多>