富国沪深
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);}