Skip to Content
Former Member
May 02, 2009 at 08:15 AM

Only can use JCo to access default BAPIs but can't access developed BAPIs



My problem is I can't use JCo to access the BAPI developed by myself, but can access the default BAPI like BAPI_COMPANY_GETLIST.

These BAPIs developed by myself can be tested in BAPI Explore correctly.

But It can't work in java program using JCo. (can't work means it can run without any bug and I can set values into ImportParameters, but I can't get ExportParameters and Table Parameters)

It sounds like the BAPI can't access remotly but I'm sure that I set the "remote enabled" in attribute tab.

I really don't know what's the problem, and spent many hours try to solve it but it still can't work.

Is there anything I should check? I really need some help.

Here is some part of my source code. The biggest problem is I can't retrieve the returned internal table, but if I change the function module from BAPI_ZAB02_TH2 to any other default function module (like BAPI_COMPANY_GETLIST) and I can retreive the returned internal table....

Thanks in advance.


IFunctionTemplate functionTemplate =


JCO.Function function = new JCO.Function(functionTemplate);

JCO.ParameterList Input = function.getImportParameterList();



JCO.ParameterList outnput = function.getExportParameterList();

JCO.Structure returnStructure = function.getExportParameterList().getStructure("RETURN");

JCO.Table ODTable = null;

//retrieve table

ODTable =function.getTableParameterList().getTable("ITAB2");


for (JCO.FieldIterator e = ODTable.fields(); e.hasMoreElements(); )


JCO.Field field = e.nextField();

if (field.getName().equals("VBELN"))

Ship_to_party = field.getString();