我用java写的程序调用sap函数模块的时候出现以下错误,这是为什么

com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: The function module "ZRFC_OMS_ZPTD" not released for 'remote' calls.
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1242)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3816)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3261)
at makubex.util.SAP_RemoteFunctionCaller.executeFunction(SAP_RemoteFunctionCaller.java:388)
at qqbean.sm.oms.pc.job.LES.GetPTDDDetail.execute(GetPTDDDetail.java:78)
at qqbean.sm.oms.pc.job.LES.SynchronizationPTDDetail.run(SynchronizationPTDDetail.java:63)
at java.lang.Thread.run(Thread.java:619)

但是系统东的确有ZRFC_OMS_ZPTD,那位大神帮忙解决一下啊?拜谢了

LEATH
浏览 109回答 2
2回答

慕桂英546537

java程序远程调用sap函数代码:  JCoDestination destination = rfcSource.getDestination();  JCoFunction function = destination.getRepository().getFunction(funcName);  JCoParameterList paramStrlist = function.getImportParameterList();  JCoParameterList paramTableList = function.getTableParameterList();  List<String> paramList = getParamList();  for (String param : paramList) {  int index = param.indexOf(":{");  if(index >= 0){  String type = param.substring(0,index);  if(type.toLowerCase().equals("strings")){  String typeValues = param.substring(index + 2,param.length() - 1);  String[] paramArray = typeValues.split("[|]");  for (String pa : paramArray) {  paramStrlist.setValue(pa, paramMap.get(pa));  }  }else if(type.toLowerCase().equals("tables")){  String typeValues = param.substring(index + 2,param.length() - 1);  String[] paramArray = typeValues.split("[;]");  for (String pa : paramArray) {  int tabIndex = pa.indexOf(":");  if(tabIndex >= 0){  String tableName = pa.substring(0,tabIndex);  String tableFields = pa.substring(tabIndex +1); //  String[] tfArray = tableFields.split("[|]");  paramTableList.getTable(tableName).appendRow();  for (String tf: tfArray) {  paramTableList.getTable(tableName).setValue(tf, paramMap.get(tableName+ "." + tf));  }  }  paramTableList.set  }  }  }  }  function.execute(destination);  String queryString = getQryString();  String rfcName = queryString.substring(0, queryString.indexOf(","));  String rfcParam = queryString.substring(rfcName.length() + 1);  final String[] returnType = { "TABLES", "STRUCTURES", "STRINGS" }; //SAP输出类型格式&nbsp;

猛跑小猪

如果要外部调用的话,需把processing Type 选成Remote-Enabled Module才可以。修改方式:se37(选择ZRFC_OMS_ZPTD)-》attributes--》processing Type--》Remote-Enabled Module。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java