cancel
Showing results for 
Search instead for 
Did you mean: 

Transfering data from JAVA to ABAP

Former Member
0 Kudos

Hi Experts,

I have a little problem with my Java application. I want to transfer data from JAVA to ABAP. If I do that only with a String everything works fine. But now I want to fill a table in ABAP with table sets out of my JAVA application and here I don't know how to do that.

Do anybody of you know how to do that? A example would be very helpful. Thank you for your help in advance.

Some informations about the application:

I have an RFC connection between JAVA and ABAP. I am using the Java Connector to listen to that connection. In ABAP I have a RFC compatible function module.

Greetings, Alexander

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can try the foll:

// Get a function template from the repository

IFunctionTemplate ftemplate = repository.getFunctionTemplate("ZGS_TEST_RFC");

// if the function definition was found in backend system

if(ftemplate != null)

{

// Create a function from the template

JCO.Function function = ftemplate.getFunction();

// Get a client from the pool

client = JCO.getClient(SID);

// Fill in input parameters

JCO.Table input = function.getTableParameterList().getTable("T_INPUT");

input.appendRow();

input.setRow(0);

input.setValue( "test1", "ZSTR1");

input.setValue( "test2", "ZSTR2" );

input.appendRow();

// Call the remote system

client.execute(function);

// Get output parameters

JCO.Table output = function.getTableParameterList().getTable("T_OUTPUT");

int num = output.getNumRows();

// Call the remote system

}

Let me know if you face any issues.

Regards,

Gaurav