cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Jco Problem

Former Member
0 Kudos

Hello,

I am trying to use the "BAPI_CATIMESHEETRECORD_GETLIST" Bapi with the Sap Jco 2.1.5. My Problem is that I do not get any return values from the Bapi. I have tested configuration with a sample program of the Sap Jco libary and it worked. So I suspect that the problem is in my code for the Bapi, but I just can not see the problem. Could somebody give me a hint what I am doing wrong? I am running out of ideas.

Here is my code:

JCO.Function function = null;

function = this.createFunction("BAPI_CATIMESHEETRECORD_GETLIST");

String datestr = createSapDateStr(fromdate);

function.getImportParameterList().setValue(datestr, "FROMDATE");

datestr = createSapDateStr(todate);

function.getImportParameterList().setValue(datestr, "TODATE");

JCO.Table table = function.getTableParameterList().getTable("Sel_Employee".toUpperCase());

table.appendRow();

table.setValue("1000000", "HIGH");

table.setValue("1", "LOW");

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

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

function.getTableParameterList().setValue(table, "Sel_Employee".toUpperCase());

mConnection.execute(function);

JCO.Structure returnStructure = function.getExportParameterList()

.getStructure("RETURN");

The code throws an Exception in the last line because the getExportParameterList() is null. I believe Sap Jco did not return anything. I have done a System.out.println(function.toString()); and got this:

Name: BAPI_CATIMESHEETRECORD_GETLIST

Input:

-

-


| PARAMETERS 'INPUT'

-

-


FROMDAT

TEXT

TODATE

-

-


01234567

8

90123

45678901

-

-


20040101

20050518

-

-


Output:

null

Tables:

-

-


| PARAMETERS 'TABLES'

-

-


CATSRECORDS_OU

EXTENSIONOU

LONGTEX

RETUR

SEL_EMPLOYE

-

-


012345678901234

567890123456

78901234

567890

123456789012

-

-


BAPICATS2

BAPICATS7

BAPICATS

BAPIRE

BAPIHRSELEMP

-

-


My parameter table "Sel_Employee" looks like this:

-

-


| TABLE 'BAPIHRSELEMPLOYEE'

-

-


O

HIGH

LOW

-

-


0

12

34567890

12345678

-

-


I

BT

01000000

00000001

-

-


The Cats System is customized in SAP and there are tasks in the list. So what can I do? I am greatful for any ideas.

Greetings

Sven Lösekann

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I solved the problem. The Bapi does not return a Returnstructure. It only returns a "CATSRECORDS_OUT" table and nothing else. I found it with the Function Builder of the Bapi Explorer.

Greetings

Sven Lösekann