[英]How to fix 'Unknown type -1 when trying to add field ID to record '
We are programming a sapjco client to automate certain things. 我们正在对sapjco客户端进行编程以使某些事情自动化。 However, one function seems to have problems initializing the functions.
但是,一个功能似乎在初始化功能时遇到问题。 Other function blocks can connect correctly, but this one crashes when attempting to connect.
其他功能块可以正确连接,但是尝试连接时这会崩溃。
The function doesn't have an import. 该函数没有导入。 But we also tried it with import with the same result.
但是我们也用import尝试了同样的结果。 So adding one doesn't seem to work as well
因此,添加一个似乎效果不佳
FUNCTION ZE237_GET_REZEPTID.
TYPES: BEGIN OF ZE237SOLLDATEN_TYP,
id TYPE ZE237SOLLDATEN-ID,
name TYPE ZE237SOLLDATEN-NAME,
END OF ZE237SOLLDATEN_TYP.
DATA lt_table TYPE TABLE OF ZE237SOLLDATEN.
SELECT
id name
FROM ZE237SOLLDATEN
INTO CORRESPONDING FIELDS OF TABLE T_EXPORTNAME.
ENDFUNCTION.
public IntellifarmSapFunction(JCoDestination destination,
JCoRepository repository, String functionname) throws JCoException, IllegalArgumentException {
this.destination=destination;
this.function = repository.getFunction(functionname); //crash here
}
Expected: A pointer of the function 预期:函数的指针
Result: 'Unknown type -1 when trying to add field ID to record' 结果:“尝试添加字段ID进行记录时,未知类型-1”
If any of the fields is of ABAP data type int8 then you need at least the JCo 3.0.18 patch level which adds support for this new data type. 如果任何字段都是ABAP数据类型int8,那么您至少需要JCo 3.0.18补丁程序级别,该级别增加了对该新数据类型的支持。
You can download the latest JCo patch level from https://support.sap.com/jco 您可以从https://support.sap.com/jco下载最新的JCo补丁程序级别
However, I do not recommend to use an ABAP integer type for an ID field. 但是,我不建议对ID字段使用ABAP整数类型。 In ABAP integer types are usually used for calculating purposes only.
在ABAP中,整数类型通常仅用于计算目的。 The preferred data type for numerical data values like an ID should be a NUMC (type n) instead.
像ID这样的数字数据值的首选数据类型应改为NUMC(类型n)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.