Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Calling an RFC from JCo

Hi experts.

I am new to JCo and I am trying to call an RFC from my Java application. What I am trying to do is to write to an ODS by using RSDRI_ODSO_INSERT_RFC.

In the ODS I have one single key, a CHAR(1).

What happens is that an entry is added, but it's empty! In the code below, for example, I'm trying to write a "Y", but it adds a row but no data.

IFunctionTemplate function = repository.getFunctionTemplate("RSDRI_ODSO_INSERT_RFC");

JCO.ParameterList params = function.getImportParameterList();
params.setValue("ZCOCKPIT", "I_ODSOBJECT");

JCO.Table tables = function.getTableParameterList().getTable("I_T_DATA");

tables.appendRow();
tables.setValue("Y", 0);

connection.execute(function);

Information about the function:

Import parameter list:
  > I_ODSOBJECT (CHAR 30) : 		ODS Object
  > I_RFCDATA_UC (XSTRING 8) : 		Parameter for Transfer of Data to Be Inserted

Export parameter list:
  > E_NUMROWS (INT 4) : 		Number of Inserted Records

Table parameter list:
  > I_T_DATA (TABLE 8) : 		Table with Data to Be Inserted

All inputs are appreciated!

Thank you!

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question