cancel
Showing results for 
Search instead for 
Did you mean: 

New to JCo

Former Member
0 Kudos

Hi all,

I'm new to JCo and have written the following piece of code to retrieve data from CATS using BAPI_CATIMESHEETRECORD_GETLIST. However, I am not getting the expected output. The value for out_tabs.getNumRows() is shown as 0.

Please review the code and let me know if I am going wrong.

Regards,

Vivek

-


conn.connect();

JCO.Repository rep = new JCO.Repository("TestRepository",conn);

IFunctionTemplate ift = rep.getFunctionTemplate("BAPI_CATIMESHEETRECORD_GETLIST");

JCO.Function getFunct = ift.getFunction();

JCO.Table tabs = getFunct.getTableParameterList().getTable("SEL_EMPLOYEE");

tabs.appendRow();

tabs.setValue("I", "SIGN");

tabs.setValue("BT", "OPTION");

tabs.setValue(1809,"HIGH");

tabs.setValue(1809,"LOW");

Date from = new Date(2001,01,01);

Date to = new Date(2007,01,01);

getFunct.getImportParameterList().setValue(from, "FROMDATE");

getFunct.getImportParameterList().setValue(to, "TODATE");

conn.execute(getFunct);

JCO.Table out_tabs = getFunct.getTableParameterList().getTable("CATSRECORDS_OUT");

System.out.println(out_tabs.getNumRows());

for(int i=0; i<out_tabs.getNumRows();i++)

{

out_tabs.setRow(i);

System.out.println(out_tabs.getString(0)+"\t" + out_tabs.getString(1));

}

conn.disconnect();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Refer this link u will get an idea

<a href="http://www.apentia-forum.de/viewtopic.php?t=1962&sid=9ac1506bdb153c14edaf891300bfde25">JCO</a>

Regards,

Beevin

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

Former Member
0 Kudos

Solved on own. The code was correct, date parameters were not passed properly.

former_member184588
Active Participant
0 Kudos

>

> Solved on own. The code was correct, date parameters were not passed properly.

and how did you fix it?

cu, Vanessa