这个要怎么new呢?

private JCoTable table = (JCoTable) new HashMap();
我想new
一个JCoTable ,可是直接JCoTable table = new JCoTable()是不行的,

函数式编程
浏览 271回答 2
2回答

富国沪深

Properties logonProperties = new Properties();logonProperties.put("jco.client.ashost", "10.10.11.22");logonProperties.put("jco.client.client", "100");logonProperties.put("jco.client.sysnr", "01");logonProperties.put("jco.client.user", "username");logonProperties.put("jco.client.passwd", "password");File file = new File("sapconnection.jcoDestination");FileOutputStream stream = new FileOutputStream(file, false);logonProperties.store(stream, "SAP connection properties");stream.close();JCoDestination destination = JCoDestinationManager.getDestination("sapconnection");JCoRepository repository = destination.getRepository();JCoFunction function = repository.getFunction("Z_SD_XXXX");JCoParameterList list = function.getImportParameterList();//设置输入参数list.setValue("PLANT", "1000");...function.execute(destination);JCoTable rs = function.getTableParameterList().getTable("TABLE_HEAD");//获取输出List<HeadBean> sh = new ArrayList<HeadBean>();for (int i = 0; i < rs.getNumRows(); i++) {rs.setRow(i);HeadBean s = new HeadBean();s.setCompanyCode(rs.getString("COMPANY_CODE"));s.setSalesOrg(rs.getString("SALES_ORG"));...sh.add(s);}

人到中年有点甜

用JCO.createTable,构造函数是不可见的。
打开App,查看更多内容
随时随地看视频慕课网APP