Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Passing more complex data between JAVA and SAP

Hi,

now that my RFC connection works, i'm trying to pass some data between Java and SAP.

First time i've tried with simple objects like strings and integers and it worked fine. But i do have some problems with more complex structures like tables or one table row. Is it possible to send complete tables filled with data between the two systems? and if yes, how can i achieve it?

I did define a new parameter in the "Tables" tab within the function modul and then tried to access it in JAVA with

JCoTable zrksUsers = function.getTableParameterList().getTable("T_EXAMPLE_TABLE"); but i didnt get any data, only the column definitions.

Do i have to define an export parameter? (of which kind?)

I've tried that too:

FUNCTION ZFB_TEST01.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(IM_USERID) TYPE  STRING
*"  EXPORTING
*"     VALUE(EX_ZRKS) TYPE  ZRKS
*"  TABLES
*"      T_RETURN STRUCTURE  ZRKS
*"----------------------------------------------------------------------

DATA temp TYPE ZRKS.

SELECT * FROM ZRKS INTO temp WHERE USRID = IM_USERID.
ENDSELECT.

EX_ZRKS = temp.

ENDFUNCTION.

but then i get a conversion error in Java:

"122) JCO_ERROR_CONVERSION: Cannot convert field EX_ZRKS of type STRUCTURE to TableRecord"

Thanks in advance!

Former Member
Former Member replied

At runtime you are getting error on which line of above code...

If if you can get some idea from below URL: (they contain both abap and java code)

http://www.sapdev.co.uk/java/jco/bapi_jco.pdf

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question