我正在使用 SAP JCo3 連接器以及 jar 提供的 .dll 文件。目標(biāo)連接成功。我的問(wèn)題是,當(dāng)我執(zhí)行 function.execute(destination) 時(shí),function.getTableParameterList().getTable("PART_LIST") 返回一個(gè)空表,其中行為零我實(shí)現(xiàn)連接的代碼如下JCoDestination dest = JCoDestinationManager.getDestination("EOMP");dest.ping();JCoRepository repo= dest.getRepository();JCoFunctionTemplate ftemplate = repo.getFunctionTemplate("Z_BAPI_GET_ESO_PART");JCoFunction function = ftemplate.getFunction();JCoParameterList importParams = function.getImportParameterList();importParams.setValue("ESO","R1S00444");importParams.toXML();function.execute(dest);JCoParameterList tableParamList=function.getTableParameterList();JCoTable table=tableParamList.getTable("PART_LIST");
2 回答

隔江千里
TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超10個(gè)贊
幾天前我也有同樣的現(xiàn)象......
過(guò)了一會(huì)兒,我注意到要傳遞的參數(shù)——如果它是一個(gè)字符——必須和字段的大小一樣長(zhǎng)。
您的字段長(zhǎng)度為 12 且為字符。如果您直接在 SAP 中調(diào)用您的函數(shù),則傳遞 eg1234567891
并獲得您想要的結(jié)果。
但是,如果從 RFC 連接調(diào)用它,則必須準(zhǔn)備記錄001234567891
。
查找數(shù)據(jù)庫(kù)表。使用表中給定的示例進(jìn)行嘗試。
添加回答
舉報(bào)
0/150
提交
取消