简体   繁体   English

SAPJco调用BAPI_MATERIAL_DISPLAY

[英]SAPJco invoking BAPI_MATERIAL_DISPLAY

I was trying to invoke BAPI_MATERIAL_DISPLAY functional module from SAP JCO, This is how i pass my input parameter. 我试图从SAP JCO调用BAPI_MATERIAL_DISPLAY功能模块,这就是我传递输入参数的方式。

function.getImportParameterList().setValue("MATERIAL", "10"); function.getImportParameterList()。setValue(“ MATERIAL”,“ 10”);

From my program output i got 从我的程序输出中我得到了

The material 10 does not exist or is not activated. 材料10不存在或未被激活。

If I execute BAPI_MATERIAL_DISPLAY using SAP logon, iam getting the entry. 如果我使用SAP登录执行BAPI_MATERIAL_DISPLAY,IAM将获得该条目。 Using debugger I found that, 使用调试器,我发现,

My input is going as 00000000000010. And so returning response. 我的输入为00000000000010。因此返回响应。

Dunno, how to handle this in a proper way in SAPJCO. Dunno,如何在SAPJCO中正确处理此问题。

I had directly passed the value 00000000000010 from SAPJCo and this time i got an error, com.sap.conn.jco.JCoException: (104) JCO_ERROR_SYSTEM_FAILURE: Screen output without connection to user. 我直接从SAPJCo传递了值00000000000010,这一次,我得到一个错误com.sap.conn.jco.JCoException:(104)JCO_ERROR_SYSTEM_FAILURE:屏幕输出未连接到用户。

Hope SAP is opening a popup. 希望SAP正在打开一个弹出窗口。 Let me know how to solve both the issues in SAPJCO 让我知道如何解决SAPJCO中的两个问题

Field Material has a conversion exit routine. 现场物料具有转换出口例程。 See also its domain MATNR in the DDIC. 另请参见DDIC中其域MATNR。 These conversion exits are always called automatically by SE37 but not when the Remote Function Module is called directly - like here from outside from aa JCo program. 这些转换出口始终由SE37自动调用,但是当直接调用远程功能模块时(例如从JCo程序外部从此处调用)则不会。

So if the BAPI expects to get certain parameters in their SAP internal representation format (I don't know if this is the case here), then you have to do this data transformation on your own beforehand, either by doing this purely within an own routine at Java side, or by calling the appropriate conversion routines at ABAP side via RFC. 因此,如果BAPI希望以其SAP内部表示形式获取某些参数(我不知道是否是这种情况),那么您必须事先自行进行数据转换,方法是完全在一个内部进行Java端的常规例程,或通过RFC在ABAP端调用适当的转换例程。

For more details on this I recommend to study SAP note 206068 . 有关此的更多详细信息,我建议学习SAP注释206068

Regarding your second question with the error message "Screen output without connection to user", I guess that this BAPI expects to have a connection to an SAP GUI for displaying the selected data. 关于错误消息“没有连接用户的屏幕输出”的第二个问题,我想这个BAPI希望与SAP GUI建立连接以显示所选数据。 With a remote function call you don't have a SAP GUI connection by default, but you can attach a SAP GUI to your RFC connection with JCo, namely by specifying the additional logon parameter jco.client.use_sapgui=1 . 通过远程函数调用,默认情况下您没有SAP GUI连接,但是您可以通过JCo将SAP GUI连接到RFC连接,即通过指定其他登录参数jco.client.use_sapgui=1 For this to work, an SAP GUI frontend (either for Windows or for Java) also needs to be installed on your host where JCo is running, of course. 为此,当然还需要在运行JCo的主机上安装SAP GUI前端(用于Windows或Java)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM