Hi I am using SAP JCo3 connector along with .dll file provided with the jar.
the destination is successfully connected. My problem is that when I am doing the function.execute(destination)
the function.getTableParameterList().getTable("PART_LIST")
returns an empty table with zero rows.
My code to achieve the connectivity is as below:
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");
I had the same phenomenon a few days back ...
After a while, I noticed that the parameter to be passed - if it is a char - must be as long as the size of the field.
Your field length is 12 and is char. If you call your function directly in SAP, you pass on e.g.
1234567891
and get your desired result.However, if you call it from the RFC connection, you must prepare the record
001234567891
.Look up the DB-table. Try it with the given example in the table.