“NOT_SUPPORTED_BY_GUI” JCo 中的异常
我们有一个 BAPI,可将指定文档上传到 SAP 软件。
BAPI 接受三个参数:ID
、FILE_LOC
、FOLDER_NAME
。
我在 JCo 代码中设置值如下:
JCO.ParameterList paramList = function.getImportParameterList();
paramList.setValue("101XS1", "EXTERNAL_ID");
paramList.setValue("tmp", "FOLDER_NAME");
paramList.setValue("D:/upload/foo.txt", "FILE_LOCATION");
但是,当我尝试执行 BAPI 时,出现以下异常:
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Exception condition "NOT_SUPPORTED_BY_GUI" raised.
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1242)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3816)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3261)
如果我通过胖客户端(SAP 登录)执行,则相同的 BAPI 工作正常。但通过 JCo,它给出了这个错误。
We are having a BAPI that uploads the specified document to SAP software.
The BAPI accepts three parameters: ID
, FILE_LOC
, FOLDER_NAME
.
And I'm setting the values as follows in the JCo code:
JCO.ParameterList paramList = function.getImportParameterList();
paramList.setValue("101XS1", "EXTERNAL_ID");
paramList.setValue("tmp", "FOLDER_NAME");
paramList.setValue("D:/upload/foo.txt", "FILE_LOCATION");
But when I'm trying to execute the BAPI, am getting the following exception:
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Exception condition "NOT_SUPPORTED_BY_GUI" raised.
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1242)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3816)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3261)
The same BAPI is working fine if I execute through thick client (SAP Logon). But through JCo, it's giving this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个错误本身并不会告诉您更多信息,只是“ABAP 程序(功能模块)引发了名为 NOT_SUPPORTED_BY_GUI 的异常”。这真正的含义可能是该功能模块试图访问一些与 GUI 相关的功能 - 这对于 BAPI 来说是非法的,因此这要么是定制的 RFC 功能模块,要么您在 SAP 标准编码中发现了编程错误,应该打开 SAPnet 支持票证。
This error in itself does not tell you more than "the ABAP program (function module) raised an exception named NOT_SUPPORTED_BY_GUI". What this really means is probably that the function module tried to access some GUI-related function - which is illegal for BAPIs, so either this is a custom-made RFC function module or you have found a programming error in the SAP standard coding and should open a SAPnet support ticket.
您不能在非 GUI 操作中使用 GUI 服务,例如 RFC 或后台作业。一般来说,避免使用类 cl_gui_frontend_services 和函数 GUI_*。或者在启用 RFC 的函数中使用 OPEN_DATASET FOR INPUT/OUTPUT 指令。
问候
You can't use GUI services in non-gui operations, as RFC or background JOBs. In general avoid use of class cl_gui_frontend_services and functions GUI_*. Alternatively use OPEN_DATASET FOR INPUT/OUTPUT isntruction in your RFC enabled function.
Regards