on 04-02-2009 7:15 AM
my SAPsystem connects to an java-service .. thats works.
But I don't know, how I can return table parameters from JAVA to SAP.
ABAP:
call function 'STFC_CONNECTION'
destination 'JCO_RFC'
exporting
requtext = requtext
importing
echotext = echotext
resptext = resptext
tables
rfctest = rfctest.
JAVA: Example5.java - extract from the downloaded JCo2 ZIP demo file ...
if (function.getName().equals("STFC_CONNECTION")) {
output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
output.setValue("This is a response from Example5.java","RESPTEXT");
How to append data in the rfctest table...
tables.setValue(???,'RFCTEST')
}
Update... It's work...
We do not have the definition of RFCTEST table in the Add function 'STFC_CONNECTION' as below:
fmeta.addInfo("RFCTEST", JCO.TYPE_TABLE, 144, 0, 0, 0, "RFCTEST");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aru,
You can take help of bellow code to append a row in JCO table.
Table table = function.getTableParameterList().getTable("<Table Name>");
table.appendRow();
table.setValue(<value>,"field1 Name");
table.setValue(<value>,"field2 Name");
to append one more row in same table you will have to repeat bellow code as many times you want
table.appendRow();
table.setValue(<value>,"field1 Name");
table.setValue(<value>,"field2 Name");
Ninad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ninad,
Above source code, it's work for JCo Client but I'm not able to understand why it doesn't work for JCO server:
JAVA: Example5.java - extract from the downloaded JCo2 ZIP demo file ...
if (function.getName().equals("STFC_CONNECTION")) {
output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
output.setValue("This is a response from Example5.java","RESPTEXT");
//Aru added
JCO.Table table = function.getTableParameterList().getTable("RFCTEST");
}
SAPsystem return runtime errors: "java.lang.NullPointerException"
It's seems got that table is null?
Regards,
Aru
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.