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.

former_member787229
Discoverer
0 Kudos

Hi ,

Can you please provide here the entire code since I also want to integrate SAP through java using RFC

jerryjanda
Community Manager
Community Manager
0 Kudos

This question is from 15 years ago, and the poster is a Former Member. It's unlikely he'll even receive a notification that you commented on his question.

Instead of asking questions as answers in an old thread, please consider posting a new question. That's going to be your best option for getting an answer.

Since you're new to our forums, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members. Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will also help you when preparing questions for the community.

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Kind regards,

--Jerry

Moderation Lead

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I am doing samething but i am getting following error while executing function statement

Can anybody help me in this

Exception in thread "main" com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Illegal access to a string (offset too large)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1242)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3816)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3261)

at com.example.Testingrfq.main(Testingrfq.java:35)

Former Member
0 Kudos

hi

I am doing the same thing but i am getting following error

Exception in thread "main" com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Illegal access to a string (offset too large)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1242)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3816)

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3261)

at com.example.Testingrfq.main(Testingrfq.java:35)

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.