cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Server: Working with tables as input parameter

Former Member
0 Kudos

Hello,

I'm using JCO server as described in weblog /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection

I'm having some issues working with tables. My function has 2 tables, one containing a compressed string (input from abap) and one containing the uncompressed version of the string (sent back to abap). My function is defined as follow:

fmeta = new JCO.MetaData("Z_DEFLATE");

fmeta.addInfo("STRING_LEN", JCO.TYPE_INT, 255, 0, 0, JCO.IMPORT_PARAMETER, null);

fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255, 0, 0, JCO.EXPORT_PARAMETER, null );

fmeta.addInfo("STRING_IN", JCO.TYPE_TABLE, 144, 0, 0, 0, "XML");

fmeta.addInfo("XML", JCO.TYPE_TABLE, 144, 0, 0, 0, "XML");

repository.addFunctionInterfaceToCache(fmeta);

In SAP, the FM is defined using tables with lines of char1024.

When trying to retrieve the table content:

JCO.Table strin_table=tables.getTable("STRING_IN");

int numRows = strin_table.getNumRows();

numRows is zero and I'm not able to read any line from the table object.

Any suggestion?

Thanks,

Laurent

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello

maybe you should use a JCO.Client to fetch the Metadata (if possible), because it's hard to built the metadata on your own (even harder if you have to support both unicode and none unicode)

regards franz

Former Member
0 Kudos

I'm not sure you can do that since jco is used as a server and not a client. You basically have to define which functions (and parameters) are implemented on the Jco server.

Former Member
0 Kudos

Hello

you need indeed a client connection to use JCO.Server as i supposed

And if it is possible to also hava a JCO.Client Connection (which then gets used by JCO.Server to fetch the Metadata) it makes programmers life much easier, because the metadata is built automatically by JCO and you don't have to do it by yourself

download ftp://ftp.sap.com/pub/sapjco/sapjco2xDocs.zip extract and have a look at Example 7

regards franz

Message was edited by:

Franz Ferner