on 10-12-2007 1:08 PM
Hi @all!
I have a new Question.
I am Beginner and would like two numbers handed on java over functional module, count on to let and sap return on.
The JCO server is furnished, always gets as result 0.
Here my beginning code:
<b>Function Module:</b>
CALL FUNCTION 'Z_TEST' destination 'JAVARFC'
EXPORTING
f1 = f1
f2 = f2
IMPORTING
p = p
.
<b>Bean.java</b>
public void processFunction(JCO.Function function) {
try {
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList output = function.getExportParameterList();
JCO.ParameterList tables = function.getTableParameterList();
if (function.getName().equals("Z_TEST")) {
input.setValue(input.getString("f1"), "f1");
input.setValue(input.getString("f2"), "f2");
.
.
.
and now? as it continues and is correct that?
thanks in advance
hi!
thanks for your help.
@franz
the result in sap is always null.
what can be?
the source code is correct.
my fuction module in sap:
FUNCTION Z_TEST.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(F1) TYPE INT4
*" VALUE(F2) TYPE INT4
*" EXPORTING
*" VALUE(P) TYPE INT4
*"----------------------------------------------------------------------
ENDFUNCTION.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
It don't work. p is always 0.
Must I parse p in output or must I parse f1 and f2 back? How?
Here again my code:
<b>Function Module:</b>
FUNCTION Z_TEST.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(F1) TYPE INT4
*" VALUE(F2) TYPE INT4
*" EXPORTING
*" VALUE(P) TYPE INT4
*"----------------------------------------------------------------------
ENDFUNCTION.
<b>ABAP</b>
REPORT zdk_test03.
DATA: P TYPE i.
PARAMETERS: F1 TYPE i,
F2 TYPE i.
CALL FUNCTION 'Z_TEST' DESTINATION 'JAVARFC'
EXPORTING
F1 = F1
F2 = F1
IMPORTING
P = P.
WRITE P.
<b>Java</b>
public void processFunction(JCO.Function function) {
try {
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList output = function.getExportParameterList();
JCO.ParameterList tables = function.getTableParameterList();
function.getName().equals("Z_TEST");
int f1 = Integer.parseInt (input.getString("F1"));
int f2 = Integer.parseInt (input.getString("F2"));
output.setValue(f1+f2,"P");
} catch (java.lang.Exception e) {
e.printStackTrace();
}
}
Thanks in Advance
Hello
what about this
public void processFunction(JCO.Function function) {
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList output = function.getExportParameterList();
JCO.ParameterList tables = function.getTableParameterList();
int f1 = Integer.parseInt (input.getString("f1));
int f2 = Integer.parseInt (input.getString("f2));
output.setValue (f1+f2,"p");
....
regards franz
reward points if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Denis,
I did someting with a JCO Server, in that time i remember that i have some problems with de input parameter to pass to the remote function, the problem is that you have to cast this variables. For example:
input.setValue ( (String) input.getSring("f1"), "f1" );
Good luck
if help you, regards
Joshua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.