关于 SAP AMDP 调用错误消息 client-specific and restricts access to a client

简介: 关于 SAP AMDP 调用错误消息 client-specific and restricts access to a client

近日一个朋友做 SAP AMDP 开发时,遇到如下错误消息:XXX is client-specific and restricts access to a client. The calling AMDP method XX must also allow this restriction.


image.png



本文将这个错误消息相关的背景知识记录如下。


发生问题的场景是在基于 S4/HANA 系统的 ABAP Test Cockpit ATC 和 CVA 检查的代码增强过程中,决定将 OpenSQL Select 语句移动到通过 HANA 数据库上的 AMDP 存储过程访问的 CDS 视图中。


创建 CDS 视图,在其中使用 WHERE 子句中的会话参数 $session.client 根据 MANDT 列上的会话客户端值过滤数据,如下面的 SELECT 代码所示:


select * from vbrk where vbrk.mandt = $session.client;


image.png


当我尝试在我的 AMDP 类方法(HANA 数据库上的存储过程)中使用此 CDS 视图时,我遇到了以下错误,导致 AMDP 无法成功编译和激活。


xxx is client-specific and restricts access to a client. The calling AMDP method “AMDP_METHOD” must also allow this restriction.


在以下代码行中,ABAP 开发人员可以看到我如何在 AMDP 中调用 CDS 视图并使用 APPLY_FILTER 命令应用 WHERE 子句。


lt_vbrk = apply_filter ("Z_CDS_VIEW", :iv_where);

1

经过官网的搜索,我发现存储过程需要在 AMDP 类方法声明中定义其他 AMDP 选项。


需要修改 AMDP 方法定义如下:


class-methods AMDP_METHOD
AMDP OPTIONS READ-ONLY
CDS SESSION CLIENT current
importing
 value(iv_where) type string
exporting
 value(et_invoicelist_xl) type ZSOM_INF_INV_VBRK_TT
raising cx_amdp_error .



方法的实现体无需进行任何修改。


如果指定了选项 READ-ONLY,则在数据库过程或数据库函数的实现中只允许读取数据库表。 只能调用也标记为只读的其他 AMDP 方法的数据库过程或数据库函数。 这通过语法检查或在运行时进行检查。


此属性也可以在使用 METHOD meth BY DATABASE PROCEDURE|FUNCTION 的 AMDP 方法的实现中使用附加选项来指定。 它适用于在声明或方法的实现中指定时,或两者兼而有之。


在 AMDP 函数或 L 过程的实现中,选项 READ-ONLY 必须至少指定一次。 如果在带有 RETURNING 参数的方法声明中使用了附加的 AMDP OPTIONS,则必须已在声明中指定选项 READ-ONLY。



相关文章
|
12月前
|
安全 网络安全 数据安全/隐私保护
关于 SAP cloud com.jcraft.jsch.JschException Auth fail for methods password错误消息
关于 SAP cloud com.jcraft.jsch.JschException Auth fail for methods password错误消息
|
16天前
【APIM】启用APIM Analytics时遇见Request failed错误
Data collection is required for detailed monitoring, custom dashboards, and more. A Log Analytics workspace is also required for the data storage. You can change the workspace destination at any time in Diagnostic settings. How do I use Log Analytics?
43 12
|
2月前
|
API
【Azure APIM】调用APIM的备份接口时候遇见Authentication Failed错误
【Azure APIM】调用APIM的备份接口时候遇见Authentication Failed错误
|
2月前
|
API 开发者
【API管理 APIM】APIM集成内部VNet后,自我访问出现(Unable to connect to the remote server)问题,而Remote Server正是APIM它自己
【API管理 APIM】APIM集成内部VNet后,自我访问出现(Unable to connect to the remote server)问题,而Remote Server正是APIM它自己
|
2月前
|
存储 API 网络安全
【Azure APIM】调用APIM的备份接口时候遇见InvalidParameters错误
【Azure APIM】调用APIM的备份接口时候遇见InvalidParameters错误
|
2月前
|
API
【API Management】使用 APIM Inbound Policy 来修改Content‐Type Header的值
【API Management】使用 APIM Inbound Policy 来修改Content‐Type Header的值
【API Management】使用 APIM Inbound Policy 来修改Content‐Type Header的值
|
4月前
|
Kubernetes 容器 Perl
k8s部署seata 报错 没有提供足够的身份验证信息 [ http-nio-7091-exec-2] [ty.JwtAuthenticationEntryPoint] [ commence] [] : Responding with unauthorized error. Message - Full authentication is required to access this resource
Kubernetes pod 在16:12时出现两次错误,错误信息显示需要完整认证才能访问资源。尽管有此错误,但页面可正常访问。附有yaml配置文件的图片。
333 2
|
存储 数据库
关于 SAP AMDP 调用错误消息 client-specific and restricts access to a client
关于 SAP AMDP 调用错误消息 client-specific and restricts access to a client
|
网络安全
关于 SAP Cloud Connector 500 failed to sign the Certificate 的错误消息
关于 SAP Cloud Connector 500 failed to sign the Certificate 的错误消息
|
11月前
|
API
Unable to register node “xxx“ with API server: Unauthorized
Unable to register node “xxx“ with API server: Unauthorized
874 0