on 05-17-2009 4:54 AM
hi ,
i am trying to call java program from abap. i have doen all the settings required in sm59 and the respective function module reqd and the program to call the fucntion module but i am not able to get the import parameters in my java program (listener on the server). the return value gets sent properly.
i have program which passes parameters to the function module . niether i am able to get values from import parameter nor from table values. i have trying for quite some time now
REPORT ZTEST_KUMAR.
DATA : W_RET TYPE char255.
DATA : w_val TYPE char255,
itab TYPE TABLE OF ZTEST_PDF,
wa TYPE ZTEST_PDF.
wa-CUST1I = 'TESTS'.
wa-TEMP = 'ALLLL'.
append wa to itab.
w_ret = 'skasnask'.
w_val = 'djsdjsdsd'.
CALL FUNCTION 'ZTEST_PDF_CREATE' DESTINATION 'GNJ2EEGCD'
EXPORTING
TEST = w_val
IMPORTING
RETURNVAL1 = w_ret
TABLES
TEST_TABLE = itab.
WRITE W_VAL.
WRITE W_RET.
-
java program handle request----
protected void handleRequest(JCO.Function function)
{
if (function.getName().equals("ZTEST_PDF_CREATE")) {
try{
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList output = function.getExportParameterList();
JCO.ParameterList tables = function.getTableParameterList();
JCO.Table table1 = tables.getTable(0);
System.out.println(input.getValue("TEST"));
//String importval = input.getValue("INPUT").toString();
output.setValue("KUMAR212", "RETURNVAL1");
try "commit" after rfc call...
CALL FUNCTION 'ZTEST_PDF_CREATE' DESTINATION 'GNJ2EEGCD'
EXPORTING
TEST = w_val
IMPORTING
RETURNVAL1 = w_ret
TABLES
TEST_TABLE = itab.
commit work and wait.
regards,darek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.