Skip to Content
0
Apr 27, 2020 at 11:09 AM

How to use Curr type and Jco Table as Jco import parameter

29 Views

I have a RFC named ZFMM05 with two import parameters PRHEAD and PRITEM and a export parameter O_NUM. PRHEAD is a structure with a field PRVALUE of CURR type. PRITEM is table type.

I use below code to call the JCoFunction.

 function=destination.getRepository().getFunction("ZFMM05");
if (function==null) throw new RuntimeException("STFC_CONNECTION not found"); 
JCoStructure PRhead = function.getImportParameterList().getStructure("PRHEAD");
PRhead.setValue("PRVALUE",500);
JCoTable PRItem=function.getImportParameterList().getTable("PRITEM");
PRItem.appendRow();
PRItem.setValue("MATNR", "S0010010");
function.execute(destination);
result=function.getExportParameterList().getString("O_NUM");
System.out.println("Result is"+result);

There is no error but the result is empty. Is this because the way I use CURR and table parameter is wrong? Can someone give me some suggestion? Thx.