cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Java Program when passing table to RFC function . JCO is used

Former Member
0 Kudos

Hai All,

I developed a JAVA application to update data into SAP using JCO via RFC. When i pass table to the function module i am getting the below error

com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Conversion from type T to D not supported.

Please let me know how to solve this.

Below is my code

IRepository m_Repository;

IFunctionTemplate ftemplate;

JCO.Table PwdReq;

JCO.Function function;

m_Repository = JCO.createRepository("MYRepository", client);

ftemplate = m_Repository.getFunctionTemplate("Z_GESEFM_UPD_PWD_RESET_REQUEST");

// Create a function from the template

function = new JCO.Function(ftemplate);

// Feeding in input parameters

PwdReq = function.getTableParameterList().getTable("RESULT2");

String userid = "PATCHTEST14 ", reqDate = "",reqNo = "01",reqStatus = "03", boxID = "09",ind2 = "X",

lcode = "abcd",rem = "One record testing";

PwdReq.appendRow();

PwdReq.setValue(userid, "USERID");

PwdReq.setValue(reqNo,"REQ_NO");

PwdReq.setValue(reqStatus,"REQ_STATUS");

PwdReq.setValue(boxID,"BOX_ID");

PwdReq.setValue(ind2,"IND2");

PwdReq.setValue(lcode,"LCODE");

PwdReq.setValue(rem,"OTHER_REMARKS");

// execute the function with the input parameters

client.execute(function);

Thanks & Regards,

H.K.Hayath Basha.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hai ,

The problem is solved. The RFC function which i called had a bug. That fuction module updates a table with current date, instead of passing date to that field time is passed that's why i got the error.

Regards,

Basha.

Former Member
0 Kudos

Hi,

Could you please post the parameters of the function you are using? Without that information, it's not easy to reproduce the error.

regards

daniel

Former Member
0 Kudos

hi,

I am not very good in Java.

but try this code to giving input parameter.

function.getImportParameterList().setValue(userid, "USERID");

if you are not using Try and Catch blok then use Try and Catch blok,

Regards

Manoj